323 |
progress_t(); |
progress_t(); |
324 |
}; |
}; |
325 |
|
|
|
/** @brief CRC-32 checksum implementation |
|
|
* |
|
|
* This class is used to calculate checksums of the sample data in |
|
|
* a gig file. The checksums are stored in the 3crc chunk of the |
|
|
* gig file and automatically updated when a sample is written |
|
|
* with Sample::Write(). |
|
|
*/ |
|
|
class CRC { |
|
|
private: |
|
|
uint32_t value; |
|
|
static const uint32_t* table; |
|
|
static uint32_t* initTable(); |
|
|
public: |
|
|
CRC() { |
|
|
reset(); |
|
|
} |
|
|
void reset() { |
|
|
value = 0xffffffff; |
|
|
} |
|
|
void update(unsigned char* buf, int len) { |
|
|
for (int i = 0 ; i < len ; i++) { |
|
|
value = table[(value ^ buf[i]) & 0xff] ^ (value >> 8); |
|
|
} |
|
|
} |
|
|
uint32_t getValue() { |
|
|
return value ^ 0xffffffff; |
|
|
} |
|
|
}; |
|
|
|
|
326 |
// just symbol prototyping |
// just symbol prototyping |
327 |
class File; |
class File; |
328 |
class Instrument; |
class Instrument; |
396 |
// Filter |
// Filter |
397 |
bool VCFEnabled; ///< If filter should be used. |
bool VCFEnabled; ///< If filter should be used. |
398 |
vcf_type_t VCFType; ///< Defines the general filter characteristic (lowpass, highpass, bandpass, etc.). |
vcf_type_t VCFType; ///< Defines the general filter characteristic (lowpass, highpass, bandpass, etc.). |
399 |
vcf_cutoff_ctrl_t VCFCutoffController; ///< Specifies which external controller has influence on the filter cutoff frequency. |
vcf_cutoff_ctrl_t VCFCutoffController; ///< Specifies which external controller has influence on the filter cutoff frequency. @deprecated Don't alter directly, use SetVCFCutoffController() instead! |
400 |
bool VCFCutoffControllerInvert; ///< Inverts values coming from the defined cutoff controller |
bool VCFCutoffControllerInvert; ///< Inverts values coming from the defined cutoff controller |
401 |
uint8_t VCFCutoff; ///< Max. cutoff frequency. |
uint8_t VCFCutoff; ///< Max. cutoff frequency. |
402 |
curve_type_t VCFVelocityCurve; ///< Defines a transformation curve for the incoming velocity values, affecting the VCF. |
curve_type_t VCFVelocityCurve; ///< Defines a transformation curve for the incoming velocity values, affecting the VCF. @deprecated Don't alter directly, use SetVCFVelocityCurve() instead! |
403 |
uint8_t VCFVelocityScale; ///< (0-127) Amount velocity controls VCF cutoff frequency (only if no other VCF cutoff controller is defined, otherwise this is the minimum cutoff). |
uint8_t VCFVelocityScale; ///< (0-127) Amount velocity controls VCF cutoff frequency (only if no other VCF cutoff controller is defined, otherwise this is the minimum cutoff). @deprecated Don't alter directly, use SetVCFVelocityScale() instead! |
404 |
uint8_t VCFVelocityDynamicRange; ///< 0x04 = lowest, 0x00 = highest |
uint8_t VCFVelocityDynamicRange; ///< 0x04 = lowest, 0x00 = highest . @deprecated Don't alter directly, use SetVCFVelocityDynamicRange() instead! |
405 |
uint8_t VCFResonance; ///< Firm internal filter resonance weight. |
uint8_t VCFResonance; ///< Firm internal filter resonance weight. |
406 |
bool VCFResonanceDynamic; ///< If <i>true</i>: Increases the resonance Q according to changes of controllers that actually control the VCF cutoff frequency (EG2, ext. VCF MIDI controller). |
bool VCFResonanceDynamic; ///< If <i>true</i>: Increases the resonance Q according to changes of controllers that actually control the VCF cutoff frequency (EG2, ext. VCF MIDI controller). |
407 |
vcf_res_ctrl_t VCFResonanceController; ///< Specifies which external controller has influence on the filter resonance Q. |
vcf_res_ctrl_t VCFResonanceController; ///< Specifies which external controller has influence on the filter resonance Q. |
408 |
bool VCFKeyboardTracking; ///< If <i>true</i>: VCF cutoff frequence will be dependend to the note key position relative to the defined breakpoint value. |
bool VCFKeyboardTracking; ///< If <i>true</i>: VCF cutoff frequence will be dependend to the note key position relative to the defined breakpoint value. |
409 |
uint8_t VCFKeyboardTrackingBreakpoint; ///< See VCFKeyboardTracking (0 - 127). |
uint8_t VCFKeyboardTrackingBreakpoint; ///< See VCFKeyboardTracking (0 - 127). |
410 |
// Key Velocity Transformations |
// Key Velocity Transformations |
411 |
curve_type_t VelocityResponseCurve; ///< Defines a transformation curve to the incoming velocity values affecting amplitude (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). |
curve_type_t VelocityResponseCurve; ///< Defines a transformation curve to the incoming velocity values affecting amplitude (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseCurve() instead! |
412 |
uint8_t VelocityResponseDepth; ///< Dynamic range of velocity affecting amplitude (0 - 4) (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). |
uint8_t VelocityResponseDepth; ///< Dynamic range of velocity affecting amplitude (0 - 4) (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseDepth() instead! |
413 |
uint8_t VelocityResponseCurveScaling; ///< 0 - 127 (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead) |
uint8_t VelocityResponseCurveScaling; ///< 0 - 127 (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseCurveScaling() instead! |
414 |
curve_type_t ReleaseVelocityResponseCurve; ///< Defines a transformation curve to the incoming release veloctiy values affecting envelope times. |
curve_type_t ReleaseVelocityResponseCurve; ///< Defines a transformation curve to the incoming release veloctiy values affecting envelope times. @deprecated Don't alter directly, use SetReleaseVelocityResponseCurve() instead! |
415 |
uint8_t ReleaseVelocityResponseDepth; ///< Dynamic range of release velocity affecting envelope time (0 - 4). |
uint8_t ReleaseVelocityResponseDepth; ///< Dynamic range of release velocity affecting envelope time (0 - 4). @deprecated Don't alter directly, use SetReleaseVelocityResponseDepth() instead! |
416 |
uint8_t ReleaseTriggerDecay; ///< 0 - 8 |
uint8_t ReleaseTriggerDecay; ///< 0 - 8 |
417 |
// Mix / Layer |
// Mix / Layer |
418 |
crossfade_t Crossfade; |
crossfade_t Crossfade; |
441 |
double GetVelocityAttenuation(uint8_t MIDIKeyVelocity); |
double GetVelocityAttenuation(uint8_t MIDIKeyVelocity); |
442 |
double GetVelocityRelease(uint8_t MIDIKeyVelocity); |
double GetVelocityRelease(uint8_t MIDIKeyVelocity); |
443 |
double GetVelocityCutoff(uint8_t MIDIKeyVelocity); |
double GetVelocityCutoff(uint8_t MIDIKeyVelocity); |
444 |
|
void SetVelocityResponseCurve(curve_type_t curve); |
445 |
|
void SetVelocityResponseDepth(uint8_t depth); |
446 |
|
void SetVelocityResponseCurveScaling(uint8_t scaling); |
447 |
|
void SetReleaseVelocityResponseCurve(curve_type_t curve); |
448 |
|
void SetReleaseVelocityResponseDepth(uint8_t depth); |
449 |
|
void SetVCFCutoffController(vcf_cutoff_ctrl_t controller); |
450 |
|
void SetVCFVelocityCurve(curve_type_t curve); |
451 |
|
void SetVCFVelocityDynamicRange(uint8_t range); |
452 |
|
void SetVCFVelocityScale(uint8_t scaling); |
453 |
Region* GetParent() const; |
Region* GetParent() const; |
454 |
// derived methods |
// derived methods |
455 |
DLS::Sampler::AddSampleLoop; |
DLS::Sampler::AddSampleLoop; |
456 |
DLS::Sampler::DeleteSampleLoop; |
DLS::Sampler::DeleteSampleLoop; |
457 |
// overridden methods |
// overridden methods |
458 |
|
virtual void SetGain(int32_t gain); |
459 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
460 |
protected: |
protected: |
461 |
uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. |
uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. |
503 |
|
|
504 |
leverage_ctrl_t DecodeLeverageController(_lev_ctrl_t EncodedController); |
leverage_ctrl_t DecodeLeverageController(_lev_ctrl_t EncodedController); |
505 |
_lev_ctrl_t EncodeLeverageController(leverage_ctrl_t DecodedController); |
_lev_ctrl_t EncodeLeverageController(leverage_ctrl_t DecodedController); |
506 |
|
double* GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth); |
507 |
|
double* GetCutoffVelocityTable(curve_type_t vcfVelocityCurve, uint8_t vcfVelocityDynamicRange, uint8_t vcfVelocityScale, vcf_cutoff_ctrl_t vcfCutoffController); |
508 |
double* GetVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling); |
double* GetVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling); |
509 |
double* CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling); |
double* CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling); |
510 |
}; |
}; |
578 |
unsigned long FileNo; ///< File number (> 0 when sample is stored in an extension file, 0 when it's in the gig) |
unsigned long FileNo; ///< File number (> 0 when sample is stored in an extension file, 0 when it's in the gig) |
579 |
RIFF::Chunk* pCk3gix; |
RIFF::Chunk* pCk3gix; |
580 |
RIFF::Chunk* pCkSmpl; |
RIFF::Chunk* pCkSmpl; |
581 |
CRC crc; ///< CRC-32 checksum of the raw sample data |
uint32_t crc; ///< CRC-32 checksum of the raw sample data |
582 |
|
|
583 |
Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo = 0); |
Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo = 0); |
584 |
~Sample(); |
~Sample(); |
749 |
Group* AddGroup(); |
Group* AddGroup(); |
750 |
void DeleteGroup(Group* pGroup); |
void DeleteGroup(Group* pGroup); |
751 |
void DeleteGroupOnly(Group* pGroup); |
void DeleteGroupOnly(Group* pGroup); |
752 |
|
void SetAutoLoad(bool b); |
753 |
|
bool GetAutoLoad(); |
754 |
virtual ~File(); |
virtual ~File(); |
755 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
756 |
protected: |
protected: |
766 |
friend class Sample; |
friend class Sample; |
767 |
friend class Group; // so Group can access protected member pRIFF |
friend class Group; // so Group can access protected member pRIFF |
768 |
private: |
private: |
|
static const DLS::Info::FixedStringLength FixedStringLengths[]; |
|
769 |
std::list<Group*>* pGroups; |
std::list<Group*>* pGroups; |
770 |
std::list<Group*>::iterator GroupsIterator; |
std::list<Group*>::iterator GroupsIterator; |
771 |
|
bool bAutoLoad; |
772 |
}; |
}; |
773 |
|
|
774 |
/** |
/** |