diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-09-11 10:45:12 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-09-11 10:45:12 +0300 |
commit | e7c04edd47c4db18713a584e360052fc0d65e24c (patch) | |
tree | 28d4230b3ef51118e38a2eecf9ebd33bccc2393f /src/adlmidi_midiplay.cpp | |
parent | e6d73ae7e996301523d0c425bd07158f7c1d597e (diff) | |
download | libADLMIDI-e7c04edd47c4db18713a584e360052fc0d65e24c.tar.gz libADLMIDI-e7c04edd47c4db18713a584e360052fc0d65e24c.tar.bz2 libADLMIDI-e7c04edd47c4db18713a584e360052fc0d65e24c.zip |
A small beautify of a frequency models code
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 683ab1d..7f1f230 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -30,12 +30,24 @@ static const double s_drum_note_min_time = 0.03; -// Standard frequency formula + + +/*************************************************************** + * Standard frequency formula * + * *************************************************************/ + static inline double s_commonFreq(double note, double bend) { return BEND_COEFFICIENT * std::exp(0.057762265 * (note + bend)); } + + + +/*************************************************************** + * DMX frequency model * + * *************************************************************/ + // DMX volumes table static const int_fast32_t s_dmx_freq_table[] = { @@ -183,6 +195,12 @@ static inline double s_dmxFreq(double note, double bend) } + + +/*************************************************************** + * Apogee Sound System frequency model * + ***************************************************************/ + static const int_fast32_t s_apogee_freq_table[31 + 1][12] = { { 0x157, 0x16b, 0x181, 0x198, 0x1b0, 0x1ca, 0x1e5, 0x202, 0x220, 0x241, 0x263, 0x287 }, @@ -248,6 +266,13 @@ static inline double s_apogeeFreq(double note, double bend) return (double)outHz; } + + + +/*************************************************************** + * Windows 9x FM drivers frequency model * + ***************************************************************/ + //static const double s_9x_opl_samplerate = 50000.0; //static const double s_9x_opl_tune = 440.0; static const uint_fast8_t s_9x_opl_pitchfrac = 8; @@ -313,6 +338,13 @@ static inline double s_9xFreq(double noteD, double bendD) return (double)freqpitched; } + + + +/*************************************************************** + * HMI Sound Operating System frequency model * + ***************************************************************/ + const size_t s_hmi_freqtable_size = 103; static uint_fast32_t s_hmi_freqtable[s_hmi_freqtable_size] = { @@ -448,6 +480,9 @@ static inline double s_hmiFreq(double noteD, double bendD) + + + enum { MasterVolumeDefault = 127 }; inline bool isXgPercChannel(uint8_t msb, uint8_t lsb) |