Ver código fonte

Avoid global Wavetable defines

dds
PaulStoffregen 6 anos atrás
pai
commit
3856412457
40 arquivos alterados com 2826 adições e 2829 exclusões
  1. +34
    -34
      examples/Synthesis/Wavetable/MidiSynth/BasicFlute1_samples.cpp
  2. +17
    -17
      examples/Synthesis/Wavetable/MidiSynth/FrenchHorns_samples.cpp
  3. +51
    -51
      examples/Synthesis/Wavetable/MidiSynth/Ocarina_samples.cpp
  4. +68
    -68
      examples/Synthesis/Wavetable/MidiSynth/Pizzicato_samples.cpp
  5. +136
    -136
      examples/Synthesis/Wavetable/MidiSynth/Viola_samples.cpp
  6. +34
    -34
      examples/Synthesis/Wavetable/MidiSynthKeyboard/BasicFlute1_samples.cpp
  7. +17
    -17
      examples/Synthesis/Wavetable/MidiSynthKeyboard/FrenchHorns_samples.cpp
  8. +51
    -51
      examples/Synthesis/Wavetable/MidiSynthKeyboard/Ocarina_samples.cpp
  9. +68
    -68
      examples/Synthesis/Wavetable/MidiSynthKeyboard/Pizzicato_samples.cpp
  10. +136
    -136
      examples/Synthesis/Wavetable/MidiSynthKeyboard/Viola_samples.cpp
  11. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/bassoon_samples.cpp
  12. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/clarinet_samples.cpp
  13. +72
    -72
      examples/Synthesis/Wavetable/MidiSynthLarge/distortiongt_samples.cpp
  14. +72
    -72
      examples/Synthesis/Wavetable/MidiSynthLarge/epiano_samples.cpp
  15. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/flute_samples.cpp
  16. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/frenchhorn_samples.cpp
  17. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/glockenspiel_samples.cpp
  18. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/gtfretnoise_samples.cpp
  19. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/harmonica_samples.cpp
  20. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/harp_samples.cpp
  21. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/mutedgtr_samples.cpp
  22. +54
    -54
      examples/Synthesis/Wavetable/MidiSynthLarge/nylonstrgtr_samples.cpp
  23. +54
    -54
      examples/Synthesis/Wavetable/MidiSynthLarge/oboe_samples.cpp
  24. +54
    -54
      examples/Synthesis/Wavetable/MidiSynthLarge/overdrivegt_samples.cpp
  25. +72
    -72
      examples/Synthesis/Wavetable/MidiSynthLarge/piano_samples.cpp
  26. +18
    -18
      examples/Synthesis/Wavetable/MidiSynthLarge/recorder_samples.cpp
  27. +864
    -864
      examples/Synthesis/Wavetable/MidiSynthLarge/standard_DRUMS_samples.cpp
  28. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/steelstrgtr_samples.cpp
  29. +54
    -54
      examples/Synthesis/Wavetable/MidiSynthLarge/strings_samples.cpp
  30. +54
    -54
      examples/Synthesis/Wavetable/MidiSynthLarge/timpani_samples.cpp
  31. +72
    -72
      examples/Synthesis/Wavetable/MidiSynthLarge/trombone_samples.cpp
  32. +90
    -90
      examples/Synthesis/Wavetable/MidiSynthLarge/trumpet_samples.cpp
  33. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/tuba_samples.cpp
  34. +36
    -36
      examples/Synthesis/Wavetable/MidiSynthLarge/vibraphone_samples.cpp
  35. +54
    -54
      examples/Synthesis/Wavetable/SimpleWavetable/Flute_100kbyte_samples.cpp
  36. +54
    -54
      examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.cpp
  37. +68
    -68
      examples/Synthesis/Wavetable/Zelda/Pizzicato_samples.cpp
  38. +136
    -136
      examples/Synthesis/Wavetable/Zelda/Viola_samples.cpp
  39. +36
    -36
      examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.cpp
  40. +12
    -15
      synth_wavetable.h

