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, |
313 |
unsigned long SetPos(unsigned long SampleCount); |
unsigned long SetPos(unsigned long SampleCount); |
314 |
unsigned long GetPos(); |
unsigned long GetPos(); |
315 |
unsigned long Read(void* pBuffer, unsigned long SampleCount); |
unsigned long Read(void* pBuffer, unsigned long SampleCount); |
316 |
|
unsigned long ReadNoClear(void* pBuffer, unsigned long SampleCount, buffer_t& tempBuffer); |
317 |
|
|
318 |
unsigned long ReadAndLoop ( |
unsigned long ReadAndLoop ( |
319 |
void* pBuffer, |
void* pBuffer, |
360 |
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset; |
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset; |
361 |
int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset; |
int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset; |
362 |
|
|
363 |
int modEnvToPitch, modLfoToPitch, modEnvToFilterFc, modLfoToFilterFc, modLfoToVolume, freqModLfo; |
int modEnvToPitch , modLfoToPitch, modEnvToFilterFc, modLfoToFilterFc; // in cents |
364 |
int delayModLfo; |
int modLfoToVolume /* in centibels */, freqModLfo /* in absolute cents */; |
365 |
int vibLfoToPitch, freqVibLfo; |
int delayModLfo; // in absolute timecents |
366 |
int delayVibLfo; |
int vibLfoToPitch, freqVibLfo /* in absolute cents */; |
367 |
|
int delayVibLfo; // in absolute timecents |
368 |
|
int initialFilterFc /* in absolute cents */, initialFilterQ /* in centibels */; |
369 |
|
|
370 |
uint exclusiveClass; // exclusive group |
uint exclusiveClass; // exclusive group |
371 |
|
|
398 |
double GetEG1Attack(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Attack(Region* pPresetRegion = NULL); // in seconds |
399 |
double GetEG1Hold(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Hold(Region* pPresetRegion = NULL); // in seconds |
400 |
double GetEG1Decay(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Decay(Region* pPresetRegion = NULL); // in seconds |
401 |
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) |
402 |
double GetEG1Release(Region* pPresetRegion = NULL); // in seconds |
double GetEG1Release(Region* pPresetRegion = NULL); // in seconds |
403 |
|
|
404 |
double GetEG2PreAttackDelay(Region* pPresetRegion = NULL); // in seconds |
double GetEG2PreAttackDelay(Region* pPresetRegion = NULL); // in seconds |
405 |
double GetEG2Attack(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Attack(Region* pPresetRegion = NULL); // in seconds |
406 |
double GetEG2Hold(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Hold(Region* pPresetRegion = NULL); // in seconds |
407 |
double GetEG2Decay(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Decay(Region* pPresetRegion = NULL); // in seconds |
408 |
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) |
409 |
double GetEG2Release(Region* pPresetRegion = NULL); // in seconds |
double GetEG2Release(Region* pPresetRegion = NULL); // in seconds |
410 |
|
|
411 |
int GetModEnvToPitch(Region* pPresetRegion = NULL); |
int GetModEnvToPitch(Region* pPresetRegion = NULL); // in cents |
412 |
int GetModLfoToPitch(Region* pPresetRegion = NULL); |
int GetModLfoToPitch(Region* pPresetRegion = NULL); // in cents |
413 |
int GetModEnvToFilterFc(Region* pPresetRegion = NULL); |
int GetModEnvToFilterFc(Region* pPresetRegion = NULL); // in cents |
414 |
int GetModLfoToFilterFc(Region* pPresetRegion = NULL); |
int GetModLfoToFilterFc(Region* pPresetRegion = NULL); // in cents |
415 |
double GetModLfoToVolume(Region* pPresetRegion = NULL); // in permilles |
double GetModLfoToVolume(Region* pPresetRegion = NULL); // in centibels |
416 |
double GetFreqModLfo(Region* pPresetRegion = NULL); // in Hz |
double GetFreqModLfo(Region* pPresetRegion = NULL); // in Hz |
417 |
double GetDelayModLfo(Region* pPresetRegion = NULL); // in seconds |
double GetDelayModLfo(Region* pPresetRegion = NULL); // in seconds |
418 |
int GetVibLfoToPitch(Region* pPresetRegion = NULL); |
int GetVibLfoToPitch(Region* pPresetRegion = NULL); // in cents |
419 |
double GetFreqVibLfo(Region* pPresetRegion = NULL); // in Hz |
double GetFreqVibLfo(Region* pPresetRegion = NULL); // in Hz |
420 |
double GetDelayVibLfo(Region* pPresetRegion = NULL); // in seconds |
double GetDelayVibLfo(Region* pPresetRegion = NULL); // in seconds |
421 |
|
int GetInitialFilterFc(Region* pPresetRegion); // in absolute cents |
422 |
|
int GetInitialFilterQ(Region* pPresetRegion); // in centibels |
423 |
|
|
424 |
friend class Instrument; |
friend class Instrument; |
425 |
friend class Preset; |
friend class Preset; |
429 |
int EG1Attack; // in timecents |
int EG1Attack; // in timecents |
430 |
int EG1Hold; // in timecents |
int EG1Hold; // in timecents |
431 |
int EG1Decay; // in timecents |
int EG1Decay; // in timecents |
432 |
int EG1Sustain; // Sustain value of the sample amplitude EG (in permilles) |
int EG1Sustain; // Sustain value (the decrease in level, expressed in centibels) |
433 |
int EG1Release; // in timecents |
int EG1Release; // in timecents |
434 |
|
|
435 |
int EG2PreAttackDelay; // in timecents |
int EG2PreAttackDelay; // in timecents |
459 |
int GetRegionCount(); |
int GetRegionCount(); |
460 |
Region* GetRegion(int idx); |
Region* GetRegion(int idx); |
461 |
|
|
|
std::vector<Region*> GetRegionsOnKey(int key, uint8_t vel); |
|
|
|
|
462 |
protected: |
protected: |
463 |
std::vector<Region*> regions; |
std::vector<Region*> regions; |
464 |
sf2::File* pFile; |
sf2::File* pFile; |
465 |
}; |
}; |
466 |
|
|
467 |
|
class Query { |
468 |
|
public: |
469 |
|
int key; |
470 |
|
uint8_t vel; |
471 |
|
|
472 |
|
Query(InstrumentBase& instrument); |
473 |
|
Region* next(); |
474 |
|
|
475 |
|
private: |
476 |
|
InstrumentBase& instrument; |
477 |
|
int i; |
478 |
|
}; |
479 |
|
|
480 |
class Instrument : public InstrumentBase { |
class Instrument : public InstrumentBase { |
481 |
public: |
public: |
482 |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |