|
|
@ -359,7 +359,7 @@ void create_audio_drum_chain(uint8_t instance_id) |
|
|
|
uint8_t sd_card = 0; |
|
|
|
uint8_t sd_card = 0; |
|
|
|
Sd2Card card; |
|
|
|
Sd2Card card; |
|
|
|
SdVolume volume; |
|
|
|
SdVolume volume; |
|
|
|
float midi_ticks_factor[10] = {0.0, 0.25, 0.375, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0 , 4.0}; |
|
|
|
const float midi_ticks_factor[10] = {0.0, 0.25, 0.375, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0 , 4.0}; |
|
|
|
uint8_t midi_bpm_counter = 0; |
|
|
|
uint8_t midi_bpm_counter = 0; |
|
|
|
uint8_t midi_bpm = 0; |
|
|
|
uint8_t midi_bpm = 0; |
|
|
|
int16_t _midi_bpm = -1; |
|
|
|
int16_t _midi_bpm = -1; |
|
|
@ -565,7 +565,7 @@ void setup() |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//Setup (PROGMEM-) sample drums
|
|
|
|
// Setup (PROGMEM) sample drums
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
// create dynamic Drum instances
|
|
|
|
// create dynamic Drum instances
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DRUMS; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DRUMS; instance_id++) |
|
|
@ -618,17 +618,17 @@ void setup() |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
ep_chorus_mixer_r.gain(0, 1.0); |
|
|
|
ep_chorus_mixer_r.gain(0, 1.0); |
|
|
|
ep_chorus_mixer_l.gain(0, 1.0); |
|
|
|
ep_chorus_mixer_l.gain(0, 1.0); |
|
|
|
ep_chorus_mixer_r.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_r.gain(1, mapfloat(EP_CHORUS_LEVEL_DEFAULT, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_l.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_l.gain(1, mapfloat(EP_CHORUS_LEVEL_DEFAULT, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
ep_stereo_panorama.panorama(0.0); |
|
|
|
ep_stereo_panorama.panorama(mapfloat(EP_PANORAMA_DEFAULT, EP_PANORAMA_DEFAULT, EP_PANORAMA_DEFAULT, 0.0, 1.0)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Setup effects
|
|
|
|
// Setup effects
|
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
memset(delayline[instance_id], 0, sizeof(delayline[instance_id])); |
|
|
|
memset(delayline[instance_id], 0, sizeof(delayline[instance_id])); |
|
|
|
if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) { |
|
|
|
if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) { |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -653,7 +653,7 @@ void setup() |
|
|
|
sd_card = check_sd_cards(); |
|
|
|
sd_card = check_sd_cards(); |
|
|
|
|
|
|
|
|
|
|
|
if (sd_card < 1) |
|
|
|
if (sd_card < 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("SD card not accessable.")); |
|
|
|
Serial.println(F("SD card not accessable.")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -691,7 +691,7 @@ void setup() |
|
|
|
// Load voices
|
|
|
|
// Load voices
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Serial.print(F("Dexed instance ")); |
|
|
|
Serial.print(F("Dexed instance ")); |
|
|
|
Serial.print(instance_id); |
|
|
|
Serial.print(instance_id); |
|
|
|
Serial.println(F(":")); |
|
|
|
Serial.println(F(":")); |
|
|
@ -717,7 +717,7 @@ void setup() |
|
|
|
// Init master_mixer
|
|
|
|
// Init master_mixer
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
#if NUM_DEXED > 1 |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
master_mixer_r.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
} |
|
|
|
} |
|
|
@ -2256,7 +2256,6 @@ void check_configuration_epiano(void) |
|
|
|
configuration.epiano.detune = constrain(configuration.epiano.detune, EP_DETUNE_MIN, EP_DETUNE_MAX); |
|
|
|
configuration.epiano.detune = constrain(configuration.epiano.detune, EP_DETUNE_MIN, EP_DETUNE_MAX); |
|
|
|
configuration.epiano.overdrive = constrain(configuration.epiano.overdrive, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX); |
|
|
|
configuration.epiano.overdrive = constrain(configuration.epiano.overdrive, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX); |
|
|
|
configuration.epiano.lowest_note = constrain(configuration.epiano.lowest_note, EP_LOWEST_NOTE_MIN, EP_LOWEST_NOTE_MAX); |
|
|
|
configuration.epiano.lowest_note = constrain(configuration.epiano.lowest_note, EP_LOWEST_NOTE_MIN, EP_LOWEST_NOTE_MAX); |
|
|
|
configuration.epiano.highest_note = 108; // TODO!
|
|
|
|
|
|
|
|
configuration.epiano.highest_note = constrain(configuration.epiano.highest_note, EP_HIGHEST_NOTE_MIN, EP_HIGHEST_NOTE_MAX); |
|
|
|
configuration.epiano.highest_note = constrain(configuration.epiano.highest_note, EP_HIGHEST_NOTE_MIN, EP_HIGHEST_NOTE_MAX); |
|
|
|
configuration.epiano.transpose = constrain(configuration.epiano.transpose, EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX); |
|
|
|
configuration.epiano.transpose = constrain(configuration.epiano.transpose, EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX); |
|
|
|
configuration.epiano.sound_intensity = constrain(configuration.epiano.sound_intensity, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX); |
|
|
|
configuration.epiano.sound_intensity = constrain(configuration.epiano.sound_intensity, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX); |
|
|
@ -2508,6 +2507,7 @@ void set_fx_params(void) |
|
|
|
uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / seq.seq_bpm); |
|
|
|
uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / seq.seq_bpm); |
|
|
|
delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); |
|
|
|
delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// REVERB SEND
|
|
|
|
// REVERB SEND
|
|
|
|
reverb_mixer_r.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
reverb_mixer_r.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
reverb_mixer_l.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
reverb_mixer_l.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
@ -2538,6 +2538,7 @@ void set_fx_params(void) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_EPIANO) |
|
|
|
#if defined(USE_EPIANO) |
|
|
|
|
|
|
|
#ifdef USE_FX |
|
|
|
reverb_mixer_r.gain(REVERB_MIX_CH_EPIANO, mapfloat(configuration.fx.ep_reverb_send, EP_REVERB_SEND_MIN, EP_REVERB_SEND_MAX, 0.0, 1.0)); // EPiano Reverb-Send
|
|
|
|
reverb_mixer_r.gain(REVERB_MIX_CH_EPIANO, mapfloat(configuration.fx.ep_reverb_send, EP_REVERB_SEND_MIN, EP_REVERB_SEND_MAX, 0.0, 1.0)); // EPiano Reverb-Send
|
|
|
|
reverb_mixer_l.gain(REVERB_MIX_CH_EPIANO, mapfloat(configuration.fx.ep_reverb_send, EP_REVERB_SEND_MIN, EP_REVERB_SEND_MAX, 0.0, 1.0)); // EPiano Reverb-Send
|
|
|
|
reverb_mixer_l.gain(REVERB_MIX_CH_EPIANO, mapfloat(configuration.fx.ep_reverb_send, EP_REVERB_SEND_MIN, EP_REVERB_SEND_MAX, 0.0, 1.0)); // EPiano Reverb-Send
|
|
|
|
|
|
|
|
|
|
|
@ -2573,6 +2574,7 @@ void set_fx_params(void) |
|
|
|
ep_chorus_mixer_r.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_r.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_l.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_mixer_l.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
ep_chorus_inverter.gain(-1.0); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
master_mixer_r.gain(MASTER_MIX_CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
master_mixer_r.gain(MASTER_MIX_CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|