+ 34
- 34
examples/Synthesis/Wavetable/MidiSynth/BasicFlute1_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data BasicFlute1_samples[2] = {
((uint32_t)56860-1) << (32 - 16), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)56852-1) << (32 - 16), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)56852-1) << (32 - 16)) - (((uint32_t)49464-1) << (32 - 16)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-300/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(786*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-300/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(786*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_BasicFlute1_BreathyFluteA2, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data BasicFlute1_samples[2] = {
((uint32_t)62991-1) << (32 - 16), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)62982-1) << (32 - 16), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)62982-1) << (32 - 16)) - (((uint32_t)55822-1) << (32 - 16)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-600/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(696*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-600/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(696*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 17
- 17
examples/Synthesis/Wavetable/MidiSynth/FrenchHorns_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data FrenchHorns_samples[1] = {
((uint32_t)109900-1) << (32 - 17), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)109887-1) << (32 - 17), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)109887-1) << (32 - 17)) - (((uint32_t)30531-1) << (32 - 17)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(600*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(0/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(600*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(0/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 51
- 51
examples/Synthesis/Wavetable/MidiSynth/Ocarina_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)2847-1) << (32 - 12), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)2839-1) << (32 - 12), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)2839-1) << (32 - 12)) - (((uint32_t)1438-1) << (32 - 12)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Ocarina_OcarinaF4, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)2847-1) << (32 - 12), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)2839-1) << (32 - 12), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)2839-1) << (32 - 12)) - (((uint32_t)1438-1) << (32 - 12)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-100/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-100/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Ocarina_OcarinaF6, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)349-1) << (32 - 9), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)341-1) << (32 - 9), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)341-1) << (32 - 9)) - (((uint32_t)331-1) << (32 - 9)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(10*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(10*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 68
- 68
examples/Synthesis/Wavetable/MidiSynth/Pizzicato_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)5687-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)5679-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)5679-1) << (32 - 13)) - (((uint32_t)5608-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Pizzicato_PizzViolinC4, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)4607-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)4599-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)4599-1) << (32 - 13)) - (((uint32_t)4557-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 136
- 136
examples/Synthesis/Wavetable/MidiSynth/Viola_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1306-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1299-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1299-1) << (32 - 11)) - (((uint32_t)1205-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Viola_ViolinD3, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1593-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1585-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1585-1) << (32 - 11)) - (((uint32_t)1510-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Viola_ViolinG3, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1526-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1518-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1518-1) << (32 - 11)) - (((uint32_t)1462-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Viola_ViolinC4, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1343-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1335-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1335-1) << (32 - 11)) - (((uint32_t)1293-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_4_Viola_ViolinGb4, //16-bit PCM encoded audio sample
@@ -112,23 +112,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1331-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1323-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1323-1) << (32 - 11)) - (((uint32_t)1292-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_5_Viola_ViolinC5, //16-bit PCM encoded audio sample
@@ -138,23 +138,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1255-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1247-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1247-1) << (32 - 11)) - (((uint32_t)1225-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_6_Viola_ViolinEb5, //16-bit PCM encoded audio sample
@@ -164,23 +164,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1454-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1446-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1446-1) << (32 - 11)) - (((uint32_t)1427-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_7_Viola_ViolinEb6, //16-bit PCM encoded audio sample
@@ -190,23 +190,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)817-1) << (32 - 10), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)809-1) << (32 - 10), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)809-1) << (32 - 10)) - (((uint32_t)799-1) << (32 - 10)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 34
- 34
examples/Synthesis/Wavetable/MidiSynthKeyboard/BasicFlute1_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data BasicFlute1_samples[2] = {
((uint32_t)56860-1) << (32 - 16), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)56852-1) << (32 - 16), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)56852-1) << (32 - 16)) - (((uint32_t)49464-1) << (32 - 16)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-300/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(786*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-300/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(786*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_BasicFlute1_BreathyFluteA2, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data BasicFlute1_samples[2] = {
((uint32_t)62991-1) << (32 - 16), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)62982-1) << (32 - 16), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)62982-1) << (32 - 16)) - (((uint32_t)55822-1) << (32 - 16)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-600/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(696*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-600/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(696*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(52 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4286/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 17
- 17
examples/Synthesis/Wavetable/MidiSynthKeyboard/FrenchHorns_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data FrenchHorns_samples[1] = {
((uint32_t)109900-1) << (32 - 17), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)109887-1) << (32 - 17), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)109887-1) << (32 - 17)) - (((uint32_t)30531-1) << (32 - 17)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(600*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(0/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(600*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(0/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 51
- 51
examples/Synthesis/Wavetable/MidiSynthKeyboard/Ocarina_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)2847-1) << (32 - 12), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)2839-1) << (32 - 12), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)2839-1) << (32 - 12)) - (((uint32_t)1438-1) << (32 - 12)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Ocarina_OcarinaF4, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)2847-1) << (32 - 12), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)2839-1) << (32 - 12), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)2839-1) << (32 - 12)) - (((uint32_t)1438-1) << (32 - 12)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-100/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-100/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(7*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Ocarina_OcarinaF6, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Ocarina_samples[3] = {
((uint32_t)349-1) << (32 - 9), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)341-1) << (32 - 9), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)341-1) << (32 - 9)) - (((uint32_t)331-1) << (32 - 9)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(10*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-170/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(10*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(1730*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(321*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(14 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(4288/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 68
- 68
examples/Synthesis/Wavetable/MidiSynthKeyboard/Pizzicato_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)5687-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)5679-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)5679-1) << (32 - 13)) - (((uint32_t)5608-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Pizzicato_PizzViolinC4, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)4607-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)4599-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)4599-1) << (32 - 13)) - (((uint32_t)4557-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 136
- 136
examples/Synthesis/Wavetable/MidiSynthKeyboard/Viola_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1306-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1299-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1299-1) << (32 - 11)) - (((uint32_t)1205-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Viola_ViolinD3, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1593-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1585-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1585-1) << (32 - 11)) - (((uint32_t)1510-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Viola_ViolinG3, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1526-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1518-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1518-1) << (32 - 11)) - (((uint32_t)1462-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Viola_ViolinC4, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1343-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1335-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1335-1) << (32 - 11)) - (((uint32_t)1293-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_4_Viola_ViolinGb4, //16-bit PCM encoded audio sample
@@ -112,23 +112,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1331-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1323-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1323-1) << (32 - 11)) - (((uint32_t)1292-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_5_Viola_ViolinC5, //16-bit PCM encoded audio sample
@@ -138,23 +138,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1255-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1247-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1247-1) << (32 - 11)) - (((uint32_t)1225-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_6_Viola_ViolinEb5, //16-bit PCM encoded audio sample
@@ -164,23 +164,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1454-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1446-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1446-1) << (32 - 11)) - (((uint32_t)1427-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_7_Viola_ViolinEb6, //16-bit PCM encoded audio sample
@@ -190,23 +190,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)817-1) << (32 - 10), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)809-1) << (32 - 10), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)809-1) << (32 - 10)) - (((uint32_t)799-1) << (32 - 10)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/bassoon_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data bassoon_samples[2] = {
(int16_t*)sample_0_bassoon_bassoonc2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(41) * 44100.0 / NOTE(67) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(41) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(67) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1058 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1053 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1053 - 1) << (32 - 11)) - (((uint32_t)938 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_bassoon_enghorndx3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-35) * 44100.0 / NOTE(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-35) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1539 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1534 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1534 - 1) << (32 - 11)) - (((uint32_t)1479 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/clarinet_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data clarinet_samples[2] = {
(int16_t*)sample_0_clarinet_clarinetd2, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(0) * 44100.0 / NOTE(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)676 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)671 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)671 - 1) << (32 - 10)) - (((uint32_t)596 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_clarinet_clarinetb2, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(49) * 44100.0 / NOTE(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(49) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)700 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)695 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)695 - 1) << (32 - 10)) - (((uint32_t)586 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-2.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 72
- 72
examples/Synthesis/Wavetable/MidiSynthLarge/distortiongt_samples.cpp Ver arquivo

@@ -4,105 +4,105 @@ const AudioSynthWavetable::sample_data distortiongt_samples[4] = {
(int16_t*)sample_0_distortiongt_distgtra2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-45) * 44100.0 / NOTE(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-45) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1831 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1827 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1827 - 1) << (32 - 11)) - (((uint32_t)1745 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-91.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-91.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_distortiongt_distgtre3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-35) * 44100.0 / NOTE(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-35) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1431 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1427 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1427 - 1) << (32 - 11)) - (((uint32_t)1372 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-91.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-91.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_distortiongt_distgtra3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(38) * 44100.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(38) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1242 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1238 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1238 - 1) << (32 - 11)) - (((uint32_t)1195 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-91.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-91.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_distortiongt_distgtrd4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-4) * 44100.0 / NOTE(91) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-4) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(91) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1765 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1761 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1761 - 1) << (32 - 11)) - (((uint32_t)1593 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-91.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(19596.17 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-91.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 72
- 72
examples/Synthesis/Wavetable/MidiSynthLarge/epiano_samples.cpp Ver arquivo

@@ -4,105 +4,105 @@ const AudioSynthWavetable::sample_data epiano_samples[4] = {
(int16_t*)sample_0_epiano_coldglass7wave, // sample
true, // LOOP
7, // LENGTH_BITS
(1 << (32 - 7)) * CENTS_SHIFT(21) * 44100.0 / NOTE(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 7)) * WAVETABLE_CENTS_SHIFT(21) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)69 - 1) << (32 - 7), // MAX_PHASE
((uint32_t)65 - 1) << (32 - 7), // LOOP_PHASE_END
(((uint32_t)65 - 1) << (32 - 7)) - (((uint32_t)17 - 1) << (32 - 7)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(800.14 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-49.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(800.14 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-49.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_epiano_coldglass7wave, // sample
true, // LOOP
7, // LENGTH_BITS
(1 << (32 - 7)) * CENTS_SHIFT(21) * 44100.0 / NOTE(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 7)) * WAVETABLE_CENTS_SHIFT(21) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)69 - 1) << (32 - 7), // MAX_PHASE
((uint32_t)65 - 1) << (32 - 7), // LOOP_PHASE_END
(((uint32_t)65 - 1) << (32 - 7)) - (((uint32_t)17 - 1) << (32 - 7)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(860.05 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-47.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(860.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-47.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_epiano_coldglass7wave, // sample
true, // LOOP
7, // LENGTH_BITS
(1 << (32 - 7)) * CENTS_SHIFT(21) * 44100.0 / NOTE(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 7)) * WAVETABLE_CENTS_SHIFT(21) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)69 - 1) << (32 - 7), // MAX_PHASE
((uint32_t)65 - 1) << (32 - 7), // LOOP_PHASE_END
(((uint32_t)65 - 1) << (32 - 7)) - (((uint32_t)17 - 1) << (32 - 7)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2000.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-49.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2000.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-49.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_epiano_epiano2ms, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(29) * 44100.0 / NOTE(82) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(29) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(82) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1172 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1168 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1168 - 1) << (32 - 11)) - (((uint32_t)1120 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(800.14 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-49.6)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-23.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(800.14 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(680.26 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-49.6)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/flute_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data flute_samples[1] = {
(int16_t*)sample_0_flute_flutec4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-28) * 44100.0 / NOTE(89) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-28) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(89) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1431 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1427 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1427 - 1) << (32 - 11)) - (((uint32_t)1365 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(59.03 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(160.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5819.25 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-3.4)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(59.03 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(160.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5819.25 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-3.4)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/frenchhorn_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data frenchhorn_samples[1] = {
(int16_t*)sample_0_frenchhorn_frenchhorng4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(15) * 44100.0 / NOTE(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(15) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1484 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1480 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1480 - 1) << (32 - 11)) - (((uint32_t)1420 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-14.9)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-14.9)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/glockenspiel_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data glockenspiel_samples[2] = {
(int16_t*)sample_0_glockenspiel_sinetick, // sample
false, // LOOP
7, // LENGTH_BITS
(1 << (32 - 7)) * CENTS_SHIFT(11) * 44100.0 / NOTE(52) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 7)) * WAVETABLE_CENTS_SHIFT(11) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(52) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)72 - 1) << (32 - 7), // MAX_PHASE
((uint32_t)68 - 1) << (32 - 7), // LOOP_PHASE_END
(((uint32_t)68 - 1) << (32 - 7)) - (((uint32_t)7 - 1) << (32 - 7)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(240.09 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1269.42 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(306.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-14.9)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(240.09 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1269.42 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(306.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-14.9)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_glockenspiel_sinetick, // sample
false, // LOOP
7, // LENGTH_BITS
(1 << (32 - 7)) * CENTS_SHIFT(11) * 44100.0 / NOTE(52) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 7)) * WAVETABLE_CENTS_SHIFT(11) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(52) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)72 - 1) << (32 - 7), // MAX_PHASE
((uint32_t)68 - 1) << (32 - 7), // LOOP_PHASE_END
(((uint32_t)68 - 1) << (32 - 7)) - (((uint32_t)7 - 1) << (32 - 7)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(240.09 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1269.42 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(306.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-14.9)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(240.09 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1269.42 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(306.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-14.9)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/gtfretnoise_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data gtfretnoise_samples[1] = {
(int16_t*)sample_0_gtfretnoise_guitarfret, // sample
false, // LOOP
12, // LENGTH_BITS
(1 << (32 - 12)) * CENTS_SHIFT(-3) * 44100.0 / NOTE(81) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 12)) * WAVETABLE_CENTS_SHIFT(-3) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(81) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)3571 - 1) << (32 - 12), // MAX_PHASE
((uint32_t)3567 - 1) << (32 - 12), // LOOP_PHASE_END
(((uint32_t)3567 - 1) << (32 - 12)) - (((uint32_t)7 - 1) << (32 - 12)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(281.10 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(281.10 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/harmonica_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data harmonica_samples[1] = {
(int16_t*)sample_0_harmonica_harmonicaa3, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(33) * 44100.0 / NOTE(92) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(33) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(92) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)973 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)968 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)968 - 1) << (32 - 10)) - (((uint32_t)914 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-10.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(6.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(1.6) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(-1.6))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-10.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(6.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(1.6) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(-1.6))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/harp_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data harp_samples[1] = {
(int16_t*)sample_0_harp_pluckharp, // sample
true, // LOOP
12, // LENGTH_BITS
(1 << (32 - 12)) * CENTS_SHIFT(25) * 44100.0 / NOTE(89) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 12)) * WAVETABLE_CENTS_SHIFT(25) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(89) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)3477 - 1) << (32 - 12), // MAX_PHASE
((uint32_t)3473 - 1) << (32 - 12), // LOOP_PHASE_END
(((uint32_t)3473 - 1) << (32 - 12)) - (((uint32_t)3409 - 1) << (32 - 12)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-6.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(4289.57 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(2506.78 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-6.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(4289.57 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(2506.78 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/mutedgtr_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data mutedgtr_samples[1] = {
(int16_t*)sample_0_mutedgtr_mgtr, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(-46) * 44100.0 / NOTE(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(-46) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)835 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)831 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)831 - 1) << (32 - 10)) - (((uint32_t)766 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5467.32 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.3 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5467.32 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.3 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/MidiSynthLarge/nylonstrgtr_samples.cpp Ver arquivo

@@ -4,79 +4,79 @@ const AudioSynthWavetable::sample_data nylonstrgtr_samples[3] = {
(int16_t*)sample_0_nylonstrgtr_nguitrf2, // sample
true, // LOOP
12, // LENGTH_BITS
(1 << (32 - 12)) * CENTS_SHIFT(46) * 44100.0 / NOTE(70) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 12)) * WAVETABLE_CENTS_SHIFT(46) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(70) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)3828 - 1) << (32 - 12), // MAX_PHASE
((uint32_t)3824 - 1) << (32 - 12), // LOOP_PHASE_END
(((uint32_t)3824 - 1) << (32 - 12)) - (((uint32_t)3727 - 1) << (32 - 12)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_nylonstrgtr_nguitb2, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(-1) * 44100.0 / NOTE(77) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(-1) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(77) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)5192 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)5188 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)5188 - 1) << (32 - 13)) - (((uint32_t)5125 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_nylonstrgtr_acgtrb3, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(32) * 44100.0 / NOTE(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(32) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)6240 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)6236 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)6236 - 1) << (32 - 13)) - (((uint32_t)6168 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-7.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/MidiSynthLarge/oboe_samples.cpp Ver arquivo

@@ -4,79 +4,79 @@ const AudioSynthWavetable::sample_data oboe_samples[3] = {
(int16_t*)sample_0_oboe_oboecx3, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(33) * 44100.0 / NOTE(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(33) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)891 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)886 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)886 - 1) << (32 - 10)) - (((uint32_t)832 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_oboe_oboefx3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(38) * 44100.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(38) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1225 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1220 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1220 - 1) << (32 - 11)) - (((uint32_t)1177 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_oboe_oboeax3, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(32) * 44100.0 / NOTE(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(32) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)997 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)992 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)992 - 1) << (32 - 10)) - (((uint32_t)958 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-4.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/MidiSynthLarge/overdrivegt_samples.cpp Ver arquivo

@@ -4,79 +4,79 @@ const AudioSynthWavetable::sample_data overdrivegt_samples[3] = {
(int16_t*)sample_0_overdrivegt_distgtra2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-45) * 44100.0 / NOTE(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-45) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1831 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1827 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1827 - 1) << (32 - 11)) - (((uint32_t)1745 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-3.4)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-3.4)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_overdrivegt_distgtre3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-35) * 44100.0 / NOTE(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-35) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(79) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1431 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1427 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1427 - 1) << (32 - 11)) - (((uint32_t)1372 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-3.4)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-3.4)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_overdrivegt_distgtra3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(38) * 44100.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(38) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1242 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1238 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1238 - 1) << (32 - 11)) - (((uint32_t)1195 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-3.4)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-20.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(8315.67 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-3.4)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 72
- 72
examples/Synthesis/Wavetable/MidiSynthLarge/piano_samples.cpp Ver arquivo

@@ -4,105 +4,105 @@ const AudioSynthWavetable::sample_data piano_samples[4] = {
(int16_t*)sample_0_piano_kpianob1, // sample
true, // LOOP
15, // LENGTH_BITS
(1 << (32 - 15)) * CENTS_SHIFT(-43) * 44100.0 / NOTE(75) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(-43) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(75) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)17231 - 1) << (32 - 15), // MAX_PHASE
((uint32_t)17227 - 1) << (32 - 15), // LOOP_PHASE_END
(((uint32_t)17227 - 1) << (32 - 15)) - (((uint32_t)10655 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_piano_kpianocx4, // sample
true, // LOOP
15, // LENGTH_BITS
(1 << (32 - 15)) * CENTS_SHIFT(4) * 44100.0 / NOTE(77) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(4) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(77) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)21573 - 1) << (32 - 15), // MAX_PHASE
((uint32_t)21569 - 1) << (32 - 15), // LOOP_PHASE_END
(((uint32_t)21569 - 1) << (32 - 15)) - (((uint32_t)21506 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_piano_kpianodx5, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(29) * 44100.0 / NOTE(106) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(29) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(106) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)6145 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)6141 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)6141 - 1) << (32 - 13)) - (((uint32_t)6093 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_piano_kpianof502, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(30) * 44100.0 / NOTE(111) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(30) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(111) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)4463 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)4202 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)4202 - 1) << (32 - 13)) - (((uint32_t)4148 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-15.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(630.32 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(12596.93 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 18
- 18
examples/Synthesis/Wavetable/MidiSynthLarge/recorder_samples.cpp Ver arquivo

@@ -4,27 +4,27 @@ const AudioSynthWavetable::sample_data recorder_samples[1] = {
(int16_t*)sample_0_recorder_recorderax2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(33) * 44100.0 / NOTE(92) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(33) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(92) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1359 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1352 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1352 - 1) << (32 - 11)) - (((uint32_t)1298 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11848.78 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-3.4)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11848.78 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-3.4)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 864
- 864
examples/Synthesis/Wavetable/MidiSynthLarge/standard_DRUMS_samples.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/steelstrgtr_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data steelstrgtr_samples[2] = {
(int16_t*)sample_0_steelstrgtr_acgtrg2, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(47) * 44100.0 / NOTE(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(47) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)4881 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)4877 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)4877 - 1) << (32 - 13)) - (((uint32_t)4800 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-13.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(7197.52 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-13.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(7197.52 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_steelstrgtr_acgtrb3, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(32) * 44100.0 / NOTE(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(32) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)6240 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)6236 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)6236 - 1) << (32 - 13)) - (((uint32_t)6168 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-13.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(7197.52 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-13.5)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(7197.52 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(100.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(21.8 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(120.05 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.5 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/MidiSynthLarge/strings_samples.cpp Ver arquivo

@@ -4,79 +4,79 @@ const AudioSynthWavetable::sample_data strings_samples[3] = {
(int16_t*)sample_0_strings_stringsg2, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(29) * 44100.0 / NOTE(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(29) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)9308 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)9304 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)9304 - 1) << (32 - 14)) - (((uint32_t)2609 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_strings_stringsf3, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(50) * 44100.0 / NOTE(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(50) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)8646 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)8642 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)8642 - 1) << (32 - 14)) - (((uint32_t)3415 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_strings_stringsdx4, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(36) * 44100.0 / NOTE(94) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(36) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(94) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)10726 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)10722 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)10722 - 1) << (32 - 14)) - (((uint32_t)3098 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-9.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(986.23 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/MidiSynthLarge/timpani_samples.cpp Ver arquivo

@@ -4,79 +4,79 @@ const AudioSynthWavetable::sample_data timpani_samples[3] = {
(int16_t*)sample_0_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(0) * 44100.0 / NOTE(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3398.74 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(2353.81 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3398.74 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(2353.81 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(0) * 44100.0 / NOTE(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3198.73 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3198.73 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * CENTS_SHIFT(0) * 44100.0 / NOTE(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2599.68 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2599.68 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 72
- 72
examples/Synthesis/Wavetable/MidiSynthLarge/trombone_samples.cpp Ver arquivo

@@ -4,105 +4,105 @@ const AudioSynthWavetable::sample_data trombone_samples[4] = {
(int16_t*)sample_0_trombone_tromb2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-7) * 44100.0 / NOTE(70) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-7) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(70) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1330 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1326 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1326 - 1) << (32 - 11)) - (((uint32_t)1232 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_trombone_troma3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(33) * 44100.0 / NOTE(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(33) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(80) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1333 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1329 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1329 - 1) << (32 - 11)) - (((uint32_t)1275 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_trombone_tromd4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-3) * 44100.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-3) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1120 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1116 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1116 - 1) << (32 - 11)) - (((uint32_t)1074 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_trombone_tromg4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(16) * 44100.0 / NOTE(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(16) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1568 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1564 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1564 - 1) << (32 - 11)) - (((uint32_t)1504 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 90
- 90
examples/Synthesis/Wavetable/MidiSynthLarge/trumpet_samples.cpp Ver arquivo

@@ -4,131 +4,131 @@ const AudioSynthWavetable::sample_data trumpet_samples[5] = {
(int16_t*)sample_0_trumpet_htrumpetd2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-43) * 44100.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-43) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1673 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1669 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1669 - 1) << (32 - 11)) - (((uint32_t)1628 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_trumpet_htrumpetg2, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-20) * 44100.0 / NOTE(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-20) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1635 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1631 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1631 - 1) << (32 - 11)) - (((uint32_t)1598 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_trumpet_htrumpetc3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-1) * 44100.0 / NOTE(93) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-1) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(93) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1652 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1648 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1648 - 1) << (32 - 11)) - (((uint32_t)1598 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_trumpet_htrumpetf3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(24) * 44100.0 / NOTE(98) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(24) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(98) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1496 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1492 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1492 - 1) << (32 - 11)) - (((uint32_t)1454 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_4_trumpet_htrumpetax3, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(-4) * 44100.0 / NOTE(103) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(-4) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(103) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1662 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1658 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1658 - 1) << (32 - 11)) - (((uint32_t)1602 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-2.3)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-5.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(536.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-2.3)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/tuba_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data tuba_samples[2] = {
(int16_t*)sample_0_tuba_tubaax1, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(38) * 44100.0 / NOTE(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(38) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1963 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1960 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1960 - 1) << (32 - 11)) - (((uint32_t)1831 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(493.12 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(493.12 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_tuba_tromg4, // sample
true, // LOOP
11, // LENGTH_BITS
(1 << (32 - 11)) * CENTS_SHIFT(16) * 44100.0 / NOTE(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 11)) * WAVETABLE_CENTS_SHIFT(16) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(90) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)1568 - 1) << (32 - 11), // MAX_PHASE
((uint32_t)1564 - 1) << (32 - 11), // LOOP_PHASE_END
(((uint32_t)1564 - 1) << (32 - 11)) - (((uint32_t)1504 - 1) << (32 - 11)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(493.12 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-5.5)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(11993.38 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(493.12 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-5.5)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(260.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(9) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(-9)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/MidiSynthLarge/vibraphone_samples.cpp Ver arquivo

@@ -4,53 +4,53 @@ const AudioSynthWavetable::sample_data vibraphone_samples[2] = {
(int16_t*)sample_0_vibraphone_vibese2, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(24) * 44100.0 / NOTE(73) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(24) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(73) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)781 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)777 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)777 - 1) << (32 - 10)) - (((uint32_t)696 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-8.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5819.25 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(1487.96 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.6 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(2.0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(-2.0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-8.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(5819.25 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(1487.96 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.6 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(2.0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(-2.0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_vibraphone_vibese2, // sample
true, // LOOP
10, // LENGTH_BITS
(1 << (32 - 10)) * CENTS_SHIFT(24) * 44100.0 / NOTE(73) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 10)) * WAVETABLE_CENTS_SHIFT(24) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(73) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)781 - 1) << (32 - 10), // MAX_PHASE
((uint32_t)777 - 1) << (32 - 10), // LOOP_PHASE_END
(((uint32_t)777 - 1) << (32 - 10)) - (((uint32_t)696 - 1) << (32 - 10)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-8.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2439.64 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(1487.96 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(-100.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.6 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(2.0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(-2.0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-8.2)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(20.01 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2439.64 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(1487.96 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.6 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(2.0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(-2.0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/SimpleWavetable/Flute_100kbyte_samples.cpp Ver arquivo

@@ -3162,79 +3162,79 @@ static const AudioSynthWavetable::sample_data Flute_100kbyte_samples[3] = {
(int16_t*)sample_0_Flute_100kbyte_FluteD4, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(0) * 37248.0 / NOTE(63) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(0) * 37248.0 / WAVETABLE_NOTE_TO_FREQUENCY(63) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)15713 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)15712 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)15712 - 1) << (32 - 14)) - (((uint32_t)9379 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Flute_100kbyte_FluteE5, // sample
true, // LOOP
15, // LENGTH_BITS
(1 << (32 - 15)) * CENTS_SHIFT(0) * 33622.0 / NOTE(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(0) * 33622.0 / WAVETABLE_NOTE_TO_FREQUENCY(76) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)18800 - 1) << (32 - 15), // MAX_PHASE
((uint32_t)18799 - 1) << (32 - 15), // LOOP_PHASE_END
(((uint32_t)18799 - 1) << (32 - 15)) - (((uint32_t)13249 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Flute_100kbyte_FluteE6, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(0) * 35601.0 / NOTE(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(0) * 35601.0 / WAVETABLE_NOTE_TO_FREQUENCY(88) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)15715 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)15714 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)15714 - 1) << (32 - 14)) - (((uint32_t)3234 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(250.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 54
- 54
examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.cpp Ver arquivo

@@ -2452,79 +2452,79 @@ static const AudioSynthWavetable::sample_data MutedTrumpet_samples[3] = {
(int16_t*)sample_0_MutedTrumpet_HRMMUTED4, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(35) * 48000.0 / NOTE(63) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(35) * 48000.0 / WAVETABLE_NOTE_TO_FREQUENCY(63) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)16180 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)16179 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)16179 - 1) << (32 - 14)) - (((uint32_t)8315 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_MutedTrumpet_HRMMUTEC5, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(45) * 48000.0 / NOTE(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(45) * 48000.0 / WAVETABLE_NOTE_TO_FREQUENCY(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)13598 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)13597 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)13597 - 1) << (32 - 14)) - (((uint32_t)8897 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_MutedTrumpet_HRMMUTEC6, // sample
true, // LOOP
14, // LENGTH_BITS
(1 << (32 - 14)) * CENTS_SHIFT(38) * 48000.0 / NOTE(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 14)) * WAVETABLE_CENTS_SHIFT(38) * 48000.0 / WAVETABLE_NOTE_TO_FREQUENCY(84) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)9048 - 1) << (32 - 14), // MAX_PHASE
((uint32_t)9047 - 1) << (32 - 14), // LOOP_PHASE_END
(((uint32_t)9047 - 1) << (32 - 14)) - (((uint32_t)6611 - 1) << (32 - 14)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-13.6)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(7.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(10.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 68
- 68
examples/Synthesis/Wavetable/Zelda/Pizzicato_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)5687-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)5679-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)5679-1) << (32 - 13)) - (((uint32_t)5608-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(4110*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2940*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Pizzicato_PizzViolinC4, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)4607-1) << (32 - 13), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)4599-1) << (32 - 13), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)4599-1) << (32 - 13)) - (((uint32_t)4557-1) << (32 - 13)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(3929*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(2849*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2569*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1449*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Pizzicato_PizzViolinE5, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Pizzicato_samples[4] = {
((uint32_t)1355-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1347-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1347-1) << (32 - 11)) - (((uint32_t)1331-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-550/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(2329*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(1309*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(1*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5129/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 136
- 136
examples/Synthesis/Wavetable/Zelda/Viola_samples.cpp Ver arquivo

@@ -8,23 +8,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1306-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1299-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1299-1) << (32 - 11)) - (((uint32_t)1205-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_Viola_ViolinD3, //16-bit PCM encoded audio sample
@@ -34,23 +34,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1593-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1585-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1585-1) << (32 - 11)) - (((uint32_t)1510-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-950/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(29*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_Viola_ViolinG3, //16-bit PCM encoded audio sample
@@ -60,23 +60,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1526-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1518-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1518-1) << (32 - 11)) - (((uint32_t)1462-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(32*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_3_Viola_ViolinC4, //16-bit PCM encoded audio sample
@@ -86,23 +86,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1343-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1335-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1335-1) << (32 - 11)) - (((uint32_t)1293-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-800/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_4_Viola_ViolinGb4, //16-bit PCM encoded audio sample
@@ -112,23 +112,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1331-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1323-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1323-1) << (32 - 11)) - (((uint32_t)1292-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(14*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_5_Viola_ViolinC5, //16-bit PCM encoded audio sample
@@ -138,23 +138,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1255-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1247-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1247-1) << (32 - 11)) - (((uint32_t)1225-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-650/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(19*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_6_Viola_ViolinEb5, //16-bit PCM encoded audio sample
@@ -164,23 +164,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)1454-1) << (32 - 11), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)1446-1) << (32 - 11), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)1446-1) << (32 - 11)) - (((uint32_t)1427-1) << (32 - 11)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-720/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(25*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_7_Viola_ViolinEb6, //16-bit PCM encoded audio sample
@@ -190,23 +190,23 @@ const AudioSynthWavetable::sample_data Viola_samples[8] = {
((uint32_t)817-1) << (32 - 10), //(sample_length-1) << (32 - sample_length_bits)
((uint32_t)809-1) << (32 - 10), //(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
(((uint32_t)809-1) << (32 - 10)) - (((uint32_t)799-1) << (32 - 10)), //LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-870/100.0)), //INITIAL_ATTENUATION_SCALAR
uint32_t(0*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DELAY_COUNT
uint32_t(27*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //ATTACK_COUNT
uint32_t(413*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //HOLD_COUNT
uint32_t(28197*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //DECAY_COUNT
uint32_t(356*AudioSynthWavetable::SAMPLES_PER_MSEC/8.0+0.5), //RELEASE_COUNT
int32_t(0*AudioSynthWavetable::UNITY_GAIN), //SUSTAIN_MULT
uint32_t(9 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(5711/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(383 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5171/1000.0 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(-8223/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(8223/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 36
- 36
examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.cpp Ver arquivo

@@ -2481,53 +2481,53 @@ static const AudioSynthWavetable::sample_data WT_Trumpet_samples[2] = {
(int16_t*)sample_0_WT_Trumpet_trum04, // sample
true, // LOOP
15, // LENGTH_BITS
(1 << (32 - 15)) * CENTS_SHIFT(0) * 22050.0 / NOTE(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(0) * 22050.0 / WAVETABLE_NOTE_TO_FREQUENCY(65) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)20178 - 1) << (32 - 15), // MAX_PHASE
((uint32_t)20177 - 1) << (32 - 15), // LOOP_PHASE_END
(((uint32_t)20177 - 1) << (32 - 15)) - (((uint32_t)16389 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(432.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(432.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_WT_Trumpet_trum09, // sample
true, // LOOP
15, // LENGTH_BITS
(1 << (32 - 15)) * CENTS_SHIFT(0) * 22050.0 / NOTE(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(0) * 22050.0 / WAVETABLE_NOTE_TO_FREQUENCY(74) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)19274 - 1) << (32 - 15), // MAX_PHASE
((uint32_t)19273 - 1) << (32 - 15), // LOOP_PHASE_END
(((uint32_t)19273 - 1) << (32 - 15)) - (((uint32_t)14622 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(432.02 * SAMPLES_PER_MSEC / ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - DECIBEL_SHIFT(0.0)) * UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(0)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(432.02 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(8.2 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};


+ 12
- 15
synth_wavetable.h Ver arquivo

@@ -31,21 +31,9 @@
#include <math.h>
#include <stdint.h>

// TODO: move all this stuff into the AudioSynthWavetable class (used in sample data)
#define UNITY_GAIN INT32_MAX // Max amplitude / no attenuation
#define SAMPLES_PER_MSEC (AUDIO_SAMPLE_RATE_EXACT/1000.0)
#define LFO_SMOOTHNESS 3
#define LFO_PERIOD (AUDIO_BLOCK_SAMPLES/(1 << (LFO_SMOOTHNESS-1)))
#define ENVELOPE_PERIOD 8
#define CENTS_SHIFT(C) (pow(2.0, C/1200.0))
#define NOTE(N) (440.0 * pow(2.0, (N - 69) / 12.0))
#define DECIBEL_SHIFT(dB) (pow(10.0, dB/20.0))

// TODO: move all this stuff into the AudioSynthWavetable class (used in this file)
#define DEFAULT_AMPLITUDE 90
#define TRIANGLE_INITIAL_PHASE (-0x40000000)
enum envelopeStateEnum { STATE_IDLE, STATE_DELAY, STATE_ATTACK, STATE_HOLD, STATE_DECAY, STATE_SUSTAIN, STATE_RELEASE };

#define WAVETABLE_CENTS_SHIFT(C) (pow(2.0, (C)/1200.0))
#define WAVETABLE_NOTE_TO_FREQUENCY(N) (440.0 * pow(2.0, ((N) - 69) / 12.0))
#define WAVETABLE_DECIBEL_SHIFT(dB) (pow(10.0, (dB)/20.0))

class AudioSynthWavetable : public AudioStream
{
@@ -83,12 +71,21 @@ public:
const int32_t MODULATION_AMPLITUDE_INITIAL_GAIN;
const int32_t MODULATION_AMPLITUDE_SECOND_GAIN;
};
static const int32_t UNITY_GAIN = INT32_MAX;
static constexpr float SAMPLES_PER_MSEC = (AUDIO_SAMPLE_RATE_EXACT/1000.0);
static const int32_t LFO_SMOOTHNESS = 3;
static constexpr float LFO_PERIOD = (AUDIO_BLOCK_SAMPLES/(1 << (LFO_SMOOTHNESS-1)));
static const int32_t ENVELOPE_PERIOD = 8;

struct instrument_data {
const uint8_t sample_count;
const uint8_t* sample_note_ranges;
const sample_data* samples;
};
enum { DEFAULT_AMPLITUDE = 90 };
enum { TRIANGLE_INITIAL_PHASE = -0x40000000 };
enum envelopeStateEnum { STATE_IDLE, STATE_DELAY, STATE_ATTACK, STATE_HOLD, STATE_DECAY, STATE_SUSTAIN, STATE_RELEASE };

public:
/**
* Class constructor.

Carregando…
Cancelar
Salvar