diff --git a/MicroDexed.ino b/MicroDexed.ino index dcaf1fa..ce11d16 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -31,19 +31,15 @@ #include #include #include +#include "UI.hpp" #include "midi_devices.hpp" #include "synth_dexed.h" #include "dexed_sd.h" #include #include #include -#if defined(USE_PLATEREVERB) #include -#else -#include -#endif #include -#include "UI.hpp" #if NUM_DRUMS > 0 #include "midinotes.h" #include "drumset.h" @@ -51,21 +47,16 @@ #ifdef SGTL5000_AUDIO_ENHANCE #include "control_sgtl5000plus.h" #endif -#if defined(USE_EPIANO) #include "synth_mda_epiano.h" #include -#endif #if defined(USE_DELAY_8M) #include "effect_delay_ext8.h" #endif // Audio engines AudioSynthDexed* MicroDexed[NUM_DEXED]; -#if defined(USE_EPIANO) AudioSynthEPiano ep(NUM_EPIANO_VOICES); -#endif -#if defined(USE_FX) AudioSynthWaveform* chorus_modulator[NUM_DEXED]; #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT AudioFilterBiquad* modchorus_filter[NUM_DEXED]; @@ -79,10 +70,8 @@ AudioEffectDelayExternal8* delay_fx[NUM_DEXED]; AudioEffectDelay* delay_fx[NUM_DEXED]; #endif AudioMixer<2>* delay_mixer[NUM_DEXED]; -#endif AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; -#if defined(USE_FX) && defined(USE_EPIANO) AudioEffectStereoPanorama ep_stereo_panorama; AudioSynthWaveform ep_chorus_modulator; #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT @@ -91,32 +80,15 @@ AudioFilterBiquad ep_modchorus_filter; AudioEffectModulatedDelayStereo ep_modchorus; AudioMixer<2> ep_chorus_mixer_r; AudioMixer<2> ep_chorus_mixer_l; -#endif AudioMixer<2> microdexed_peak_mixer; AudioAnalyzePeak microdexed_peak; -#if defined(USE_FX) -#if defined(USE_EPIANO) AudioMixer<4> reverb_mixer_r; AudioMixer<4> reverb_mixer_l; -#else -AudioMixer<3> reverb_mixer_r; -AudioMixer<3> reverb_mixer_l; -#endif -#if defined(USE_PLATEREVERB) AudioEffectPlateReverb reverb; -#else -AudioEffectFreeverbStereoFloat freeverb; -#endif -#endif -#if defined(USE_FX) && defined(USE_EPIANO) AudioMixer<5> master_mixer_r; AudioMixer<5> master_mixer_l; -#else -AudioMixer<4> master_mixer_r; -AudioMixer<4> master_mixer_l; -#endif AudioAmplifier volume_r; AudioAmplifier volume_l; AudioEffectStereoMono stereo2mono; @@ -132,8 +104,6 @@ AudioMixer<2> audio_thru_mixer_l; AudioPlayArrayResmp* Drum[NUM_DRUMS]; AudioMixer drum_mixer_r; AudioMixer drum_mixer_l; - -#ifdef USE_FX #if NUM_DRUMS < 5 AudioMixer<4> drum_reverb_send_mixer_r; AudioMixer<4> drum_reverb_send_mixer_l; @@ -142,12 +112,11 @@ AudioMixer<8> drum_reverb_send_mixer_r; AudioMixer<8> drum_reverb_send_mixer_l; #endif #endif -#endif // Outputs #if defined(TEENSY_AUDIO_BOARD) AudioOutputI2S i2s1; -#ifdef SGTL5000_AUDIO_ENHANCE +#if defined(SGTL5000_AUDIO_ENHANCE) AudioControlSGTL5000Plus sgtl5000; #else AudioControlSGTL5000 sgtl5000; @@ -177,20 +146,11 @@ AudioInputI2S i2s1in; // Static patching of audio objects // AudioConnection patchCord[] = { -// Audio chain tail -#if defined(USE_FX) -#ifdef USE_PLATEREVERB + // Audio chain tail { reverb_mixer_r, 0, reverb, 0 }, { reverb_mixer_l, 0, reverb, 1 }, { reverb, 0, master_mixer_r, MASTER_MIX_CH_REVERB }, { reverb, 1, master_mixer_l, MASTER_MIX_CH_REVERB }, -#else - { reverb_mixer_r, 0, freeverb, 0 }, - { reverb_mixer_l, 0, freeverb, 1 }, - { freeverb, 0, master_mixer_r, MASTER_MIX_CH_REVERB }, - { freeverb, 1, master_mixer_l, MASTER_MIX_CH_REVERB }, -#endif -#endif { master_mixer_r, volume_r }, { master_mixer_l, volume_l }, { volume_r, 0, stereo2mono, 0 }, @@ -236,21 +196,14 @@ AudioConnection patchCord[] = { #endif #if NUM_DRUMS > 0 -#ifdef USE_FX { drum_reverb_send_mixer_r, 0, reverb_mixer_r, REVERB_MIX_CH_DRUMS }, { drum_reverb_send_mixer_l, 0, reverb_mixer_l, REVERB_MIX_CH_DRUMS }, { drum_mixer_r, 0, master_mixer_r, MASTER_MIX_CH_DRUMS }, { drum_mixer_l, 0, master_mixer_l, MASTER_MIX_CH_DRUMS }, -#else - { drum_mixer_r, 0, master_mixer_r, MASTER_MIX_CH_DRUMS }, - { drum_mixer_l, 0, master_mixer_l, MASTER_MIX_CH_DRUMS }, -#endif #endif -#if defined(USE_EPIANO) { ep, 0, ep_stereo_panorama, 0 }, { ep, 1, ep_stereo_panorama, 1 }, -#if defined(USE_FX) { ep_stereo_panorama, 0, ep_chorus_mixer_r, 0 }, { ep_stereo_panorama, 1, ep_chorus_mixer_l, 0 }, { ep_stereo_panorama, 0, ep_modchorus, 0 }, @@ -267,28 +220,20 @@ AudioConnection patchCord[] = { { ep_chorus_mixer_l, 0, reverb_mixer_l, REVERB_MIX_CH_EPIANO }, { ep_chorus_mixer_r, 0, master_mixer_r, MASTER_MIX_CH_EPIANO }, { ep_chorus_mixer_l, 0, master_mixer_l, MASTER_MIX_CH_EPIANO }, -#else - { ep_stereo_panorama, 0, master_mixer_r, MASTER_MIX_CH_EPIANO }, - { ep_stereo_panorama, 1, master_mixer_l, MASTER_MIX_CH_EPIANO }, -#endif -#endif }; // // Dynamic patching of MicroDexed objects // uint8_t nDynamic = 0; -#if defined(USE_FX) && MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT +#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT AudioConnection* dynamicConnections[NUM_DEXED * 16 + NUM_DRUMS * 4]; -#elif defined(USE_FX) && MOD_FILTER_OUTPUT == MOD_NO_FILTER_OUTPUT +#elif MOD_FILTER_OUTPUT == MOD_NO_FILTER_OUTPUT AudioConnection* dynamicConnections[NUM_DEXED * 15 + NUM_DRUMS * 4]; -#else -AudioConnection* dynamicConnections[NUM_DEXED * 4 + NUM_DRUMS * 2]; #endif FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { MicroDexed[instance_id] = new AudioSynthDexed(MAX_NOTES / NUM_DEXED, SAMPLE_RATE); mono2stereo[instance_id] = new AudioEffectMonoStereo(); -#if defined(USE_FX) chorus_modulator[instance_id] = new AudioSynthWaveform(); #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT modchorus_filter[instance_id] = new AudioFilterBiquad(); @@ -302,10 +247,8 @@ FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { delay_fx[instance_id] = new AudioEffectDelay(); #endif delay_mixer[instance_id] = new AudioMixer<2>(); -#endif dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, microdexed_peak_mixer, instance_id); -#if defined(USE_FX) dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *chorus_mixer[instance_id], 0); dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *modchorus[instance_id], 0); ////////////////////// #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT @@ -323,9 +266,7 @@ FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { dynamicConnections[nDynamic++] = new AudioConnection(*delay_mixer[instance_id], 0, *mono2stereo[instance_id], 0); dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 0, reverb_mixer_r, instance_id); dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 1, reverb_mixer_l, instance_id); -#else - dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *mono2stereo[instance_id], 0); -#endif + dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 0, master_mixer_r, instance_id); dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 1, master_mixer_l, instance_id); @@ -347,10 +288,8 @@ FLASHMEM void create_audio_drum_chain(uint8_t instance_id) { dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_mixer_r, instance_id); dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_mixer_l, instance_id); -#ifdef USE_FX dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_reverb_send_mixer_r, instance_id); dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_reverb_send_mixer_l, instance_id); -#endif } #endif @@ -391,30 +330,14 @@ char g_bank_name[NUM_DEXED][BANK_NAME_LEN]; char receive_bank_filename[FILENAME_LEN]; uint8_t selected_instance_id = 0; uint8_t active_sample = 0; -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) -#if NUM_DEXED > 1 int8_t midi_decay[NUM_DEXED] = { -1, -1 }; -#else -int8_t midi_decay[NUM_DEXED] = { -1 }; -#endif elapsedMillis midi_decay_timer; -#endif - -#if NUM_DEXED > 1 int perform_attack_mod[NUM_DEXED] = { 0, 0 }; int perform_release_mod[NUM_DEXED] = { 0, 0 }; -#else -int perform_attack_mod[NUM_DEXED] = { 0 }; -int perform_release_mod[NUM_DEXED] = { 0 }; -#endif -#if defined(USE_FX) // Allocate the delay lines for chorus int16_t* delayline[NUM_DEXED]; -#ifdef USE_EPIANO int16_t* ep_delayline_r; int16_t* ep_delayline_l; -#endif -#endif #if NUM_DRUMS > 0 //extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; @@ -422,9 +345,7 @@ uint8_t drum_counter; uint8_t drum_type[NUM_DRUMS]; #endif -#ifdef ENABLE_LCD_UI extern LCDMenuLib2 LCDML; -#endif extern void getNoteName(char* noteName, uint8_t noteNumber); @@ -438,16 +359,9 @@ void setup() { delay(50); // seems to be needed when no serial debugging is enabled #endif -#ifdef ENABLE_LCD_UI setup_ui(); -#endif -#ifndef ENABLE_LCD_UI -#ifdef DEBUG - Serial.println(F("NO LCD DISPLAY ENABLED!")); -#endif -#endif -#if defined(DEBUG) && (defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)) +#if defined(DEBUG) Serial.println(F("-------------------------------------------------------------------------------")); Serial.println(F("Latest crash report:")); Serial.println(CrashReport); @@ -568,10 +482,8 @@ void setup() { drum_mixer_r.gain(instance_id, 1.0); drum_mixer_l.gain(instance_id, 1.0); -#ifdef USE_FX drum_reverb_send_mixer_r.gain(instance_id, 0.0); drum_reverb_send_mixer_l.gain(instance_id, 0.0); -#endif } // Init drumset config configuration.drums.main_vol = DRUMS_MAIN_VOL_DEFAULT; @@ -582,8 +494,6 @@ void setup() { #endif // Setup EPiano -#if defined(USE_FX) -#if defined(USE_EPIANO) // EP_CHORUS ep_delayline_r = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); if (ep_delayline_r == NULL) { @@ -625,11 +535,8 @@ void setup() { 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(EP_CHORUS_LEVEL_DEFAULT, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); ep_stereo_panorama.panorama(mapfloat(EP_PANORAMA_DEFAULT, EP_PANORAMA_MIN, EP_PANORAMA_MAX, -1.0, 1.0)); -#endif -#endif // Setup effects -#if defined(USE_FX) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { delayline[instance_id] = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); if (delayline[instance_id] != NULL) { @@ -657,7 +564,6 @@ void setup() { Serial.print(F("MOD_DELAY_SAMPLE_BUFFER=")); Serial.print(MOD_DELAY_SAMPLE_BUFFER, DEC); Serial.println(F(" samples")); -#endif #endif // Start SD card @@ -725,10 +631,8 @@ void setup() { #endif master_mixer_r.gain(MASTER_MIX_CH_REVERB, VOL_MAX_FLOAT); master_mixer_l.gain(MASTER_MIX_CH_REVERB, VOL_MAX_FLOAT); -#if defined(USE_EPIANO) master_mixer_r.gain(MASTER_MIX_CH_EPIANO, VOL_MAX_FLOAT); master_mixer_l.gain(MASTER_MIX_CH_EPIANO, VOL_MAX_FLOAT); -#endif #if NUM_DRUMS > 0 master_mixer_r.gain(MASTER_MIX_CH_DRUMS, VOL_MAX_FLOAT); master_mixer_l.gain(MASTER_MIX_CH_DRUMS, VOL_MAX_FLOAT); @@ -964,7 +868,6 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { } // E-Piano -#if defined(USE_EPIANO) if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { ep.noteOn(inNumber + configuration.epiano.transpose - 24, inVelocity); @@ -982,7 +885,6 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { #endif } } -#endif // Drums #if NUM_DRUMS > 0 @@ -1013,10 +915,9 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { drum_mixer_r.gain(slot, pan * volume_transform(mapfloat(inVelocity, 0, 127, vol_min, vol_max))); drum_mixer_l.gain(slot, (1.0 - pan) * volume_transform(mapfloat(inVelocity, 0, 127, vol_min, vol_max))); -#ifdef USE_FX drum_reverb_send_mixer_r.gain(slot, pan * volume_transform(reverb_send)); drum_reverb_send_mixer_l.gain(slot, (1.0 - pan) * volume_transform(reverb_send)); -#endif + if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) { if (configuration.drums.pitch[d] != 0) { Drum[slot]->enableInterpolation(true); @@ -1084,7 +985,6 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { } // EPiano -#if defined(USE_EPIANO) if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { ep.noteOff(inNumber + configuration.epiano.transpose - 24); @@ -1100,7 +1000,6 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { #endif } } -#endif } void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { @@ -1108,10 +1007,8 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { inValue = constrain(inValue, 0, 127); // EPiano -#if defined(USE_EPIANO) if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) ep.processMidiController(inCtrl, inValue); -#endif // Dexed for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { @@ -1229,7 +1126,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { LCDML.loop_menu(); } break; -#if defined(USE_FX) case 91: // CC 91: reverb send configuration.fx.reverb_send[selected_instance_id] = map(inValue, 0, 0x7f, REVERB_SEND_MIN, REVERB_SEND_MAX); reverb_mixer_r.gain(selected_instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); @@ -1288,7 +1184,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { LCDML.loop_menu(); } break; -#endif case 120: MicroDexed[instance_id]->panic(); break; @@ -1688,7 +1583,6 @@ void handleClock(void) { Serial.println(F("ms per quarter)")); #endif -#ifdef USE_FX /* 1 1/16 = 6 ticks / 0.0625 2 1/16T = 9 ticks / 0.09375 @@ -1713,7 +1607,6 @@ void handleClock(void) { #endif } } -#endif } _midi_bpm = midi_bpm; @@ -1929,13 +1822,11 @@ void check_configuration_fx(void) { configuration.fx.eq_6 = constrain(configuration.fx.eq_6, EQ_6_MIN, EQ_6_MAX); configuration.fx.eq_7 = constrain(configuration.fx.eq_7, EQ_7_MIN, EQ_7_MAX); -#if defined(USE_EPIANO) configuration.fx.ep_chorus_frequency = constrain(configuration.fx.ep_chorus_frequency, EP_CHORUS_FREQUENCY_MIN, EP_CHORUS_FREQUENCY_MAX); configuration.fx.ep_chorus_waveform = constrain(configuration.fx.ep_chorus_waveform, EP_CHORUS_WAVEFORM_MIN, EP_CHORUS_WAVEFORM_MAX); configuration.fx.ep_chorus_depth = constrain(configuration.fx.ep_chorus_depth, EP_CHORUS_DEPTH_MIN, EP_CHORUS_DEPTH_MAX); configuration.fx.ep_chorus_level = constrain(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX); configuration.fx.ep_reverb_send = constrain(configuration.fx.ep_reverb_send, EP_REVERB_SEND_MIN, EP_REVERB_SEND_MAX); -#endif } void check_configuration_dexed(uint8_t instance_id) { @@ -2031,13 +1922,11 @@ void init_configuration(void) { configuration.fx.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT; configuration.fx.reverb_level = REVERB_LEVEL_DEFAULT; -#if defined(USE_EPIANO) configuration.fx.ep_chorus_frequency = EP_CHORUS_FREQUENCY_DEFAULT; configuration.fx.ep_chorus_waveform = EP_CHORUS_WAVEFORM_DEFAULT; configuration.fx.ep_chorus_depth = EP_CHORUS_DEPTH_DEFAULT; configuration.fx.ep_chorus_level = EP_CHORUS_LEVEL_DEFAULT; configuration.fx.ep_reverb_send = EP_REVERB_SEND_DEFAULT; -#endif for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT; @@ -2087,7 +1976,6 @@ void init_configuration(void) { MicroDexed[instance_id]->ControllersRefresh(); } -#if defined(USE_EPIANO) configuration.epiano.decay = EP_DECAY_DEFAULT; configuration.epiano.release = EP_RELEASE_DEFAULT; configuration.epiano.hardness = EP_HARDNESS_DEFAULT; @@ -2111,7 +1999,6 @@ void init_configuration(void) { #if NUM_DRUMS > 0 configuration.drums.main_vol = DRUMS_MAIN_VOL_DEFAULT; configuration.drums.midi_channel = DRUMS_MIDI_CHANNEL_DEFAULT; -#endif #endif strlcpy(configuration.performance.name, "INIT Perf", sizeof(configuration.performance.name)); @@ -2126,7 +2013,6 @@ void eeprom_update(void) { } void set_fx_params(void) { -#if defined(USE_FX) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { // CHORUS switch (configuration.fx.chorus_waveform[instance_id]) { @@ -2181,26 +2067,17 @@ void set_fx_params(void) { } // REVERB -#ifdef USE_PLATEREVERB reverb.size(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); reverb.lowpass(mapfloat(configuration.fx.reverb_lowpass, REVERB_LOWPASS_MIN, REVERB_LOWPASS_MAX, 0.0, 1.0)); reverb.lodamp(mapfloat(configuration.fx.reverb_lodamp, REVERB_LODAMP_MIN, REVERB_LODAMP_MAX, 0.0, 1.0)); reverb.hidamp(mapfloat(configuration.fx.reverb_hidamp, REVERB_HIDAMP_MIN, REVERB_HIDAMP_MAX, 0.0, 1.0)); reverb.diffusion(mapfloat(configuration.fx.reverb_diffusion, REVERB_DIFFUSION_MIN, REVERB_DIFFUSION_MAX, 0.0, 1.0)); -#else - freeverb.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); - freeverb.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); -#endif #if NUM_DRUMS > 0 -#ifdef USE_FX reverb_mixer_r.gain(REVERB_MIX_CH_DRUMS, 1.0); // Drums Reverb-Send reverb_mixer_l.gain(REVERB_MIX_CH_DRUMS, 1.0); // Drums Reverb-Send #endif -#endif -#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_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 @@ -2234,13 +2111,10 @@ void set_fx_params(void) { 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_l.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); -#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_l.gain(MASTER_MIX_CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT))); -#endif #ifdef SGTL5000_AUDIO_ENHANCE sgtl5000.setEQFc(1, float(configuration.fx.eq_1)); sgtl5000.setEQGain(2, mapfloat(configuration.fx.eq_2, EQ_2_MIN, EQ_2_MAX, -9.9, 9.9)); @@ -2284,7 +2158,6 @@ void set_voiceconfig_params(uint8_t instance_id) { } void set_epiano_params(void) { -#if defined(USE_EPIANO) #ifdef DEBUG Serial.print(F("Setting EPiano parameters... ")); #endif @@ -2304,9 +2177,6 @@ void set_epiano_params(void) { #ifdef DEBUG Serial.println(F("done.")); #endif -#else - ; -#endif } void set_sys_params(void) { @@ -2514,16 +2384,10 @@ void generate_version_string(char* buffer, uint8_t len) { memset(buffer, 0, len); strlcat(buffer, VERSION, len); -#if defined(ARDUINO_TEENSY36) - strlcat(buffer, "-3.6", 4); -#elif defined(ARDUINO_TEENSY40) - strlcat(buffer, "-4.0", 4); -#elif defined(ARDUINO_TEENSY41) +#if defined(ARDUINO_TEENSY41) strlcat(buffer, "-4.1", 4); #endif -#if defined(USE_FX) strlcat(buffer, "FX", 2); -#endif #if defined(MAX_NOTES) strlcat(buffer, "-", 1); itoa(MAX_NOTES, tmp, 10); diff --git a/UI_FX_T4.h b/UI.h similarity index 100% rename from UI_FX_T4.h rename to UI.h diff --git a/UI.hpp b/UI.hpp index f331e8f..b67213b 100644 --- a/UI.hpp +++ b/UI.hpp @@ -22,27 +22,23 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef ENABLE_LCD_UI #pragma once +#include "config.h" #include #include -#include "config.h" -#include "disp_plus.h" -#include "synth_dexed.h" #include #include -#if defined(USE_PLATEREVERB) +#include #include -#else -#include -#endif #include -#include "drumset.h" -#if defined(USE_EPIANO) +#include "disp_plus.h" +#include "midi_devices.hpp" +#include "synth_dexed.h" #include "synth_mda_epiano.h" +#include "drumset.h" +#include "dexed_sd.h" #include -#endif #if defined(USE_DELAY_8M) #include "effect_delay_ext8.h" #endif @@ -57,7 +53,6 @@ #endif #define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar -extern bool check_sd_performance_exists(uint8_t number); extern uint8_t midi_learn_mode; extern uint8_t active_sample; @@ -66,7 +61,6 @@ extern void set_volume(uint8_t v, uint8_t m); extern bool load_sysex(uint8_t b, uint8_t v); extern void generate_version_string(char* buffer, uint8_t len); extern void _softRestart(void); -//extern float pseudo_log_curve(float value); extern float midi_volume_transform(uint8_t midi_amp); extern float volume_transform(float amp); extern uint8_t selected_instance_id; @@ -79,7 +73,6 @@ extern void eeprom_update(void); extern void get_sd_performance_name_json(uint8_t number, char* name, uint8_t len); extern bool save_sd_performance_json(uint8_t p); extern uint8_t drum_midi_channel; -//extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; uint8_t activesample = 0; #endif @@ -90,7 +83,8 @@ extern AudioControlSGTL5000Plus sgtl5000; extern AudioControlSGTL5000 sgtl5000; #endif -#if defined(USE_FX) +extern AudioSynthDexed* MicroDexed[NUM_DEXED]; + extern AudioSynthWaveform* chorus_modulator[NUM_DEXED]; extern AudioEffectModulatedDelay* modchorus[NUM_DEXED]; extern AudioMixer<2>* chorus_mixer[NUM_DEXED]; @@ -101,26 +95,13 @@ extern AudioEffectDelayExternal8* delay_fx[NUM_DEXED]; extern AudioEffectDelay* delay_fx[NUM_DEXED]; #endif extern AudioMixer<2>* delay_mixer[NUM_DEXED]; -#endif extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; extern AudioMixer<2> microdexed_peak_mixer; extern AudioAnalyzePeak microdexed_peak; -#if defined(USE_FX) -#if defined(USE_EPIANO) extern AudioSynthEPiano ep; extern AudioMixer<4> reverb_mixer_r; extern AudioMixer<4> reverb_mixer_l; -#else -extern AudioMixer<3> reverb_mixer_r; -extern AudioMixer<3> reverb_mixer_l; -#endif -#if defined(USE_PLATEREVERB) extern AudioEffectPlateReverb reverb; -#else -extern AudioEffectFreeverbStereoFloat freeverb; -#endif -#endif -#if defined(USE_FX) && defined(USE_EPIANO) extern AudioEffectStereoPanorama ep_stereo_panorama; extern AudioSynthWaveform ep_chorus_modulator; #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT @@ -135,15 +116,8 @@ extern AudioEffectDelay ep_delay_fx_r; extern AudioEffectDelay ep_delay_fx_l; extern AudioMixer<2> ep_delay_mixer_r; extern AudioMixer<2> ep_delay_mixer_l; -#endif - -#if defined(USE_EPIANO) extern AudioMixer<5> master_mixer_r; extern AudioMixer<5> master_mixer_l; -#else -extern AudioMixer<4> master_mixer_r; -extern AudioMixer<4> master_mixer_l; -#endif extern AudioEffectStereoMono stereo2mono; extern AudioAnalyzePeak master_peak_r; extern AudioAnalyzePeak master_peak_l; @@ -250,7 +224,6 @@ enum { MENU_VOICE_BANK, void lcdml_menu_display(void); void lcdml_menu_clear(void); void lcdml_menu_control(void); -#ifdef USE_FX void UI_func_reverb_roomsize(uint8_t param); void UI_func_reverb_damping(uint8_t param); void UI_func_reverb_lowpass(uint8_t param); @@ -269,7 +242,6 @@ void UI_func_reverb_send(uint8_t param); void UI_func_filter_cutoff(uint8_t param); void UI_func_filter_resonance(uint8_t param); void UI_func_drum_reverb_send(uint8_t param); -#endif void UI_func_transpose(uint8_t param); void UI_func_tune(uint8_t param); void UI_func_midi_channel(uint8_t param); @@ -383,15 +355,7 @@ char* strip_extension(char* filename); LCDMenuLib2_menu LCDML_0(255, 0, 0, NULL, NULL); // normal root menu element (do not change) LCDMenuLib2 LCDML(LCDML_0, _LCDML_DISP_rows, _LCDML_DISP_cols, lcdml_menu_display, lcdml_menu_clear, lcdml_menu_control); -#if defined(USE_FX) -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) -#include "UI_FX_T4.h" -#else -#include "UI_FX_T3_6.h" -#endif -#else -#include "UI_NO_FX.h" -#endif +#include "UI.h" int favsearcher = 0; @@ -936,7 +900,6 @@ void lcdml_menu_display(void) { MENU ***********************************************************************/ -#ifdef USE_FX void UI_func_reverb_roomsize(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { @@ -956,11 +919,7 @@ void UI_func_reverb_roomsize(uint8_t param) { } display_bar_int("Reverb Room", configuration.fx.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false); -#ifdef USE_PLATEREVERB reverb.size(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); -#else - freeverb.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -970,37 +929,6 @@ void UI_func_reverb_roomsize(uint8_t param) { } } -#if USE_PLATEREVERB != 1 -void UI_func_reverb_damping(uint8_t param) { - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - - lcd_special_chars(BLOCKBAR); - display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, true); - } - - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { - if (LCDML.BT_checkDown()) - configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); - else if (LCDML.BT_checkUp()) - configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); - } - - display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false); - - freeverb.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); - } - - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - lcd_special_chars(SCROLLBAR); - encoderDir[ENC_R].reset(); - } -} -#else void UI_func_reverb_lowpass(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { @@ -1120,7 +1048,6 @@ void UI_func_reverb_diffusion(uint8_t param) { encoderDir[ENC_R].reset(); } } -#endif // PLATEREVERB != 1 void UI_func_reverb_level(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -1619,7 +1546,6 @@ void UI_func_filter_resonance(uint8_t param) { encoderDir[ENC_R].reset(); } } -#endif void UI_func_transpose(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -2126,12 +2052,7 @@ void UI_func_epiano_sound_intensity(uint8_t param) { encoderDir[ENC_R].reset(); lcd_special_chars(BLOCKBAR); -#if defined(USE_EPIANO) display_bar_int("EP Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, true); -#else - display.clear(); - display.print("EP Disabled"); -#endif } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2149,9 +2070,7 @@ void UI_func_epiano_sound_intensity(uint8_t param) { } display_bar_int("EP Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setVolume(mapfloat(configuration.epiano.sound_intensity, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2190,9 +2109,7 @@ void UI_func_epiano_panorama(uint8_t param) { if (configuration.sys.mono == 0) { display_meter_float("EP Panorama", configuration.epiano.pan, 0.05, -20.0, EP_PANORAMA_MIN, EP_PANORAMA_MAX, 1, 1, false, true, false); -#if defined(USE_EPIANO) ep_stereo_panorama.panorama(mapfloat(configuration.epiano.pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); -#endif } } @@ -2225,9 +2142,7 @@ void UI_func_epiano_decay(uint8_t param) { } display_bar_int("EP Decay", configuration.epiano.decay, 1.0, EP_DECAY_MIN, EP_DECAY_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setDecay(mapfloat(configuration.epiano.decay, EP_DECAY_MIN, EP_DECAY_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2259,9 +2174,7 @@ void UI_func_epiano_release(uint8_t param) { } display_bar_int("EP Release", configuration.epiano.release, 1.0, EP_RELEASE_MIN, EP_RELEASE_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setRelease(mapfloat(configuration.epiano.release, EP_RELEASE_MIN, EP_RELEASE_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2293,9 +2206,7 @@ void UI_func_epiano_hardness(uint8_t param) { } display_bar_int("EP Hardness", configuration.epiano.hardness, 1.0, EP_HARDNESS_MIN, EP_HARDNESS_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setHardness(mapfloat(configuration.epiano.hardness, EP_HARDNESS_MIN, EP_HARDNESS_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2327,9 +2238,7 @@ void UI_func_epiano_treble(uint8_t param) { } display_bar_int("EP Treble", configuration.epiano.treble, 1.0, EP_TREBLE_MIN, EP_TREBLE_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setTreble(mapfloat(configuration.epiano.treble, EP_TREBLE_MIN, EP_TREBLE_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2361,9 +2270,7 @@ void UI_func_epiano_stereo(uint8_t param) { } display_bar_int("EP Stereo", configuration.epiano.stereo, 1.0, EP_STEREO_MIN, EP_STEREO_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setStereo(mapfloat(configuration.epiano.stereo, EP_STEREO_MIN, EP_STEREO_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2395,9 +2302,7 @@ void UI_func_epiano_tune(uint8_t param) { } display_meter_int("EP Tune", configuration.epiano.tune, 1.0, -100.0, EP_TUNE_MIN, EP_TUNE_MAX, 3, false, true, false); -#if defined(USE_EPIANO) ep.setTune(mapfloat(configuration.epiano.tune, EP_TUNE_MIN, EP_TUNE_MAX, 0.0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2429,9 +2334,7 @@ void UI_func_epiano_detune(uint8_t param) { } display_bar_int("EP Detune", configuration.epiano.detune, 1.0, EP_DETUNE_MIN, EP_DETUNE_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setDetune(mapfloat(configuration.epiano.detune, EP_DETUNE_MIN, EP_DETUNE_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2463,12 +2366,10 @@ void UI_func_epiano_pan_tremolo(uint8_t param) { } display_bar_int("EP Trem. Width", configuration.epiano.pan_tremolo, 1.0, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 3, false, false, false); -#if defined(USE_EPIANO) if (configuration.epiano.pan_tremolo == 0) ep.setPanTremolo(0.0); else ep.setPanTremolo(mapfloat(configuration.epiano.pan_tremolo, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 0.0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2500,12 +2401,10 @@ void UI_func_epiano_pan_lfo(uint8_t param) { } display_bar_int("EP LFO", configuration.epiano.pan_lfo, 1.0, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 3, false, false, false); -#if defined(USE_EPIANO) if (configuration.epiano.pan_lfo == 0) ep.setPanLFO(0.0); else ep.setPanLFO(mapfloat(configuration.epiano.pan_lfo, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 0.0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2537,9 +2436,7 @@ void UI_func_epiano_overdrive(uint8_t param) { } display_bar_int("EP Overdrive", configuration.epiano.overdrive, 1.0, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setOverdrive(mapfloat(configuration.epiano.overdrive, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2601,9 +2498,7 @@ void UI_func_epiano_polyphony(uint8_t param) { } display_bar_int("EP Polyphony", configuration.epiano.polyphony, 1.0, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX, 2, false, false, false); -#if defined(USE_EPIANO) ep.setPolyphony(configuration.epiano.polyphony); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2635,9 +2530,7 @@ void UI_func_epiano_velocity_sense(uint8_t param) { } display_bar_int("EP Vel. Sense", configuration.epiano.velocity_sense, 1.0, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep.setVelocitySense(mapfloat(configuration.epiano.velocity_sense, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX, 0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2699,9 +2592,7 @@ void UI_func_epiano_chorus_frequency(uint8_t param) { configuration.fx.ep_chorus_frequency = constrain(configuration.fx.ep_chorus_frequency - ENCODER[ENC_R].speed(), EP_CHORUS_FREQUENCY_MIN, EP_CHORUS_FREQUENCY_MAX); } display_bar_float("EP Chorus Frq.", configuration.fx.ep_chorus_frequency, 0.1, EP_CHORUS_FREQUENCY_MIN, EP_CHORUS_FREQUENCY_MAX, 2, 1, false, false, false); -#if defined(USE_EPIANO) ep_chorus_modulator.frequency(configuration.fx.ep_chorus_frequency / 10.0); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2730,21 +2621,15 @@ void UI_func_epiano_chorus_waveform(uint8_t param) { display.setCursor(0, 1); switch (configuration.fx.ep_chorus_waveform) { case 0: -#if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); -#endif display.print(F("[TRIANGLE]")); break; case 1: -#if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_SINE); -#endif display.print(F("[SINE ]")); break; default: -#if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); -#endif display.print(F("[TRIANGLE]")); break; } @@ -2776,9 +2661,7 @@ void UI_func_epiano_chorus_depth(uint8_t param) { } display_bar_int("EP Ch. Depth", configuration.fx.ep_chorus_depth, 1.0, EP_CHORUS_DEPTH_MIN, EP_CHORUS_DEPTH_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep_chorus_modulator.amplitude(mapfloat(configuration.fx.ep_chorus_depth, EP_CHORUS_DEPTH_MIN, EP_CHORUS_DEPTH_MAX, 0.0, 1.0)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2810,12 +2693,8 @@ void UI_func_epiano_chorus_level(uint8_t param) { } display_bar_int("EP Ch. Level", configuration.fx.ep_chorus_level, 1.0, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 3, false, false, false); -#if defined(USE_EPIANO) ep_chorus_mixer_l.gain(0, 1.0 - mapfloat(configuration.fx.chorus_level[selected_instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5)); ep_chorus_mixer_r.gain(0, 1.0 - mapfloat(configuration.fx.chorus_level[selected_instance_id], CHORUS_LEVEL_MIN, 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_r.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); -#endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -6596,7 +6475,6 @@ void lcd_special_chars(uint8_t mode) { } } -#ifdef USE_FX void lcd_display_delay_sync(uint8_t sync) { display.show(0, 0, LCD_cols - 2, "Delay Sync"); display.show(1, 0, 10, "MIDI Sync "); @@ -6643,7 +6521,6 @@ void lcd_display_delay_sync(uint8_t sync) { } display.show(1, 15, 1, "!"); } -#endif void string_trim(char* s) { int i; @@ -6981,6 +6858,4 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) { char* basename(const char* filename) { char* p = strrchr(filename, '/'); return p ? p + 1 : (char*)filename; -} - -#endif //ENABLE_LCD_UI +} \ No newline at end of file diff --git a/UI_FX_T3_6.h b/UI_FX_T3_6.h deleted file mode 100644 index 5faa881..0000000 --- a/UI_FX_T3_6.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - MicroDexed - - MicroDexed is a port of the Dexed sound engine - (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield. - Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android - - (c)2018-2023 H. Wirtz - (c)2021-2022 H. Wirtz , M. Koslowski - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#pragma once - -boolean COND_hide() // hide a menu element -{ - return false; -} - -LCDML_add(0, LCDML_0, 1, "Voice", NULL); -LCDML_add(1, LCDML_0_1, 1, "Select", UI_func_voice_select); -LCDML_add(2, LCDML_0_1, 2, "Audio", NULL); -LCDML_add(3, LCDML_0_1_2, 1, "Voice Level", UI_func_sound_intensity); -LCDML_add(4, LCDML_0_1_2, 2, "Panorama", UI_func_panorama); -LCDML_add(5, LCDML_0_1_2, 3, "Effects", NULL); -LCDML_add(6, LCDML_0_1_2_3, 1, "Chorus", NULL); -LCDML_add(7, LCDML_0_1_2_3_1, 1, "Frequency", UI_func_chorus_frequency); -LCDML_add(8, LCDML_0_1_2_3_1, 2, "Waveform", UI_func_chorus_waveform); -LCDML_add(9, LCDML_0_1_2_3_1, 3, "Depth", UI_func_chorus_depth); -LCDML_add(10, LCDML_0_1_2_3_1, 4, "Level", UI_func_chorus_level); -LCDML_add(11, LCDML_0_1_2_3, 2, "Delay", NULL); -LCDML_add(12, LCDML_0_1_2_3_2, 1, "Time", UI_func_delay_time); -LCDML_add(13, LCDML_0_1_2_3_2, 2, "Feedback", UI_func_delay_feedback); -LCDML_add(14, LCDML_0_1_2_3_2, 3, "Level", UI_func_delay_level); -LCDML_add(15, LCDML_0_1_2_3, 3, "Filter", NULL); -LCDML_add(16, LCDML_0_1_2_3_3, 1, "Cutoff", UI_func_filter_cutoff); -LCDML_add(17, LCDML_0_1_2_3_3, 2, "Resonance", UI_func_filter_resonance); -LCDML_add(18, LCDML_0_1_2_3, 4, "Reverb", NULL); -LCDML_add(19, LCDML_0_1_2_3_4, 1, "Roomsize", UI_func_reverb_roomsize); -LCDML_add(20, LCDML_0_1_2_3_4, 2, "Damping", UI_func_reverb_damping); -LCDML_add(21, LCDML_0_1_2_3_4, 3, "Level", UI_func_reverb_level); -LCDML_add(22, LCDML_0_1_2_3_4, 4, "Reverb Send", UI_func_reverb_send); -LCDML_add(23, LCDML_0_1_2_3, 5, "EQ", NULL); -LCDML_add(24, LCDML_0_1_2_3_5, 1, "Low-Cut", UI_func_eq_1); -LCDML_add(25, LCDML_0_1_2_3_5, 2, "120Hz", UI_func_eq_2); -LCDML_add(26, LCDML_0_1_2_3_5, 3, "220Hz", UI_func_eq_3); -LCDML_add(27, LCDML_0_1_2_3_5, 4, "1000Hz", UI_func_eq_4); -LCDML_add(28, LCDML_0_1_2_3_5, 5, "2000Hz", UI_func_eq_5); -LCDML_add(29, LCDML_0_1_2_3_5, 6, "7000Hz", UI_func_eq_6); -LCDML_add(30, LCDML_0_1_2_3_5, 7, "High-Cut", UI_func_eq_7); -LCDML_add(31, LCDML_0_1, 3, "Controller", NULL); -LCDML_add(32, LCDML_0_1_3, 1, "Pitchbend", NULL); -LCDML_add(33, LCDML_0_1_3_1, 1, "PB Range", UI_func_pb_range); -LCDML_add(34, LCDML_0_1_3_1, 2, "PB Step", UI_func_pb_step); -LCDML_add(35, LCDML_0_1_3, 2, "Mod Wheel", NULL); -LCDML_add(36, LCDML_0_1_3_2, 1, "MW Range", UI_func_mw_range); -LCDML_add(37, LCDML_0_1_3_2, 2, "MW Assign", UI_func_mw_assign); -LCDML_add(38, LCDML_0_1_3_2, 3, "MW Mode", UI_func_mw_mode); -LCDML_add(39, LCDML_0_1_3, 3, "Aftertouch", NULL); -LCDML_add(40, LCDML_0_1_3_3, 1, "AT Range", UI_func_at_range); -LCDML_add(41, LCDML_0_1_3_3, 2, "AT Assign", UI_func_at_assign); -LCDML_add(42, LCDML_0_1_3_3, 3, "AT Mode", UI_func_at_mode); -LCDML_add(43, LCDML_0_1_3, 4, "Foot Ctrl", NULL); -LCDML_add(44, LCDML_0_1_3_4, 1, "FC Range", UI_func_fc_range); -LCDML_add(45, LCDML_0_1_3_4, 2, "FC Assign", UI_func_fc_assign); -LCDML_add(46, LCDML_0_1_3_4, 3, "FC Mode", UI_func_fc_mode); -LCDML_add(47, LCDML_0_1_3, 5, "Breath Ctrl", NULL); -LCDML_add(48, LCDML_0_1_3_5, 1, "BC Range", UI_func_bc_range); -LCDML_add(49, LCDML_0_1_3_5, 2, "BC Assign", UI_func_bc_assign); -LCDML_add(50, LCDML_0_1_3_5, 3, "BC Mode", UI_func_bc_mode); -LCDML_add(51, LCDML_0_1, 4, "MIDI", NULL); -LCDML_add(52, LCDML_0_1_4, 1, "MIDI Channel", UI_func_midi_channel); -LCDML_add(53, LCDML_0_1_4, 2, "Lowest Note", UI_func_lowest_note); -LCDML_add(54, LCDML_0_1_4, 3, "Highest Note", UI_func_highest_note); -LCDML_add(55, LCDML_0_1_4, 4, "MIDI Send Voice", UI_func_sysex_send_voice); -LCDML_add(56, LCDML_0_1, 5, "Setup", NULL); -LCDML_add(57, LCDML_0_1_5, 1, "Portamento", NULL); -LCDML_add(58, LCDML_0_1_5_1, 1, "Port. Mode", UI_func_portamento_mode); -LCDML_add(59, LCDML_0_1_5_1, 2, "Port. Gliss", UI_func_portamento_glissando); -LCDML_add(60, LCDML_0_1_5_1, 3, "Port. Time", UI_func_portamento_time); -LCDML_add(61, LCDML_0_1_5, 2, "Polyphony", UI_func_polyphony); -LCDML_add(62, LCDML_0_1_5, 3, "Transpose", UI_func_transpose); -LCDML_add(63, LCDML_0_1_5, 4, "Fine Tune", UI_func_tune); -LCDML_add(64, LCDML_0_1_5, 5, "Mono/Poly", UI_func_mono_poly); -LCDML_add(65, LCDML_0_1, 6, "Internal", NULL); -LCDML_add(66, LCDML_0_1_6, 1, "Note Refresh", UI_func_note_refresh); -LCDML_add(67, LCDML_0_1_6, 2, "Velocity Lvl", UI_func_velocity_level); -LCDML_add(68, LCDML_0_1, 7, "Operator", UI_handle_OP); -LCDML_add(69, LCDML_0_1, 8, "Save Voice", UI_func_save_voice); -LCDML_add(70, LCDML_0, 3, "Load/Save", NULL); -LCDML_add(71, LCDML_0_3, 1, "Load Perf.", UI_func_load_performance); -LCDML_add(72, LCDML_0_3, 2, "Save Perf.", UI_func_save_performance); -LCDML_add(73, LCDML_0_3, 3, "Name Perf.", UI_func_set_performance_name); -LCDML_add(74, LCDML_0_3, 4, "MIDI", NULL); -LCDML_add(75, LCDML_0_3_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); -LCDML_add(76, LCDML_0_3_4, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); -LCDML_add(77, LCDML_0_3_4, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); -LCDML_add(78, LCDML_0, 4, "Drums", NULL); -LCDML_add(79, LCDML_0_4, 1, "Drums Main Vol", UI_func_drums_main_volume); -LCDML_add(80, LCDML_0_4, 2, "Drum Volumes", UI_func_drum_volume); -LCDML_add(81, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan); -LCDML_add(82, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); -LCDML_add(83, LCDML_0_4, 5, "MIDI Channel", UI_func_drum_midi_channel); -LCDML_add(84, LCDML_0, 5, "System", NULL); -LCDML_add(85, LCDML_0_5, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(86, LCDML_0_5, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(87, LCDML_0_5, 3, "Favorites", UI_func_favorites); -LCDML_add(88, LCDML_0_5, 4, "Startup", UI_func_startup); -LCDML_add(89, LCDML_0, 6, "Info", UI_func_information); -LCDML_addAdvanced(90, LCDML_0, 7, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 90 diff --git a/UI_NO_FX.h b/UI_NO_FX.h deleted file mode 100644 index 3e58cfd..0000000 --- a/UI_NO_FX.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - MicroDexed - - MicroDexed is a port of the Dexed sound engine - (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield. - Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android - - (c)2018-2023 H. Wirtz - (c)2021-2022 H. Wirtz , M. Koslowski - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#pragma once - -boolean COND_hide() // hide a menu element -{ - return false; -} - -LCDML_add(0, LCDML_0, 1, "Voice", NULL); -LCDML_add(1, LCDML_0_1, 1, "Select", UI_func_voice_select); -LCDML_add(2, LCDML_0_1, 2, "Audio", NULL); -LCDML_add(3, LCDML_0_1_2, 1, "Voice Level", UI_func_sound_intensity); -LCDML_add(4, LCDML_0_1_2, 2, "Panorama", UI_func_panorama); -LCDML_add(5, LCDML_0_1, 3, "Controller", NULL); -LCDML_add(6, LCDML_0_1_3, 1, "Pitchbend", NULL); -LCDML_add(7, LCDML_0_1_3_1, 1, "PB Range", UI_func_pb_range); -LCDML_add(8, LCDML_0_1_3_1, 2, "PB Step", UI_func_pb_step); -LCDML_add(9, LCDML_0_1_3, 2, "Mod Wheel", NULL); -LCDML_add(10, LCDML_0_1_3_2, 1, "MW Range", UI_func_mw_range); -LCDML_add(11, LCDML_0_1_3_2, 2, "MW Assign", UI_func_mw_assign); -LCDML_add(12, LCDML_0_1_3_2, 3, "MW Mode", UI_func_mw_mode); -LCDML_add(13, LCDML_0_1_3, 3, "Aftertouch", NULL); -LCDML_add(14, LCDML_0_1_3_3, 1, "AT Range", UI_func_at_range); -LCDML_add(15, LCDML_0_1_3_3, 2, "AT Assign", UI_func_at_assign); -LCDML_add(16, LCDML_0_1_3_3, 3, "AT Mode", UI_func_at_mode); -LCDML_add(17, LCDML_0_1_3, 4, "Foot Ctrl", NULL); -LCDML_add(18, LCDML_0_1_3_4, 1, "FC Range", UI_func_fc_range); -LCDML_add(19, LCDML_0_1_3_4, 2, "FC Assign", UI_func_fc_assign); -LCDML_add(20, LCDML_0_1_3_4, 3, "FC Mode", UI_func_fc_mode); -LCDML_add(21, LCDML_0_1_3, 5, "Breath Ctrl", NULL); -LCDML_add(22, LCDML_0_1_3_5, 1, "BC Range", UI_func_bc_range); -LCDML_add(23, LCDML_0_1_3_5, 2, "BC Assign", UI_func_bc_assign); -LCDML_add(24, LCDML_0_1_3_5, 3, "BC Mode", UI_func_bc_mode); -LCDML_add(25, LCDML_0_1, 4, "MIDI", NULL); -LCDML_add(26, LCDML_0_1_4, 1, "MIDI Channel", UI_func_midi_channel); -LCDML_add(27, LCDML_0_1_4, 2, "Lowest Note", UI_func_lowest_note); -LCDML_add(28, LCDML_0_1_4, 3, "Highest Note", UI_func_highest_note); -LCDML_add(29, LCDML_0_1_4, 4, "Send Voice", UI_func_sysex_send_voice); -LCDML_add(30, LCDML_0_1, 5, "Setup", NULL); -LCDML_add(31, LCDML_0_1_5, 1, "Portamento", NULL); -LCDML_add(32, LCDML_0_1_5_1, 1, "Port. Mode", UI_func_portamento_mode); -LCDML_add(33, LCDML_0_1_5_1, 2, "Port. Gliss", UI_func_portamento_glissando); -LCDML_add(34, LCDML_0_1_5_1, 3, "Port. Time", UI_func_portamento_time); -LCDML_add(35, LCDML_0_1_5, 2, "Polyphony", UI_func_polyphony); -LCDML_add(36, LCDML_0_1_5, 3, "Transpose", UI_func_transpose); -LCDML_add(37, LCDML_0_1_5, 4, "Fine Tune", UI_func_tune); -LCDML_add(38, LCDML_0_1_5, 5, "Mono/Poly", UI_func_mono_poly); -LCDML_add(39, LCDML_0_1, 6, "Internal", NULL); -LCDML_add(40, LCDML_0_1_6, 1, "Note Refresh", UI_func_note_refresh); -LCDML_add(41, LCDML_0_1_6, 2, "Velocity Lvl", UI_func_velocity_level); -LCDML_add(42, LCDML_0_1, 7, "Operator", UI_handle_OP); -LCDML_add(43, LCDML_0_1, 8, "Save Voice", UI_func_save_voice); -LCDML_add(44, LCDML_0, 2, "Load/Save", NULL); -LCDML_add(45, LCDML_0_2, 1, "Load Perf.", UI_func_load_performance); -LCDML_add(46, LCDML_0_2, 2, "Save Perf.", UI_func_save_performance); -LCDML_add(47, LCDML_0_2, 3, "Name Perf.", UI_func_set_performance_name); -LCDML_add(48, LCDML_0_2, 4, "MIDI", NULL); -LCDML_add(49, LCDML_0_2_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); -LCDML_add(50, LCDML_0_2_4, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); -LCDML_add(51, LCDML_0_2_4, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); -LCDML_add(52, LCDML_0, 3, "Drums", NULL); -LCDML_add(53, LCDML_0_3, 1, "Drums Main Vol", UI_func_drums_main_volume); -LCDML_add(54, LCDML_0_3, 2, "Drum Volumes", UI_func_drum_volume); -LCDML_add(55, LCDML_0_3, 3, "Drum Pan", UI_func_drum_pan); -LCDML_add(56, LCDML_0_3, 4, "MIDI Channel", UI_func_drum_midi_channel); -LCDML_add(57, LCDML_0, 4, "System", NULL); -LCDML_add(58, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(59, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(60, LCDML_0_4, 3, "Favorites", UI_func_favorites); -LCDML_add(61, LCDML_0_4, 4, "Startup", UI_func_startup); -LCDML_add(62, LCDML_0, 5, "Info", UI_func_information); -LCDML_addAdvanced(63, LCDML_0, 6, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 63 diff --git a/config.h b/config.h index 7efa16f..0a3a6d4 100644 --- a/config.h +++ b/config.h @@ -26,6 +26,10 @@ #pragma once +#ifndef ARDUINO_TEENSY41 +#error This version 1.2.7 the code does only work for Teensy-4.1 with enabled FX. It was to difficult to support all other flavors of the Teensy universe in one code base. +#endif + #include #include "midinotes.h" @@ -56,7 +60,7 @@ // // Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html -#define VERSION "1.2.6" +#define VERSION "1.2.7" //************************************************************************************************* //* DEVICE SETTINGS @@ -102,38 +106,17 @@ //* DEXED, EPIANO AND EFFECTS SETTINGS //************************************************************************************************* // Number of Dexed instances -#if defined(ARDUINO_TEENSY36) -#warning>>> Sorry, only one instance possible for Teensy-3.6 -#define NUM_DEXED 1 // 1 or 2 - nothing else! -#else #define NUM_DEXED 2 // 1 or 2 - nothing else! -#endif - -// FX-CHAIN ENABLE/DISABLE -#define USE_FX 1 // NUMBER OF PARALLEL SAMPLEDRUMS -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) #define NUM_DRUMS 8 -#else -#define NUM_DRUMS 4 -#endif // NUMBER OF SAMPLES IN DRUMSET -#if defined(ARDUINO_TEENSY41) #define NUM_DRUMSET_CONFIG 64 -#elif defined(ARDUINO_TEENSY40) -#define NUM_DRUMSET_CONFIG 47 -#else -#define NUM_DRUMSET_CONFIG 19 -#endif // EPIANO -#define USE_EPIANO -#ifdef USE_EPIANO #define NUM_EPIANO_VOICES 16 #define DEFAULT_EP_MIDI_CHANNEL 3 -#endif // CHORUS parameters #define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(15.0)) // 15.0 ms delay buffer. @@ -147,36 +130,13 @@ //#define SGTL5000_AUDIO_THRU 1 #define SGTL5000_HEADPHONE_VOLUME 0.8 #endif -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) -#define USE_PLATEREVERB 1 -#else -#define USE_FREEVERB_FP -#endif // DELAYTIME #define USE_DELAY_8M 1 -#if NUM_DEXED > 1 -#if defined(ARDUINO_TEENSY41) -#define DELAY_MAX_TIME 500 -#elif defined(ARDUINO_TEENSY41) #if defined(USE_DELAY_8M) #define DELAY_MAX_TIME 5000 #else -#define DELAY_MAX_TIME 250 -#endif -#else -#define DELAY_MAX_TIME 100 -#endif -#else -#if defined(ARDUINO_TEENSY36) -#define DELAY_MAX_TIME 400 -#elif defined(ARDUINO_TEENSY41) -#define DELAY_MAX_TIME 1000 -#elif defined(ARDUINO_TEENSY41) #define DELAY_MAX_TIME 500 -#else -#define DELAY_MAX_TIME 200 -#endif #endif //************************************************************************************************* @@ -184,18 +144,10 @@ //************************************************************************************************* #define SAMPLE_RATE 44100 -#ifdef USE_FX -#if defined(USE_EPIANO) -#define AUDIO_MEM SAMPLE_RATE* NUM_DEXED* DELAY_MAX_TIME / 128000 + 36 + 14 +#ifdef USE_DELAY_8M +#define AUDIO_MEM 36 + 14 // Delay in EXTMEM #else -#define AUDIO_MEM SAMPLE_RATE* NUM_DEXED* DELAY_MAX_TIME / 128000 + 36 -#endif -#else -#if defined(USE_EPIANO) -#define AUDIO_MEM NUM_DEXED * 15 + 14 -#else -#define AUDIO_MEM NUM_DEXED * 15 -#endif +#define AUDIO_MEM 36 + 14 +SAMPLE_RATE* NUM_DEXED* DELAY_MAX_TIME / 128000 // Delay in AUDIO_MEM #endif #ifdef TEENSY_AUDIO_BOARD @@ -226,7 +178,6 @@ //************************************************************************************************* //* UI //************************************************************************************************* -#define ENABLE_LCD_UI 1 #define STANDARD_LCD_I2C //#define OLED_SPI @@ -271,7 +222,7 @@ #define SDCARD_AUDIO_CS_PIN 10 #define SDCARD_AUDIO_MOSI_PIN 7 #define SDCARD_AUDIO_SCK_PIN 14 -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY36) // new detection logic to also find on board SD Card from Teensy 4.1 +#if defined(ARDUINO_TEENSY41) // Teensy 3.6 & 4.1 internal SD card #define SDCARD_TEENSY_CS_PIN BUILTIN_SDCARD #define SDCARD_TEENSY_MOSI_PIN 11 @@ -288,19 +239,9 @@ #define ENC_L_PIN_A 3 #define ENC_L_PIN_B 2 #define BUT_L_PIN 4 -#if defined(ARDUINO_TEENSY36) -#define ENC_R_PIN_A 28 -#define ENC_R_PIN_B 29 -#define BUT_R_PIN 30 -#elif defined(ARDUINO_TEENSY40) -#define ENC_R_PIN_A 6 -#define ENC_R_PIN_B 5 -#define BUT_R_PIN 8 -#else // ARDUINO_ARDUINO_TEENSY41 #define ENC_R_PIN_A 24 #define ENC_R_PIN_B 5 #define BUT_R_PIN 9 -#endif #define BUT_DEBOUNCE_MS 20 #define LONG_BUTTON_PRESS 500 @@ -350,45 +291,8 @@ #endif // MAX_NOTES SETTINGS -// Teensy-4.x settings -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) #define MAX_NOTES 32 #define MIDI_DECAY_LEVEL_TIME 500 -#endif - -// Teensy-3.6 settings -#if defined(ARDUINO_TEENSY36) -#if defined(USE_FX) -#warning>>> With enabled FX a maximum of 12 voices is possible (due to RAM and CPU limitations) -#define MAX_NOTES 12 -#if F_CPU > 180000000 -#error>>> Enabled FX with clockrate more than 180MHz is not useful due to RAM limitations. -#endif -#else -#if F_CPU == 256000000 -#warning>>> Maximum of 22 voices. -#define MAX_NOTES 22 -#elif F_CPU == 240000000 -#warning>>> Maximum of 20 voices. You should consider to use 256MHz overclocking to get a maximum of 22 voices. -#define MAX_NOTES 20 -#elif F_CPU == 216000000 -#warning>>> Maximum of 18 voices. You should consider to use 256MHz overclocking to get a maximum of 22 voices. -#define MAX_NOTES 18 -#elif F_CPU == 192000000 -#warning>>> Maximum of 16 voices. You should consider to use 256MHz overclocking to get a maximum of 22 voices. -#define MAX_NOTES 16 -#elif F_CPU == 180000000 -#warning>>> Maximum of 14 voices. You should consider to use 256MHz overclocking to get a maximum of 22 voices. -#define MAX_NOTES 14 -#else -#error>>> CPU Clock below 180MHz is not supported -#endif -#endif -#endif - -#if defined(ARDUINO_TEENSY35) -#error>>> Not supported anymore!!! -#endif // MIDI #ifdef MIDI_DEVICE_USB @@ -742,13 +646,8 @@ #define EP_STEREO_DEFAULT 50 #define EP_POLYPHONY_MIN 0 -#if defined(USE_EPIANO) #define EP_POLYPHONY_MAX NUM_EPIANO_VOICES #define EP_POLYPHONY_DEFAULT NUM_EPIANO_VOICES -#else -#define EP_POLYPHONY_MAX 16 -#define EP_POLYPHONY_DEFAULT 16 -#endif #define EP_TUNE_MIN 1 #define EP_TUNE_MAX 199 @@ -788,11 +687,7 @@ #define EP_MIDI_CHANNEL_MIN MIDI_CHANNEL_OMNI #define EP_MIDI_CHANNEL_MAX 16 -#if defined(USE_EPIANO) #define EP_MIDI_CHANNEL_DEFAULT DEFAULT_EP_MIDI_CHANNEL -#else -#define EP_MIDI_CHANNEL_DEFAULT 3 -#endif #define FAVORITES_NUM_MIN 0 #define FAVORITES_NUM_MAX 100 diff --git a/dexed_sd.h b/dexed_sd.h index c7b13dd..20ed64e 100644 --- a/dexed_sd.h +++ b/dexed_sd.h @@ -68,6 +68,7 @@ bool load_sd_drumsettings_json(uint8_t number); bool save_sd_drumsettings_json(uint8_t number); bool check_performance_directory(uint8_t seq_number); +bool check_sd_performance_exists(uint8_t number); bool get_sd_data(File sysex, uint8_t format, uint8_t* conf); bool write_sd_data(File sysex, uint8_t format, uint8_t* data, uint16_t len); diff --git a/effect_delay_ext8.h b/effect_delay_ext8.h index 9dd1ec7..947cd7e 100644 --- a/effect_delay_ext8.h +++ b/effect_delay_ext8.h @@ -24,8 +24,8 @@ */ -#ifndef effect_delay_ext8_h_ -#define effect_delay_ext8_h_ +#pragma once + #include "Arduino.h" #include "AudioStream.h" #include "spi_interrupt.h" @@ -76,5 +76,3 @@ private: static uint32_t allocated; audio_block_t *inputQueueArray[1]; }; - -#endif