1748 |
// format extension for sustain pedal up effect on release trigger samples |
// format extension for sustain pedal up effect on release trigger samples |
1749 |
if (lsde && lsde->GetSize() > 3) { // NOTE: we reserved the 3rd byte for a potential future EG3 option |
if (lsde && lsde->GetSize() > 3) { // NOTE: we reserved the 3rd byte for a potential future EG3 option |
1750 |
lsde->SetPos(3); |
lsde->SetPos(3); |
1751 |
SustainReleaseTrigger = static_cast<sust_rel_trg_t>(lsde->ReadUint8()); |
uint8_t byte = lsde->ReadUint8(); |
1752 |
} else SustainReleaseTrigger = sust_rel_trg_none; |
SustainReleaseTrigger = static_cast<sust_rel_trg_t>(byte & 0x03); |
1753 |
|
NoNoteOffReleaseTrigger = byte >> 7; |
1754 |
|
} else { |
1755 |
|
SustainReleaseTrigger = sust_rel_trg_none; |
1756 |
|
NoNoteOffReleaseTrigger = false; |
1757 |
|
} |
1758 |
|
|
1759 |
pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve, |
pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve, |
1760 |
VelocityResponseDepth, |
VelocityResponseDepth, |
1946 |
SRLZ(EG1Options); |
SRLZ(EG1Options); |
1947 |
SRLZ(EG2Options); |
SRLZ(EG2Options); |
1948 |
SRLZ(SustainReleaseTrigger); |
SRLZ(SustainReleaseTrigger); |
1949 |
|
SRLZ(NoNoteOffReleaseTrigger); |
1950 |
|
|
1951 |
// derived attributes from DLS::Sampler |
// derived attributes from DLS::Sampler |
1952 |
SRLZ(FineTune); |
SRLZ(FineTune); |
2259 |
RIFF::Chunk* lsde = pParentList->GetSubChunk(CHUNK_ID_LSDE); |
RIFF::Chunk* lsde = pParentList->GetSubChunk(CHUNK_ID_LSDE); |
2260 |
const int lsdeSize = 4; // NOTE: we reserved the 3rd byte for a potential future EG3 option |
const int lsdeSize = 4; // NOTE: we reserved the 3rd byte for a potential future EG3 option |
2261 |
if (!lsde) { |
if (!lsde) { |
2262 |
// only add this "LSDE" chunk if either EG options or sustain |
// only add this "LSDE" chunk if either EG options or release |
2263 |
// release trigger option deviate from their default behaviour |
// trigger options deviate from their default behaviour |
2264 |
eg_opt_t defaultOpt; |
eg_opt_t defaultOpt; |
2265 |
if (memcmp(&EG1Options, &defaultOpt, sizeof(eg_opt_t)) || |
if (memcmp(&EG1Options, &defaultOpt, sizeof(eg_opt_t)) || |
2266 |
memcmp(&EG2Options, &defaultOpt, sizeof(eg_opt_t)) || |
memcmp(&EG2Options, &defaultOpt, sizeof(eg_opt_t)) || |
2267 |
SustainReleaseTrigger) |
SustainReleaseTrigger || NoNoteOffReleaseTrigger) |
2268 |
{ |
{ |
2269 |
lsde = pParentList->AddSubChunk(CHUNK_ID_LSDE, lsdeSize); |
lsde = pParentList->AddSubChunk(CHUNK_ID_LSDE, lsdeSize); |
2270 |
// move LSDE chunk to the end of parent list |
// move LSDE chunk to the end of parent list |
2285 |
(pEGOpts[i]->Decay2Cancel ? (1<<3) : 0) | |
(pEGOpts[i]->Decay2Cancel ? (1<<3) : 0) | |
2286 |
(pEGOpts[i]->ReleaseCancel ? (1<<4) : 0); |
(pEGOpts[i]->ReleaseCancel ? (1<<4) : 0); |
2287 |
} |
} |
2288 |
// format extension for effect of sustain pedal up event on release trigger samples |
// format extension for release trigger options |
2289 |
pData[3] = static_cast<uint8_t>(SustainReleaseTrigger); |
pData[3] = static_cast<uint8_t>(SustainReleaseTrigger) | (NoNoteOffReleaseTrigger ? (1<<7) : 0); |
2290 |
} |
} |
2291 |
} |
} |
2292 |
|
|