@ -31,19 +31,15 @@
# include <SD.h>
# include <SD.h>
# include <SPI.h>
# include <SPI.h>
# include <TeensyVariablePlayback.h>
# include <TeensyVariablePlayback.h>
# include "UI.hpp"
# include "midi_devices.hpp"
# include "midi_devices.hpp"
# include "synth_dexed.h"
# include "synth_dexed.h"
# include "dexed_sd.h"
# include "dexed_sd.h"
# include <effect_modulated_delay.h>
# include <effect_modulated_delay.h>
# include <effect_stereo_mono.h>
# include <effect_stereo_mono.h>
# include <effect_mono_stereo.h>
# include <effect_mono_stereo.h>
# if defined(USE_PLATEREVERB)
# include <effect_platervbstereo.h>
# include <effect_platervbstereo.h>
# else
# include <effect_freeverbf.h>
# endif
# include <template_mixer.hpp>
# include <template_mixer.hpp>
# include "UI.hpp"
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
# include "midinotes.h"
# include "midinotes.h"
# include "drumset.h"
# include "drumset.h"
@ -51,21 +47,16 @@
# ifdef SGTL5000_AUDIO_ENHANCE
# ifdef SGTL5000_AUDIO_ENHANCE
# include "control_sgtl5000plus.h"
# include "control_sgtl5000plus.h"
# endif
# endif
# if defined(USE_EPIANO)
# include "synth_mda_epiano.h"
# include "synth_mda_epiano.h"
# include <effect_stereo_panorama.h>
# include <effect_stereo_panorama.h>
# endif
# if defined(USE_DELAY_8M)
# if defined(USE_DELAY_8M)
# include "effect_delay_ext8.h"
# include "effect_delay_ext8.h"
# endif
# endif
// 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)
AudioSynthWaveform * chorus_modulator [ NUM_DEXED ] ;
AudioSynthWaveform * chorus_modulator [ NUM_DEXED ] ;
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
AudioFilterBiquad * modchorus_filter [ NUM_DEXED ] ;
AudioFilterBiquad * modchorus_filter [ NUM_DEXED ] ;
@ -79,10 +70,8 @@ AudioEffectDelayExternal8* delay_fx[NUM_DEXED];
AudioEffectDelay * delay_fx [ NUM_DEXED ] ;
AudioEffectDelay * delay_fx [ NUM_DEXED ] ;
# endif
# endif
AudioMixer < 2 > * delay_mixer [ NUM_DEXED ] ;
AudioMixer < 2 > * delay_mixer [ NUM_DEXED ] ;
# endif
AudioEffectMonoStereo * mono2stereo [ NUM_DEXED ] ;
AudioEffectMonoStereo * mono2stereo [ NUM_DEXED ] ;
# if defined(USE_FX) && defined(USE_EPIANO)
AudioEffectStereoPanorama ep_stereo_panorama ;
AudioEffectStereoPanorama ep_stereo_panorama ;
AudioSynthWaveform ep_chorus_modulator ;
AudioSynthWaveform ep_chorus_modulator ;
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
@ -91,32 +80,15 @@ AudioFilterBiquad ep_modchorus_filter;
AudioEffectModulatedDelayStereo ep_modchorus ;
AudioEffectModulatedDelayStereo ep_modchorus ;
AudioMixer < 2 > ep_chorus_mixer_r ;
AudioMixer < 2 > ep_chorus_mixer_r ;
AudioMixer < 2 > ep_chorus_mixer_l ;
AudioMixer < 2 > ep_chorus_mixer_l ;
# endif
AudioMixer < 2 > microdexed_peak_mixer ;
AudioMixer < 2 > microdexed_peak_mixer ;
AudioAnalyzePeak microdexed_peak ;
AudioAnalyzePeak microdexed_peak ;
# if defined(USE_FX)
# if defined(USE_EPIANO)
AudioMixer < 4 > reverb_mixer_r ;
AudioMixer < 4 > reverb_mixer_r ;
AudioMixer < 4 > reverb_mixer_l ;
AudioMixer < 4 > reverb_mixer_l ;
# else
AudioMixer < 3 > reverb_mixer_r ;
AudioMixer < 3 > reverb_mixer_l ;
# endif
# if defined(USE_PLATEREVERB)
AudioEffectPlateReverb reverb ;
AudioEffectPlateReverb reverb ;
# else
AudioEffectFreeverbStereoFloat freeverb ;
# endif
# endif
# if defined(USE_FX) && defined(USE_EPIANO)
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
AudioAmplifier volume_r ;
AudioAmplifier volume_r ;
AudioAmplifier volume_l ;
AudioAmplifier volume_l ;
AudioEffectStereoMono stereo2mono ;
AudioEffectStereoMono stereo2mono ;
@ -132,8 +104,6 @@ AudioMixer<2> audio_thru_mixer_l;
AudioPlayArrayResmp * Drum [ NUM_DRUMS ] ;
AudioPlayArrayResmp * Drum [ NUM_DRUMS ] ;
AudioMixer < NUM_DRUMS > drum_mixer_r ;
AudioMixer < NUM_DRUMS > drum_mixer_r ;
AudioMixer < NUM_DRUMS > drum_mixer_l ;
AudioMixer < NUM_DRUMS > drum_mixer_l ;
# ifdef USE_FX
# if NUM_DRUMS < 5
# if NUM_DRUMS < 5
AudioMixer < 4 > drum_reverb_send_mixer_r ;
AudioMixer < 4 > drum_reverb_send_mixer_r ;
AudioMixer < 4 > drum_reverb_send_mixer_l ;
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 ;
AudioMixer < 8 > drum_reverb_send_mixer_l ;
# endif
# endif
# endif
# endif
# endif
// Outputs
// Outputs
# if defined(TEENSY_AUDIO_BOARD)
# if defined(TEENSY_AUDIO_BOARD)
AudioOutputI2S i2s1 ;
AudioOutputI2S i2s1 ;
# ifdef SGTL5000_AUDIO_ENHANCE
# if defined(SGTL5000_AUDIO_ENHANCE)
AudioControlSGTL5000Plus sgtl5000 ;
AudioControlSGTL5000Plus sgtl5000 ;
# else
# else
AudioControlSGTL5000 sgtl5000 ;
AudioControlSGTL5000 sgtl5000 ;
@ -178,19 +147,10 @@ AudioInputI2S i2s1in;
//
//
AudioConnection patchCord [ ] = {
AudioConnection patchCord [ ] = {
// Audio chain tail
// Audio chain tail
# if defined(USE_FX)
# 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 , MASTER_MIX_CH_REVERB } ,
{ reverb , 0 , master_mixer_r , MASTER_MIX_CH_REVERB } ,
{ reverb , 1 , master_mixer_l , 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_r , volume_r } ,
{ master_mixer_l , volume_l } ,
{ master_mixer_l , volume_l } ,
{ volume_r , 0 , stereo2mono , 0 } ,
{ volume_r , 0 , stereo2mono , 0 } ,
@ -236,21 +196,14 @@ AudioConnection patchCord[] = {
# endif
# endif
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
# ifdef USE_FX
{ drum_reverb_send_mixer_r , 0 , reverb_mixer_r , REVERB_MIX_CH_DRUMS } ,
{ 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_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_r , 0 , master_mixer_r , MASTER_MIX_CH_DRUMS } ,
{ drum_mixer_l , 0 , master_mixer_l , 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
# endif
# if defined(USE_EPIANO)
{ ep , 0 , ep_stereo_panorama , 0 } ,
{ ep , 0 , ep_stereo_panorama , 0 } ,
{ ep , 1 , ep_stereo_panorama , 1 } ,
{ ep , 1 , ep_stereo_panorama , 1 } ,
# if defined(USE_FX)
{ ep_stereo_panorama , 0 , ep_chorus_mixer_r , 0 } ,
{ ep_stereo_panorama , 0 , ep_chorus_mixer_r , 0 } ,
{ ep_stereo_panorama , 1 , ep_chorus_mixer_l , 0 } ,
{ ep_stereo_panorama , 1 , ep_chorus_mixer_l , 0 } ,
{ ep_stereo_panorama , 0 , ep_modchorus , 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_l , 0 , reverb_mixer_l , REVERB_MIX_CH_EPIANO } ,
{ ep_chorus_mixer_r , 0 , master_mixer_r , MASTER_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 } ,
{ 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
// Dynamic patching of MicroDexed objects
//
//
uint8_t nDynamic = 0 ;
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 ] ;
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 ] ;
AudioConnection * dynamicConnections [ NUM_DEXED * 15 + NUM_DRUMS * 4 ] ;
# else
AudioConnection * dynamicConnections [ NUM_DEXED * 4 + NUM_DRUMS * 2 ] ;
# endif
# endif
FLASHMEM void create_audio_dexed_chain ( uint8_t instance_id ) {
FLASHMEM void create_audio_dexed_chain ( uint8_t instance_id ) {
MicroDexed [ instance_id ] = new AudioSynthDexed ( MAX_NOTES / NUM_DEXED , SAMPLE_RATE ) ;
MicroDexed [ instance_id ] = new AudioSynthDexed ( MAX_NOTES / NUM_DEXED , SAMPLE_RATE ) ;
mono2stereo [ instance_id ] = new AudioEffectMonoStereo ( ) ;
mono2stereo [ instance_id ] = new AudioEffectMonoStereo ( ) ;
# if defined(USE_FX)
chorus_modulator [ instance_id ] = new AudioSynthWaveform ( ) ;
chorus_modulator [ instance_id ] = new AudioSynthWaveform ( ) ;
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
modchorus_filter [ instance_id ] = new AudioFilterBiquad ( ) ;
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 ( ) ;
delay_fx [ instance_id ] = new AudioEffectDelay ( ) ;
# endif
# endif
delay_mixer [ instance_id ] = new AudioMixer < 2 > ( ) ;
delay_mixer [ instance_id ] = new AudioMixer < 2 > ( ) ;
# endif
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , microdexed_peak_mixer , instance_id ) ;
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 , * chorus_mixer [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , * modchorus [ instance_id ] , 0 ) ; //////////////////////
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , * modchorus [ instance_id ] , 0 ) ; //////////////////////
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
# 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 ( * 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 ] , 0 , reverb_mixer_r , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * mono2stereo [ instance_id ] , 1 , reverb_mixer_l , 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 ] , 0 , master_mixer_r , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * mono2stereo [ instance_id ] , 1 , master_mixer_l , 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_r , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * Drum [ instance_id ] , 0 , drum_mixer_l , 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_r , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * Drum [ instance_id ] , 0 , drum_reverb_send_mixer_l , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * Drum [ instance_id ] , 0 , drum_reverb_send_mixer_l , instance_id ) ;
# endif
}
}
# endif
# endif
@ -391,30 +330,14 @@ char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
char receive_bank_filename [ FILENAME_LEN ] ;
char receive_bank_filename [ FILENAME_LEN ] ;
uint8_t selected_instance_id = 0 ;
uint8_t selected_instance_id = 0 ;
uint8_t active_sample = 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 } ;
int8_t midi_decay [ NUM_DEXED ] = { - 1 , - 1 } ;
# else
int8_t midi_decay [ NUM_DEXED ] = { - 1 } ;
# endif
elapsedMillis midi_decay_timer ;
elapsedMillis midi_decay_timer ;
# endif
# if NUM_DEXED > 1
int perform_attack_mod [ NUM_DEXED ] = { 0 , 0 } ;
int perform_attack_mod [ NUM_DEXED ] = { 0 , 0 } ;
int perform_release_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
// Allocate the delay lines for chorus
int16_t * delayline [ NUM_DEXED ] ;
int16_t * delayline [ NUM_DEXED ] ;
# ifdef USE_EPIANO
int16_t * ep_delayline_r ;
int16_t * ep_delayline_r ;
int16_t * ep_delayline_l ;
int16_t * ep_delayline_l ;
# endif
# endif
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
//extern drum_config_t drum_config[NUM_DRUMSET_CONFIG];
//extern drum_config_t drum_config[NUM_DRUMSET_CONFIG];
@ -422,9 +345,7 @@ uint8_t drum_counter;
uint8_t drum_type [ NUM_DRUMS ] ;
uint8_t drum_type [ NUM_DRUMS ] ;
# endif
# endif
# ifdef ENABLE_LCD_UI
extern LCDMenuLib2 LCDML ;
extern LCDMenuLib2 LCDML ;
# endif
extern void getNoteName ( char * noteName , uint8_t noteNumber ) ;
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
delay ( 50 ) ; // seems to be needed when no serial debugging is enabled
# endif
# endif
# ifdef ENABLE_LCD_UI
setup_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 ( " ------------------------------------------------------------------------------- " ) ) ;
Serial . println ( F ( " Latest crash report: " ) ) ;
Serial . println ( F ( " Latest crash report: " ) ) ;
Serial . println ( CrashReport ) ;
Serial . println ( CrashReport ) ;
@ -568,10 +482,8 @@ void setup() {
drum_mixer_r . gain ( instance_id , 1.0 ) ;
drum_mixer_r . gain ( instance_id , 1.0 ) ;
drum_mixer_l . 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_r . gain ( instance_id , 0.0 ) ;
drum_reverb_send_mixer_l . gain ( instance_id , 0.0 ) ;
drum_reverb_send_mixer_l . gain ( instance_id , 0.0 ) ;
# endif
}
}
// Init drumset config
// Init drumset config
configuration . drums . main_vol = DRUMS_MAIN_VOL_DEFAULT ;
configuration . drums . main_vol = DRUMS_MAIN_VOL_DEFAULT ;
@ -582,8 +494,6 @@ void setup() {
# endif
# endif
// Setup EPiano
// Setup EPiano
# if defined(USE_FX)
# if defined(USE_EPIANO)
// EP_CHORUS
// EP_CHORUS
ep_delayline_r = ( int16_t * ) malloc ( MOD_DELAY_SAMPLE_BUFFER * sizeof ( int16_t ) ) ;
ep_delayline_r = ( int16_t * ) malloc ( MOD_DELAY_SAMPLE_BUFFER * sizeof ( int16_t ) ) ;
if ( ep_delayline_r = = NULL ) {
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_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_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 ) ) ;
ep_stereo_panorama . panorama ( mapfloat ( EP_PANORAMA_DEFAULT , EP_PANORAMA_MIN , EP_PANORAMA_MAX , - 1.0 , 1.0 ) ) ;
# endif
# endif
// Setup effects
// Setup effects
# 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 + + ) {
delayline [ instance_id ] = ( int16_t * ) malloc ( MOD_DELAY_SAMPLE_BUFFER * sizeof ( int16_t ) ) ;
delayline [ instance_id ] = ( int16_t * ) malloc ( MOD_DELAY_SAMPLE_BUFFER * sizeof ( int16_t ) ) ;
if ( delayline [ instance_id ] ! = NULL ) {
if ( delayline [ instance_id ] ! = NULL ) {
@ -657,7 +564,6 @@ void setup() {
Serial . print ( F ( " MOD_DELAY_SAMPLE_BUFFER= " ) ) ;
Serial . print ( F ( " MOD_DELAY_SAMPLE_BUFFER= " ) ) ;
Serial . print ( MOD_DELAY_SAMPLE_BUFFER , DEC ) ;
Serial . print ( MOD_DELAY_SAMPLE_BUFFER , DEC ) ;
Serial . println ( F ( " samples " ) ) ;
Serial . println ( F ( " samples " ) ) ;
# endif
# endif
# endif
// Start SD card
// Start SD card
@ -725,10 +631,8 @@ void setup() {
# endif
# endif
master_mixer_r . gain ( MASTER_MIX_CH_REVERB , VOL_MAX_FLOAT ) ;
master_mixer_r . gain ( MASTER_MIX_CH_REVERB , VOL_MAX_FLOAT ) ;
master_mixer_l . 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_r . gain ( MASTER_MIX_CH_EPIANO , VOL_MAX_FLOAT ) ;
master_mixer_l . gain ( MASTER_MIX_CH_EPIANO , VOL_MAX_FLOAT ) ;
master_mixer_l . gain ( MASTER_MIX_CH_EPIANO , VOL_MAX_FLOAT ) ;
# endif
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
master_mixer_r . gain ( MASTER_MIX_CH_DRUMS , VOL_MAX_FLOAT ) ;
master_mixer_r . gain ( MASTER_MIX_CH_DRUMS , VOL_MAX_FLOAT ) ;
master_mixer_l . 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
// E-Piano
# if defined(USE_EPIANO)
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel ) {
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel ) {
if ( inNumber > = configuration . epiano . lowest_note & & inNumber < = configuration . epiano . highest_note ) {
if ( inNumber > = configuration . epiano . lowest_note & & inNumber < = configuration . epiano . highest_note ) {
ep . noteOn ( inNumber + configuration . epiano . transpose - 24 , inVelocity ) ;
ep . noteOn ( inNumber + configuration . epiano . transpose - 24 , inVelocity ) ;
@ -982,7 +885,6 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
# endif
# endif
}
}
}
}
# endif
// Drums
// Drums
# if NUM_DRUMS > 0
# 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_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 ) ) ) ;
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_r . gain ( slot , pan * volume_transform ( reverb_send ) ) ;
drum_reverb_send_mixer_l . gain ( slot , ( 1.0 - 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 ( drum_config [ d ] . drum_data ! = NULL & & drum_config [ d ] . len > 0 ) {
if ( configuration . drums . pitch [ d ] ! = 0 ) {
if ( configuration . drums . pitch [ d ] ! = 0 ) {
Drum [ slot ] - > enableInterpolation ( true ) ;
Drum [ slot ] - > enableInterpolation ( true ) ;
@ -1084,7 +985,6 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) {
}
}
// EPiano
// EPiano
# if defined(USE_EPIANO)
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel ) {
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel ) {
if ( inNumber > = configuration . epiano . lowest_note & & inNumber < = configuration . epiano . highest_note ) {
if ( inNumber > = configuration . epiano . lowest_note & & inNumber < = configuration . epiano . highest_note ) {
ep . noteOff ( inNumber + configuration . epiano . transpose - 24 ) ;
ep . noteOff ( inNumber + configuration . epiano . transpose - 24 ) ;
@ -1100,7 +1000,6 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) {
# endif
# endif
}
}
}
}
# endif
}
}
void handleControlChange ( byte inChannel , byte inCtrl , byte inValue ) {
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 ) ;
inValue = constrain ( inValue , 0 , 127 ) ;
// EPiano
// EPiano
# if defined(USE_EPIANO)
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel )
if ( configuration . epiano . midi_channel = = MIDI_CHANNEL_OMNI | | configuration . epiano . midi_channel = = inChannel )
ep . processMidiController ( inCtrl , inValue ) ;
ep . processMidiController ( inCtrl , inValue ) ;
# endif
// Dexed
// Dexed
for ( uint8_t instance_id = 0 ; instance_id < NUM_DEXED ; instance_id + + ) {
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 ( ) ;
LCDML . loop_menu ( ) ;
}
}
break ;
break ;
# if defined(USE_FX)
case 91 : // CC 91: reverb send
case 91 : // CC 91: reverb send
configuration . fx . reverb_send [ selected_instance_id ] = map ( inValue , 0 , 0x7f , REVERB_SEND_MIN , REVERB_SEND_MAX ) ;
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 ) ) ) ;
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 ( ) ;
LCDML . loop_menu ( ) ;
}
}
break ;
break ;
# endif
case 120 :
case 120 :
MicroDexed [ instance_id ] - > panic ( ) ;
MicroDexed [ instance_id ] - > panic ( ) ;
break ;
break ;
@ -1688,7 +1583,6 @@ void handleClock(void) {
Serial . println ( F ( " ms per quarter) " ) ) ;
Serial . println ( F ( " ms per quarter) " ) ) ;
# endif
# endif
# ifdef USE_FX
/*
/*
1 1 / 16 = 6 ticks / 0.0625
1 1 / 16 = 6 ticks / 0.0625
2 1 / 16 T = 9 ticks / 0.09375
2 1 / 16 T = 9 ticks / 0.09375
@ -1713,7 +1607,6 @@ void handleClock(void) {
# endif
# endif
}
}
}
}
# endif
}
}
_midi_bpm = midi_bpm ;
_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_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 ) ;
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_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_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_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_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 ) ;
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 ) {
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_roomsize = REVERB_ROOMSIZE_DEFAULT ;
configuration . fx . reverb_level = REVERB_LEVEL_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_frequency = EP_CHORUS_FREQUENCY_DEFAULT ;
configuration . fx . ep_chorus_waveform = EP_CHORUS_WAVEFORM_DEFAULT ;
configuration . fx . ep_chorus_waveform = EP_CHORUS_WAVEFORM_DEFAULT ;
configuration . fx . ep_chorus_depth = EP_CHORUS_DEPTH_DEFAULT ;
configuration . fx . ep_chorus_depth = EP_CHORUS_DEPTH_DEFAULT ;
configuration . fx . ep_chorus_level = EP_CHORUS_LEVEL_DEFAULT ;
configuration . fx . ep_chorus_level = EP_CHORUS_LEVEL_DEFAULT ;
configuration . fx . ep_reverb_send = EP_REVERB_SEND_DEFAULT ;
configuration . fx . ep_reverb_send = EP_REVERB_SEND_DEFAULT ;
# endif
for ( uint8_t instance_id = 0 ; instance_id < NUM_DEXED ; instance_id + + ) {
for ( uint8_t instance_id = 0 ; instance_id < NUM_DEXED ; instance_id + + ) {
configuration . dexed [ instance_id ] . bank = SYSEXBANK_DEFAULT ;
configuration . dexed [ instance_id ] . bank = SYSEXBANK_DEFAULT ;
@ -2087,7 +1976,6 @@ void init_configuration(void) {
MicroDexed [ instance_id ] - > ControllersRefresh ( ) ;
MicroDexed [ instance_id ] - > ControllersRefresh ( ) ;
}
}
# if defined(USE_EPIANO)
configuration . epiano . decay = EP_DECAY_DEFAULT ;
configuration . epiano . decay = EP_DECAY_DEFAULT ;
configuration . epiano . release = EP_RELEASE_DEFAULT ;
configuration . epiano . release = EP_RELEASE_DEFAULT ;
configuration . epiano . hardness = EP_HARDNESS_DEFAULT ;
configuration . epiano . hardness = EP_HARDNESS_DEFAULT ;
@ -2111,7 +1999,6 @@ void init_configuration(void) {
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
configuration . drums . main_vol = DRUMS_MAIN_VOL_DEFAULT ;
configuration . drums . main_vol = DRUMS_MAIN_VOL_DEFAULT ;
configuration . drums . midi_channel = DRUMS_MIDI_CHANNEL_DEFAULT ;
configuration . drums . midi_channel = DRUMS_MIDI_CHANNEL_DEFAULT ;
# endif
# endif
# endif
strlcpy ( configuration . performance . name , " INIT Perf " , sizeof ( configuration . performance . name ) ) ;
strlcpy ( configuration . performance . name , " INIT Perf " , sizeof ( configuration . performance . name ) ) ;
@ -2126,7 +2013,6 @@ void eeprom_update(void) {
}
}
void set_fx_params ( void ) {
void set_fx_params ( void ) {
# 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 + + ) {
// CHORUS
// CHORUS
switch ( configuration . fx . chorus_waveform [ instance_id ] ) {
switch ( configuration . fx . chorus_waveform [ instance_id ] ) {
@ -2181,26 +2067,17 @@ void set_fx_params(void) {
}
}
// REVERB
// REVERB
# ifdef USE_PLATEREVERB
reverb . size ( mapfloat ( configuration . fx . reverb_roomsize , REVERB_ROOMSIZE_MIN , REVERB_ROOMSIZE_MAX , 0.0 , 1.0 ) ) ;
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 . 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 . 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 . 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 ) ) ;
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
# if NUM_DRUMS > 0
# ifdef USE_FX
reverb_mixer_r . gain ( REVERB_MIX_CH_DRUMS , 1.0 ) ; // Drums Reverb-Send
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
reverb_mixer_l . gain ( REVERB_MIX_CH_DRUMS , 1.0 ) ; // Drums Reverb-Send
# endif
# 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_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
@ -2234,13 +2111,10 @@ void set_fx_params(void) {
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 ( 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 ) ) ;
# 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 ) ) ) ;
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 ) ) ) ;
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
# ifdef SGTL5000_AUDIO_ENHANCE
sgtl5000 . setEQFc ( 1 , float ( configuration . fx . eq_1 ) ) ;
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 ) ) ;
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 ) {
void set_epiano_params ( void ) {
# if defined(USE_EPIANO)
# ifdef DEBUG
# ifdef DEBUG
Serial . print ( F ( " Setting EPiano parameters... " ) ) ;
Serial . print ( F ( " Setting EPiano parameters... " ) ) ;
# endif
# endif
@ -2304,9 +2177,6 @@ void set_epiano_params(void) {
# ifdef DEBUG
# ifdef DEBUG
Serial . println ( F ( " done. " ) ) ;
Serial . println ( F ( " done. " ) ) ;
# endif
# endif
# else
;
# endif
}
}
void set_sys_params ( void ) {
void set_sys_params ( void ) {
@ -2514,16 +2384,10 @@ void generate_version_string(char* buffer, uint8_t len) {
memset ( buffer , 0 , len ) ;
memset ( buffer , 0 , len ) ;
strlcat ( buffer , VERSION , len ) ;
strlcat ( buffer , VERSION , len ) ;
# if defined(ARDUINO_TEENSY36)
# if defined(ARDUINO_TEENSY41)
strlcat ( buffer , " -3.6 " , 4 ) ;
# elif defined(ARDUINO_TEENSY40)
strlcat ( buffer , " -4.0 " , 4 ) ;
# elif defined(ARDUINO_TEENSY41)
strlcat ( buffer , " -4.1 " , 4 ) ;
strlcat ( buffer , " -4.1 " , 4 ) ;
# endif
# endif
# if defined(USE_FX)
strlcat ( buffer , " FX " , 2 ) ;
strlcat ( buffer , " FX " , 2 ) ;
# endif
# if defined(MAX_NOTES)
# if defined(MAX_NOTES)
strlcat ( buffer , " - " , 1 ) ;
strlcat ( buffer , " - " , 1 ) ;
itoa ( MAX_NOTES , tmp , 10 ) ;
itoa ( MAX_NOTES , tmp , 10 ) ;