Home | History | Annotate | Download | only in lib_src

Lines Matching refs:dls

7  * This file contains DLS to EAS converter.
54 * converted DLS collection, including the articulation data and
81 * DLS -> EAS Conversion Process:
83 * Another challenge is that the DLS structure does not map well to
84 * the current EAS sound library structure. Not all DLS constructs
85 * are supported, and data from DLS structures must sometimes be
121 #include "dls.h"
228 /* temporary data structure used while parsing a DLS file */
443 * offset - offset into file where DLS data starts
454 SDLS_SYNTHESIZER_DATA dls;
473 EAS_HWMemSet(&dls, 0, sizeof(dls));
476 dls.hwInstData = hwInstData;
477 dls.fileHandle = fileHandle;
482 /* seek to start of DLS and read in RIFF tag and set processor endian flag */
483 if ((result = EAS_HWFileSeek(dls.hwInstData, dls.fileHandle, offset)) != EAS_SUCCESS)
485 if ((result = EAS_HWReadFile(dls.hwInstData, dls.fileHandle, &temp, sizeof(temp), &size)) != EAS_SUCCESS)
489 dls.bigEndian = (temp == CHUNK_RIFF);
491 /* first chunk should be DLS */
493 if ((result = NextChunk(&dls, &pos, &temp, &size)) != EAS_SUCCESS)
497 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Expected DLS chunk, got %08lx\n", temp); */ }
504 /* scan the chunks in the DLS list */
512 if ((result = NextChunk(&dls, &pos, &temp, &size)) != EAS_SUCCESS)
519 if ((result = Parse_cdl(&dls, size, &temp)) != EAS_SUCCESS)
567 if ((result = Parse_ptbl(&dls, ptblPos, wvplPos, wvplSize)) != EAS_SUCCESS)
571 if ((dls.waveCount == 0) || (dls.waveCount > DLS_MAX_WAVE_COUNT))
573 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #waves [%u]\n", dls.waveCount); */ }
578 dls.wsmpData = EAS_HWMalloc(dls.hwInstData, (EAS_I32) (sizeof(S_WSMP_DATA) * dls.waveCount));
579 if (dls.wsmpData == NULL)
584 EAS_HWMemSet(dls.wsmpData, 0, (EAS_I32) (sizeof(S_WSMP_DATA) * dls.waveCount));
587 result = Parse_lins(&dls, linsPos, linsSize);
592 if ((dls.regionCount == 0) || (dls.regionCount > DLS_MAX_REGION_COUNT))
594 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #regions [%u]\n", dls.regionCount); */ }
599 if ((dls.artCount == 0) || (dls.artCount > DLS_MAX_ART_COUNT))
601 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #articulations [%u]\n", dls.regionCount); */ }
606 if ((dls.instCount == 0) || (dls.instCount > DLS_MAX_INST_COUNT))
608 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #instruments [%u]\n", dls.instCount); */ }
612 /* Allocate memory for the converted DLS data */
614 instSize = (EAS_I32) (sizeof(S_PROGRAM) * dls.instCount);
617 rgnPoolSize = (EAS_I32) (sizeof(S_DLS_REGION) * dls.regionCount);
620 dls.artCount++;
621 artPoolSize = (EAS_I32) (sizeof(S_DLS_ARTICULATION) * dls.artCount);
624 waveLenSize = (EAS_I32) (dls.waveCount * sizeof(EAS_U32));
627 size = (EAS_I32) sizeof(S_EAS) + instSize + rgnPoolSize + artPoolSize + (2 * waveLenSize) + (EAS_I32) dls.wavePoolSize;
633 dls.pDLS = EAS_HWMalloc(dls.hwInstData, size);
634 if (dls.pDLS == NULL)
636 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_HWMalloc failed for DLS memory allocation size %ld\n", size); */ }
639 EAS_HWMemSet(dls.pDLS, 0, size);
640 dls.pDLS->refCount = 1;
641 p = PtrOfs(dls.pDLS, sizeof(S_EAS));
644 dls.pDLS->numDLSPrograms = (EAS_U16) dls.instCount;
645 dls.pDLS->pDLSPrograms = p;
649 dls.pDLS->pDLSRegions = p;
650 dls.pDLS->numDLSRegions = (EAS_U16) dls.regionCount;
654 dls.pDLS->numDLSArticulations = (EAS_U16) dls.artCount;
655 dls.pDLS->pDLSArticulations = p;
659 dls.pDLS->numDLSSamples = (EAS_U16) dls.waveCount;
660 dls.pDLS->pDLSSampleLen = p;
664 dls.pDLS->pDLSSampleOffsets = p;
668 dls.pDLS->pDLSSamples = p;
671 dls.filterUsed = EAS_FALSE;
674 result = Parse_ptbl(&dls, ptblPos, wvplPos, wvplSize);
678 Convert_art(&dls, &defaultArt, 0);
679 dls.artCount = 1;
682 dls.regionCount = dls.instCount = 0;
684 result = Parse_lins(&dls, linsPos, linsSize);
687 if (dls.wsmpData)
688 EAS_HWFree(dls.hwInstData, dls.wsmpData);
693 *ppDLS = dls.pDLS;
695 DumpDLS(dls.pDLS);
701 DLSCleanup(dls.hwInstData, dls.pDLS);
962 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS wave chunk has no fmt chunk\n"); */ }
969 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS wave chunk has no data chunk\n"); */ }
1079 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Invalid unity note [%u] in DLS wsmp ignored, set to 60\n", wtemp); */ }
1091 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Positive gain [%ld] in DLS wsmp ignored, set to 0dB\n", p->gain); */ }
1108 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS sample with %lu loops, ignoring extra loops\n", ltemp); */ }
1163 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Unsupported DLS sample format %04x\n", wtemp); */ }
1172 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "No support for DLS multi-channel samples\n"); */ }
1194 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Unsupported DLS bits-per-sample %d\n", p->bitsPerSample); */ }
1280 #error "16-bit DLS conversion not implemented yet"
1411 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS ins chunk has no lrgn chunk\n"); */ }
1418 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS ins chunk has no insh chunk\n"); */ }
1501 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS bank number is out of range: %08lx\n", bank); */ }
1506 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS program number is out of range: %08lx\n", program); */ }
1556 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS region count exceeded cRegions value in insh, extra region ignored\n"); */ }
1665 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS rgn chunk has no rgnh chunk\n"); */ }
1672 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS rgn chunk has no wlnk chunk\n"); */ }
1769 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS rgnh: Low key out of range [%u]\n", lowKey); */ }
1774 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS rgnh: High key out of range [%u]\n", lowKey); */ }
1787 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS rgnh: Low velocity out of range [%u]\n", lowVel); */ }
1792 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "DLS rgnh: High velocity out of range [%u]\n", highVel); */ }
1971 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "WARN: Unsupported parameter in DLS file\n"); */ }
2271 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Unsupported opcode %d in DLS file\n", opcode); */ }
2286 * Convert region data from DLS to EAS
2321 * Convert articulation data from DLS to EAS
2563 * Convert the DLS filter resonance to an index value used by the synth