|
|
@ -61,7 +61,9 @@ using namespace TeensyTimerTool; |
|
|
|
|
|
|
|
|
|
|
|
// Audio engines
|
|
|
|
// Audio engines
|
|
|
|
AudioSynthDexed* MicroDexed[NUM_DEXED]; |
|
|
|
AudioSynthDexed* MicroDexed[NUM_DEXED]; |
|
|
|
|
|
|
|
#if defined(USE_EPIANO) |
|
|
|
AudioSynthEPiano ep(NUM_EPIANO_VOICES); |
|
|
|
AudioSynthEPiano ep(NUM_EPIANO_VOICES); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
AudioSynthWaveform* chorus_modulator[NUM_DEXED]; |
|
|
|
AudioSynthWaveform* chorus_modulator[NUM_DEXED]; |
|
|
@ -108,11 +110,11 @@ AudioEffectFreeverbStereoFloat freeverb; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_EPIANO) |
|
|
|
#if defined(USE_EPIANO) |
|
|
|
AudioMixer<4> master_mixer_r; |
|
|
|
|
|
|
|
AudioMixer<4> master_mixer_l; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioMixer<5> master_mixer_r; |
|
|
|
AudioMixer<5> master_mixer_r; |
|
|
|
AudioMixer<5> master_mixer_l; |
|
|
|
AudioMixer<5> master_mixer_l; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioMixer<4> master_mixer_r; |
|
|
|
|
|
|
|
AudioMixer<4> master_mixer_l; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
AudioAmplifier volume_r; |
|
|
|
AudioAmplifier volume_r; |
|
|
|
AudioAmplifier volume_l; |
|
|
|
AudioAmplifier volume_l; |
|
|
@ -179,13 +181,13 @@ AudioConnection patchCord[] = { |
|
|
|
#ifdef USE_PLATEREVERB |
|
|
|
#ifdef USE_PLATEREVERB |
|
|
|
{reverb_mixer_r, 0, reverb, 0}, |
|
|
|
{reverb_mixer_r, 0, reverb, 0}, |
|
|
|
{reverb_mixer_l, 0, reverb, 1}, |
|
|
|
{reverb_mixer_l, 0, reverb, 1}, |
|
|
|
{reverb, 0, master_mixer_r, 3}, |
|
|
|
{reverb, 0, master_mixer_r, CH_REVERB}, |
|
|
|
{reverb, 1, master_mixer_l, 3}, |
|
|
|
{reverb, 1, master_mixer_l, CH_REVERB}, |
|
|
|
#else |
|
|
|
#else |
|
|
|
{reverb_mixer_r, 0, freeverb, 0}, |
|
|
|
{reverb_mixer_r, 0, freeverb, 0}, |
|
|
|
{reverb_mixer_l, 0, freeverb, 1}, |
|
|
|
{reverb_mixer_l, 0, freeverb, 1}, |
|
|
|
{freeverb, 0, master_mixer_r, 3}, |
|
|
|
{freeverb, 0, master_mixer_r, CH_REVERB}, |
|
|
|
{freeverb, 1, master_mixer_l, 3}, |
|
|
|
{freeverb, 1, master_mixer_l, CH_REVERB}, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
{master_mixer_r, volume_r}, |
|
|
|
{master_mixer_r, volume_r}, |
|
|
@ -236,11 +238,11 @@ AudioConnection patchCord[] = { |
|
|
|
#ifdef USE_FX |
|
|
|
#ifdef USE_FX |
|
|
|
{drum_reverb_send_mixer_r, 0, reverb_mixer_r, 2}, |
|
|
|
{drum_reverb_send_mixer_r, 0, reverb_mixer_r, 2}, |
|
|
|
{drum_reverb_send_mixer_l, 0, reverb_mixer_l, 2}, |
|
|
|
{drum_reverb_send_mixer_l, 0, reverb_mixer_l, 2}, |
|
|
|
{drum_mixer_r, 0, master_mixer_r, 2}, |
|
|
|
{drum_mixer_r, 0, master_mixer_r, CH_DRUMS}, |
|
|
|
{drum_mixer_l, 0, master_mixer_l, 2}, |
|
|
|
{drum_mixer_l, 0, master_mixer_l, CH_DRUMS}, |
|
|
|
#else |
|
|
|
#else |
|
|
|
{drum_mixer_r, 0, master_mixer_r, 2}, |
|
|
|
{drum_mixer_r, 0, master_mixer_r, CH_DRUMS}, |
|
|
|
{drum_mixer_l, 0, master_mixer_l, 2}, |
|
|
|
{drum_mixer_l, 0, master_mixer_l, CH_DRUMS}, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -264,8 +266,8 @@ AudioConnection patchCord[] = { |
|
|
|
{ep_chorus_mixer_r, 0, reverb_mixer_r, 3}, |
|
|
|
{ep_chorus_mixer_r, 0, reverb_mixer_r, 3}, |
|
|
|
{ep_chorus_mixer_l, 0, reverb_mixer_l, 3}, |
|
|
|
{ep_chorus_mixer_l, 0, reverb_mixer_l, 3}, |
|
|
|
#else |
|
|
|
#else |
|
|
|
{ep, 0, master_mixer_r, 4}, |
|
|
|
{ep, 0, master_mixer_r, CH_EPIANO}, |
|
|
|
{ep, 1, master_mixer_l, 4}, |
|
|
|
{ep, 1, master_mixer_l, CH_EPIANO}, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
@ -580,7 +582,6 @@ void setup() |
|
|
|
// Setup EPiano
|
|
|
|
// Setup EPiano
|
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_EPIANO) |
|
|
|
#if defined(USE_EPIANO) |
|
|
|
|
|
|
|
|
|
|
|
// EP_CHORUS
|
|
|
|
// EP_CHORUS
|
|
|
|
memset(ep_delayline_r, 0, sizeof(ep_delayline_r)); |
|
|
|
memset(ep_delayline_r, 0, sizeof(ep_delayline_r)); |
|
|
|
if (!ep_modchorus_r.begin(ep_delayline_r, MOD_DELAY_SAMPLE_BUFFER)) |
|
|
|
if (!ep_modchorus_r.begin(ep_delayline_r, MOD_DELAY_SAMPLE_BUFFER)) |
|
|
@ -714,24 +715,24 @@ void setup() |
|
|
|
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(0, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(CH_DEXED1, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(0, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(CH_DEXED1, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(1, 0.0); |
|
|
|
master_mixer_r.gain(CH_DEXED2, 0.0); |
|
|
|
master_mixer_l.gain(1, 0.0); |
|
|
|
master_mixer_l.gain(CH_DEXED2, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
master_mixer_r.gain(CH_REVERB, VOL_MAX_FLOAT); |
|
|
|
|
|
|
|
master_mixer_l.gain(CH_REVERB, VOL_MAX_FLOAT); |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
master_mixer_r.gain(2, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(CH_DRUMS, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(2, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(CH_DRUMS, VOL_MAX_FLOAT); |
|
|
|
seq.drums_volume = VOL_MAX_FLOAT; |
|
|
|
seq.drums_volume = VOL_MAX_FLOAT; |
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(2, 0.0); |
|
|
|
master_mixer_r.gain(CH_DRUMS, 0.0); |
|
|
|
master_mixer_l.gain(2, 0.0); |
|
|
|
master_mixer_l.gain(CH_DRUMS, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
master_mixer_r.gain(3, VOL_MAX_FLOAT); |
|
|
|
|
|
|
|
master_mixer_l.gain(3, VOL_MAX_FLOAT); |
|
|
|
|
|
|
|
#if defined(USE_EPIANO) |
|
|
|
#if defined(USE_EPIANO) |
|
|
|
master_mixer_r.gain(4, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(CH_EPIANO, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(4, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(CH_EPIANO, VOL_MAX_FLOAT); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
@ -760,6 +761,8 @@ void setup() |
|
|
|
|
|
|
|
|
|
|
|
void loop() |
|
|
|
void loop() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
master_mixer_r.gain(CH_EPIANO, VOL_MAX_FLOAT); |
|
|
|
|
|
|
|
master_mixer_l.gain(CH_EPIANO, VOL_MAX_FLOAT); |
|
|
|
// MIDI input handling
|
|
|
|
// MIDI input handling
|
|
|
|
check_midi_devices(); |
|
|
|
check_midi_devices(); |
|
|
|
|
|
|
|
|
|
|
@ -2012,8 +2015,8 @@ void init_MIDI_send_CC(void) |
|
|
|
|
|
|
|
|
|
|
|
void set_drums_volume(float vol) |
|
|
|
void set_drums_volume(float vol) |
|
|
|
{ |
|
|
|
{ |
|
|
|
master_mixer_r.gain(2, vol); |
|
|
|
master_mixer_r.gain(CH_DRUMS, vol); |
|
|
|
master_mixer_l.gain(2, vol); |
|
|
|
master_mixer_l.gain(CH_DRUMS, vol); |
|
|
|
} |
|
|
|
} |
|
|
|
void set_volume(uint8_t v, uint8_t m) |
|
|
|
void set_volume(uint8_t v, uint8_t m) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2561,8 +2564,8 @@ void set_fx_params(void) |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
master_mixer_r.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
master_mixer_r.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
master_mixer_l.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
master_mixer_l.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef SGTL5000_AUDIO_ENHANCE |
|
|
|
#ifdef SGTL5000_AUDIO_ENHANCE |
|
|
|