341 |
|
|
342 |
|
|
343 |
|
|
344 |
|
// *************** eg_opt_t *************** |
345 |
|
// * |
346 |
|
|
347 |
|
eg_opt_t::eg_opt_t() { |
348 |
|
AttackCancel = true; |
349 |
|
AttackHoldCancel = true; |
350 |
|
Decay1Cancel = true; |
351 |
|
Decay2Cancel = true; |
352 |
|
ReleaseCancel = true; |
353 |
|
} |
354 |
|
|
355 |
|
void eg_opt_t::serialize(Serialization::Archive* archive) { |
356 |
|
SRLZ(AttackCancel); |
357 |
|
SRLZ(AttackHoldCancel); |
358 |
|
SRLZ(Decay1Cancel); |
359 |
|
SRLZ(Decay2Cancel); |
360 |
|
SRLZ(ReleaseCancel); |
361 |
|
} |
362 |
|
|
363 |
|
|
364 |
|
|
365 |
// *************** Sample *************** |
// *************** Sample *************** |
366 |
// * |
// * |
367 |
|
|
1732 |
VCFType = vcf_type_lowpass; |
VCFType = vcf_type_lowpass; |
1733 |
memset(DimensionUpperLimits, 127, 8); |
memset(DimensionUpperLimits, 127, 8); |
1734 |
} |
} |
1735 |
|
// format extension for EG behavior options, these will *NOT* work with |
1736 |
|
// Gigasampler/GigaStudio ! |
1737 |
|
RIFF::Chunk* lsde = _3ewl->GetSubChunk(CHUNK_ID_LSDE); |
1738 |
|
if (lsde) { |
1739 |
|
unsigned char byte = lsde->ReadUint8(); |
1740 |
|
EGOptions.AttackCancel = byte & 1; |
1741 |
|
EGOptions.AttackHoldCancel = byte & (1 << 1); |
1742 |
|
EGOptions.Decay1Cancel = byte & (1 << 2); |
1743 |
|
EGOptions.Decay2Cancel = byte & (1 << 3); |
1744 |
|
EGOptions.ReleaseCancel = byte & (1 << 4); |
1745 |
|
} |
1746 |
|
|
1747 |
pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve, |
pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve, |
1748 |
VelocityResponseDepth, |
VelocityResponseDepth, |
1849 |
} |
} |
1850 |
|
|
1851 |
void DimensionRegion::serialize(Serialization::Archive* archive) { |
void DimensionRegion::serialize(Serialization::Archive* archive) { |
1852 |
|
// in case this class will become backward incompatible one day, |
1853 |
|
// then set a version and minimum version for this class like: |
1854 |
|
//archive->setVersion(*this, 2); |
1855 |
|
//archive->setMinVersion(*this, 1); |
1856 |
|
|
1857 |
SRLZ(VelocityUpperLimit); |
SRLZ(VelocityUpperLimit); |
1858 |
SRLZ(EG1PreAttack); |
SRLZ(EG1PreAttack); |
1859 |
SRLZ(EG1Attack); |
SRLZ(EG1Attack); |
1931 |
SRLZ(MSDecode); |
SRLZ(MSDecode); |
1932 |
//SRLZ(SampleStartOffset); |
//SRLZ(SampleStartOffset); |
1933 |
SRLZ(SampleAttenuation); |
SRLZ(SampleAttenuation); |
1934 |
|
SRLZ(EGOptions); |
1935 |
|
|
1936 |
// derived attributes from DLS::Sampler |
// derived attributes from DLS::Sampler |
1937 |
SRLZ(FineTune); |
SRLZ(FineTune); |
2238 |
if (chunksize >= 148) { |
if (chunksize >= 148) { |
2239 |
memcpy(&pData[140], DimensionUpperLimits, 8); |
memcpy(&pData[140], DimensionUpperLimits, 8); |
2240 |
} |
} |
2241 |
|
|
2242 |
|
// format extension for EG behavior options, these will *NOT* work with |
2243 |
|
// Gigasampler/GigaStudio ! |
2244 |
|
RIFF::Chunk* lsde = pParentList->GetSubChunk(CHUNK_ID_LSDE); |
2245 |
|
if (!lsde) { |
2246 |
|
// only add this "LSDE" chunk if the EG options do not match the |
2247 |
|
// default EG behavior |
2248 |
|
eg_opt_t defaultOpt; |
2249 |
|
if (memcmp(&EGOptions, &defaultOpt, sizeof(eg_opt_t))) { |
2250 |
|
lsde = pParentList->AddSubChunk(CHUNK_ID_LSDE, 1); |
2251 |
|
// move LSDE chunk to the end of parent list |
2252 |
|
pParentList->MoveSubChunk(lsde, (RIFF::Chunk*)NULL); |
2253 |
|
} |
2254 |
|
} |
2255 |
|
if (lsde) { |
2256 |
|
unsigned char* pByte = (unsigned char*) lsde->LoadChunkData(); |
2257 |
|
*pByte = |
2258 |
|
(EGOptions.AttackCancel ? 1 : 0) | |
2259 |
|
(EGOptions.AttackHoldCancel ? (1<<1) : 0) | |
2260 |
|
(EGOptions.Decay1Cancel ? (1<<2) : 0) | |
2261 |
|
(EGOptions.Decay2Cancel ? (1<<3) : 0) | |
2262 |
|
(EGOptions.ReleaseCancel ? (1<<4) : 0); |
2263 |
|
} |
2264 |
} |
} |
2265 |
|
|
2266 |
double* DimensionRegion::GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth) { |
double* DimensionRegion::GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth) { |
2675 |
|
|
2676 |
// unknown controller type |
// unknown controller type |
2677 |
default: |
default: |
2678 |
throw gig::Exception("Unknown leverage controller type."); |
decodedcontroller.type = leverage_ctrl_t::type_none; |
2679 |
|
decodedcontroller.controller_number = 0; |
2680 |
|
printf("Warning: Unknown leverage controller type (0x%x).\n", EncodedController); |
2681 |
|
break; |
2682 |
} |
} |
2683 |
return decodedcontroller; |
return decodedcontroller; |
2684 |
} |
} |
6532 |
// *************** Exception *************** |
// *************** Exception *************** |
6533 |
// * |
// * |
6534 |
|
|
6535 |
Exception::Exception(String Message) : DLS::Exception(Message) { |
Exception::Exception() : DLS::Exception() { |
6536 |
|
} |
6537 |
|
|
6538 |
|
Exception::Exception(String format, ...) : DLS::Exception() { |
6539 |
|
va_list arg; |
6540 |
|
va_start(arg, format); |
6541 |
|
Message = assemble(format, arg); |
6542 |
|
va_end(arg); |
6543 |
|
} |
6544 |
|
|
6545 |
|
Exception::Exception(String format, va_list arg) : DLS::Exception() { |
6546 |
|
Message = assemble(format, arg); |
6547 |
} |
} |
6548 |
|
|
6549 |
void Exception::PrintMessage() { |
void Exception::PrintMessage() { |