@ -39,6 +39,7 @@
# include <effect_stereo_mono.h>
# include <effect_stereo_mono.h>
# include <effect_mono_stereo.h>
# include <effect_mono_stereo.h>
# include <effect_platervbstereo.h>
# include <effect_platervbstereo.h>
# include <effect_compressor.h>
# include <template_mixer.hpp>
# include <template_mixer.hpp>
# if NUM_DRUMS > 0
# if NUM_DRUMS > 0
# include "midinotes.h"
# include "midinotes.h"
@ -57,6 +58,7 @@
AudioSynthDexed * MicroDexed [ NUM_DEXED ] ;
AudioSynthDexed * MicroDexed [ NUM_DEXED ] ;
AudioSynthEPiano ep ( NUM_EPIANO_VOICES ) ;
AudioSynthEPiano ep ( NUM_EPIANO_VOICES ) ;
AudioEffectCompressor2 * compressor [ NUM_DEXED ] ;
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 ] ;
@ -89,6 +91,8 @@ AudioEffectPlateReverb reverb;
AudioMixer < 5 > master_mixer_r ;
AudioMixer < 5 > master_mixer_r ;
AudioMixer < 5 > master_mixer_l ;
AudioMixer < 5 > master_mixer_l ;
AudioEffectCompressor2 compressor_r ;
AudioEffectCompressor2 compressor_l ;
AudioAmplifier volume_r ;
AudioAmplifier volume_r ;
AudioAmplifier volume_l ;
AudioAmplifier volume_l ;
AudioEffectStereoMono stereo2mono ;
AudioEffectStereoMono stereo2mono ;
@ -151,8 +155,10 @@ AudioConnection patchCord[] = {
{ 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 } ,
{ master_mixer_r , volume_r } ,
{ master_mixer_r , compressor_r } ,
{ master_mixer_l , volume_l } ,
{ master_mixer_l , compressor_l } ,
{ compressor_r , volume_r } ,
{ compressor_l , volume_l } ,
{ volume_r , 0 , stereo2mono , 0 } ,
{ volume_r , 0 , stereo2mono , 0 } ,
{ volume_l , 0 , stereo2mono , 1 } ,
{ volume_l , 0 , stereo2mono , 1 } ,
{ stereo2mono , 0 , master_peak_r , 0 } ,
{ stereo2mono , 0 , master_peak_r , 0 } ,
@ -227,12 +233,13 @@ AudioConnection patchCord[] = {
//
//
uint8_t nDynamic = 0 ;
uint8_t nDynamic = 0 ;
# if 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 * 18 + NUM_DRUMS * 4 ] ;
# elif 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 * 17 + NUM_DRUMS * 4 ] ;
# 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 ) ;
compressor [ instance_id ] = new AudioEffectCompressor2 ( ) ;
mono2stereo [ instance_id ] = new AudioEffectMonoStereo ( ) ;
mono2stereo [ instance_id ] = new AudioEffectMonoStereo ( ) ;
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
@ -248,9 +255,11 @@ FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) {
# endif
# endif
delay_mixer [ instance_id ] = new AudioMixer < 2 > ( ) ;
delay_mixer [ instance_id ] = new AudioMixer < 2 > ( ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , microdexed_peak_mixer , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , * compressor [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , * chorus_mixer [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * compressor [ instance_id ] , 0 , microdexed_peak_mixer , instance_id ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * MicroDexed [ instance_id ] , 0 , * modchorus [ instance_id ] , 0 ) ; //////////////////////
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * compressor [ instance_id ] , 0 , * chorus_mixer [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * compressor [ instance_id ] , 0 , * modchorus [ instance_id ] , 0 ) ;
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
# if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * chorus_modulator [ instance_id ] , 0 , * modchorus_filter [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * chorus_modulator [ instance_id ] , 0 , * modchorus_filter [ instance_id ] , 0 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * modchorus_filter [ instance_id ] , 0 , * modchorus [ instance_id ] , 1 ) ;
dynamicConnections [ nDynamic + + ] = new AudioConnection ( * modchorus_filter [ instance_id ] , 0 , * modchorus [ instance_id ] , 1 ) ;
@ -2115,7 +2124,7 @@ void set_voiceconfig_params(uint8_t instance_id) {
MicroDexed [ instance_id ] - > doRefreshVoice ( ) ;
MicroDexed [ instance_id ] - > doRefreshVoice ( ) ;
MicroDexed [ instance_id ] - > setMonoMode ( configuration . dexed [ instance_id ] . monopoly ) ;
MicroDexed [ instance_id ] - > setMonoMode ( configuration . dexed [ instance_id ] . monopoly ) ;
MicroDexed [ instance_id ] - > setNoteRefreshMode ( configuration . dexed [ instance_id ] . note_refresh ) ;
MicroDexed [ instance_id ] - > setNoteRefreshMode ( configuration . dexed [ instance_id ] . note_refresh ) ;
MicroDexed [ instance_id ] - > setEngineType ( MSFA ) ;
MicroDexed [ instance_id ] - > setEngineType ( MKI ) ;
// Dexed output level
// Dexed output level
MicroDexed [ instance_id ] - > setGain ( midi_volume_transform ( map ( configuration . dexed [ instance_id ] . sound_intensity , SOUND_INTENSITY_MIN , SOUND_INTENSITY_MAX , 0 , 127 ) ) ) ;
MicroDexed [ instance_id ] - > setGain ( midi_volume_transform ( map ( configuration . dexed [ instance_id ] . sound_intensity , SOUND_INTENSITY_MIN , SOUND_INTENSITY_MAX , 0 , 127 ) ) ) ;