63 |
|
|
64 |
static uint NONE = 0x1ffffff; |
static uint NONE = 0x1ffffff; |
65 |
|
|
66 |
|
double ToSeconds(int Timecents); |
67 |
|
double ToRatio(int Centibels); |
68 |
|
double ToHz(int cents); |
69 |
|
|
70 |
typedef struct _PresetBag { |
typedef struct _PresetBag { |
71 |
uint16_t GenNdx; |
uint16_t GenNdx; |
72 |
uint16_t ModNdx; |
uint16_t ModNdx; |
141 |
HOLD_MOD_ENV, |
HOLD_MOD_ENV, |
142 |
DECAY_MOD_ENV, |
DECAY_MOD_ENV, |
143 |
SUSTAIN_MOD_ENV, |
SUSTAIN_MOD_ENV, |
144 |
RELEASEMODENV, // 30 |
RELEASE_MOD_ENV, // 30 |
145 |
KEYNUM_TO_MOD_ENV_HOLD, |
KEYNUM_TO_MOD_ENV_HOLD, |
146 |
KEYNUM_TO_MOD_ENV_DECAY, |
KEYNUM_TO_MOD_ENV_DECAY, |
147 |
DELAY_VOL_ENV, |
DELAY_VOL_ENV, |
359 |
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset; |
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset; |
360 |
int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset; |
int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset; |
361 |
|
|
362 |
int modEnvToPitch, modLfoToPitch, modEnvToFilterFc, modLfoToFilterFc, modLfoToVolume, freqModLfo; |
int modEnvToPitch , modLfoToPitch, modEnvToFilterFc, modLfoToFilterFc; // in cents |
363 |
int delayModLfo; |
int modLfoToVolume /* in centibels */, freqModLfo /* in absolute cents */; |
364 |
int vibLfoToPitch, freqVibLfo; |
int delayModLfo; // in absolute timecents |
365 |
int delayVibLfo; |
int vibLfoToPitch, freqVibLfo /* in absolute cents */; |
366 |
|
int delayVibLfo; // in absolute timecents |
367 |
|
int initialFilterFc /* in absolute cents */, initialFilterQ /* in centibels */; |
368 |
|
|
369 |
uint exclusiveClass; // exclusive group |
uint exclusiveClass; // exclusive group |
370 |
|
|
397 |
double GetEG1Attack(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Attack(Region* pPresetRegion = NULL); // in seconds |
398 |
double GetEG1Hold(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Hold(Region* pPresetRegion = NULL); // in seconds |
399 |
double GetEG1Decay(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Decay(Region* pPresetRegion = NULL); // in seconds |
400 |
double GetEG1Sustain(Region* pPresetRegion = NULL); // Sustain value of the sample amplitude EG (in permilles) |
int GetEG1Sustain(Region* pPresetRegion = NULL); // Sustain value of the sample amplitude EG (the decrease in level, expressed in centibels) |
401 |
double GetEG1Release(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Release(Region* pPresetRegion = NULL); // in seconds |
402 |
|
|
403 |
double GetEG2PreAttackDelay(Region* pPresetRegion = NULL); // in seconds |
double GetEG2PreAttackDelay(Region* pPresetRegion = NULL); // in seconds |
404 |
double GetEG2Attack(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Attack(Region* pPresetRegion = NULL); // in seconds |
405 |
double GetEG2Hold(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Hold(Region* pPresetRegion = NULL); // in seconds |
406 |
double GetEG2Decay(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Decay(Region* pPresetRegion = NULL); // in seconds |
407 |
double GetEG2Sustain(Region* pPresetRegion = NULL); // Sustain value of the filter cutoff EG (in permilles) |
int GetEG2Sustain(Region* pPresetRegion = NULL); // Sustain value of the filter cutoff EG (in permilles) |
408 |
double GetEG2Release(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Release(Region* pPresetRegion = NULL); // in seconds |
409 |
|
|
410 |
int GetModEnvToPitch(Region* pPresetRegion = NULL); |
int GetModEnvToPitch(Region* pPresetRegion = NULL); // in cents |
411 |
int GetModLfoToPitch(Region* pPresetRegion = NULL); |
int GetModLfoToPitch(Region* pPresetRegion = NULL); // in cents |
412 |
int GetModEnvToFilterFc(Region* pPresetRegion = NULL); |
int GetModEnvToFilterFc(Region* pPresetRegion = NULL); // in cents |
413 |
int GetModLfoToFilterFc(Region* pPresetRegion = NULL); |
int GetModLfoToFilterFc(Region* pPresetRegion = NULL); // in cents |
414 |
double GetModLfoToVolume(Region* pPresetRegion = NULL); // in permilles |
double GetModLfoToVolume(Region* pPresetRegion = NULL); // in centibels |
415 |
double GetFreqModLfo(Region* pPresetRegion = NULL); // in Hz |
double GetFreqModLfo(Region* pPresetRegion = NULL); // in Hz |
416 |
double GetDelayModLfo(Region* pPresetRegion = NULL); // in seconds |
double GetDelayModLfo(Region* pPresetRegion = NULL); // in seconds |
417 |
int GetVibLfoToPitch(Region* pPresetRegion = NULL); |
int GetVibLfoToPitch(Region* pPresetRegion = NULL); // in cents |
418 |
double GetFreqVibLfo(Region* pPresetRegion = NULL); // in Hz |
double GetFreqVibLfo(Region* pPresetRegion = NULL); // in Hz |
419 |
double GetDelayVibLfo(Region* pPresetRegion = NULL); // in seconds |
double GetDelayVibLfo(Region* pPresetRegion = NULL); // in seconds |
420 |
|
int GetInitialFilterFc(Region* pPresetRegion); // in absolute cents |
421 |
|
int GetInitialFilterQ(Region* pPresetRegion); // in centibels |
422 |
|
|
423 |
friend class Instrument; |
friend class Instrument; |
424 |
friend class Preset; |
friend class Preset; |
428 |
int EG1Attack; // in timecents |
int EG1Attack; // in timecents |
429 |
int EG1Hold; // in timecents |
int EG1Hold; // in timecents |
430 |
int EG1Decay; // in timecents |
int EG1Decay; // in timecents |
431 |
int EG1Sustain; // Sustain value of the sample amplitude EG (in permilles) |
int EG1Sustain; // Sustain value (the decrease in level, expressed in centibels) |
432 |
int EG1Release; // in timecents |
int EG1Release; // in timecents |
433 |
|
|
434 |
int EG2PreAttackDelay; // in timecents |
int EG2PreAttackDelay; // in timecents |
458 |
int GetRegionCount(); |
int GetRegionCount(); |
459 |
Region* GetRegion(int idx); |
Region* GetRegion(int idx); |
460 |
|
|
|
std::vector<Region*> GetRegionsOnKey(int key, uint8_t vel); |
|
|
|
|
461 |
protected: |
protected: |
462 |
std::vector<Region*> regions; |
std::vector<Region*> regions; |
463 |
sf2::File* pFile; |
sf2::File* pFile; |
464 |
}; |
}; |
465 |
|
|
466 |
|
class Query { |
467 |
|
public: |
468 |
|
int key; |
469 |
|
uint8_t vel; |
470 |
|
|
471 |
|
Query(InstrumentBase& instrument); |
472 |
|
Region* next(); |
473 |
|
|
474 |
|
private: |
475 |
|
InstrumentBase& instrument; |
476 |
|
int i; |
477 |
|
}; |
478 |
|
|
479 |
class Instrument : public InstrumentBase { |
class Instrument : public InstrumentBase { |
480 |
public: |
public: |
481 |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |