|
|
@ -28,7 +28,7 @@ |
|
|
|
#include <MIDI.h> |
|
|
|
#include <MIDI.h> |
|
|
|
#include <EEPROM.h> |
|
|
|
#include <EEPROM.h> |
|
|
|
#include <limits.h> |
|
|
|
#include <limits.h> |
|
|
|
#include "mod-delay-gain.h" |
|
|
|
#include "mod-delay.h" |
|
|
|
#include "mdaEPiano.h" |
|
|
|
#include "mdaEPiano.h" |
|
|
|
#ifdef USE_XFADE_DATA |
|
|
|
#ifdef USE_XFADE_DATA |
|
|
|
#include "mdaEPianoDataXfade.h" |
|
|
|
#include "mdaEPianoDataXfade.h" |
|
|
@ -46,7 +46,6 @@ |
|
|
|
#include "LiquidCrystalPlus_I2C.h" |
|
|
|
#include "LiquidCrystalPlus_I2C.h" |
|
|
|
#include "UI.h" |
|
|
|
#include "UI.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//*************************************************************************************************
|
|
|
|
//*************************************************************************************************
|
|
|
|
//* GLOBAL VARIABLES
|
|
|
|
//* GLOBAL VARIABLES
|
|
|
|
//*************************************************************************************************
|
|
|
|
//*************************************************************************************************
|
|
|
@ -61,11 +60,9 @@ AudioEffectFreeverb freeverb_l; |
|
|
|
AudioMixer4 mixer_r; |
|
|
|
AudioMixer4 mixer_r; |
|
|
|
AudioMixer4 mixer_l; |
|
|
|
AudioMixer4 mixer_l; |
|
|
|
AudioSynthWaveform delaySweep_r; |
|
|
|
AudioSynthWaveform delaySweep_r; |
|
|
|
AudioSynthWaveform envelope_r; |
|
|
|
|
|
|
|
AudioSynthWaveform delaySweep_l; |
|
|
|
AudioSynthWaveform delaySweep_l; |
|
|
|
AudioSynthWaveform envelope_l; |
|
|
|
AudioEffectModDelay modulatedDelay_r; |
|
|
|
AudioEffectModDelayGain modulatedDelay_r; |
|
|
|
AudioEffectModDelay modulatedDelay_l; |
|
|
|
AudioEffectModDelayGain modulatedDelay_l; |
|
|
|
|
|
|
|
AudioConnection patchCord0(queue_r, peak_r); |
|
|
|
AudioConnection patchCord0(queue_r, peak_r); |
|
|
|
AudioConnection patchCord1(queue_l, peak_l); |
|
|
|
AudioConnection patchCord1(queue_l, peak_l); |
|
|
|
AudioConnection patchCord4(queue_r, freeverb_r); |
|
|
|
AudioConnection patchCord4(queue_r, freeverb_r); |
|
|
@ -80,8 +77,6 @@ AudioConnection patchCord12(modulatedDelay_r, 0, mixer_r, 2); |
|
|
|
AudioConnection patchCord13(modulatedDelay_l, 0, mixer_l, 2); |
|
|
|
AudioConnection patchCord13(modulatedDelay_l, 0, mixer_l, 2); |
|
|
|
AudioConnection patchCord14(delaySweep_r, 0, modulatedDelay_r, 1); |
|
|
|
AudioConnection patchCord14(delaySweep_r, 0, modulatedDelay_r, 1); |
|
|
|
AudioConnection patchCord15(delaySweep_l, 0, modulatedDelay_l, 1); |
|
|
|
AudioConnection patchCord15(delaySweep_l, 0, modulatedDelay_l, 1); |
|
|
|
AudioConnection patchCord16(envelope_r, 0, modulatedDelay_r, 2); |
|
|
|
|
|
|
|
AudioConnection patchCord17(envelope_l, 0, modulatedDelay_l, 2); |
|
|
|
|
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord18(mixer_r, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord18(mixer_r, 0, i2s1, 0); |
|
|
@ -97,10 +92,6 @@ AudioConnection patchCord20(volume_r, 0, pt8211_1, 1); |
|
|
|
AudioConnection patchCord21(volume_l, 0, pt8211_1, 0); |
|
|
|
AudioConnection patchCord21(volume_l, 0, pt8211_1, 0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
const int32_t delayBufferLength = 4500; |
|
|
|
|
|
|
|
int16_t delayBuf1[delayBufferLength]; |
|
|
|
|
|
|
|
int16_t delayBuf2[delayBufferLength]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Objects
|
|
|
|
// Objects
|
|
|
|
mdaEPiano* ep; |
|
|
|
mdaEPiano* ep; |
|
|
|
|
|
|
|
|
|
|
@ -132,10 +123,13 @@ const uint16_t audio_block_time_us = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLE |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
elapsedMillis cpu_mem_millis; |
|
|
|
elapsedMillis cpu_mem_millis; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
float modFreq = 2.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum MDA_EP_PARAM { DECAY, RELEASE, HARDNESS, TREBLE, PAN_TREM, LFO_RATE, VELOCITY_SENSE, STEREO, MAX_POLY, TUNE, DETUNE, OVERDRIVE }; |
|
|
|
const int32_t delayBufferLength = 1000; |
|
|
|
|
|
|
|
int16_t delayBuf_r[delayBufferLength]; |
|
|
|
|
|
|
|
int16_t delayBuf_l[delayBufferLength]; |
|
|
|
|
|
|
|
float modFreq = 0.7; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum MDA_EP_PARAM { DECAY, RELEASE, HARDNESS, TREBLE, PAN_TREM, LFO_RATE, VELOCITY_SENSE, STEREO, MAX_POLY, TUNE, DETUNE, OVERDRIVE }; |
|
|
|
|
|
|
|
|
|
|
|
//*************************************************************************************************
|
|
|
|
//*************************************************************************************************
|
|
|
|
//* SETUP FUNCTION
|
|
|
|
//* SETUP FUNCTION
|
|
|
@ -246,17 +240,16 @@ void setup() |
|
|
|
freeverb_r.damping(0.5); |
|
|
|
freeverb_r.damping(0.5); |
|
|
|
freeverb_l.damping(0.5); |
|
|
|
freeverb_l.damping(0.5); |
|
|
|
|
|
|
|
|
|
|
|
delaySweep_r.begin(1, modFreq, WAVEFORM_SINE); |
|
|
|
modulatedDelay_r.setbuf(delayBufferLength, delayBuf_r); |
|
|
|
delaySweep_l.begin(1, modFreq, WAVEFORM_SINE); |
|
|
|
modulatedDelay_l.setbuf(delayBufferLength, delayBuf_l); |
|
|
|
delaySweep_l.phase(180.0); |
|
|
|
delaySweep_r.begin(0.1, modFreq, WAVEFORM_SINE); |
|
|
|
envelope_r.begin(1, modFreq, WAVEFORM_SINE); |
|
|
|
delaySweep_l.begin(0.1, modFreq, WAVEFORM_SINE); |
|
|
|
envelope_l.begin(1, modFreq, WAVEFORM_SINE); |
|
|
|
//delaySweep_l.phase(180.0);
|
|
|
|
envelope_l.phase(180.0); |
|
|
|
|
|
|
|
|
|
|
|
mixer_r.gain(0, 0.5); |
|
|
|
mixer_r.gain(0, 0.7); |
|
|
|
mixer_l.gain(0, 0.5); |
|
|
|
mixer_l.gain(0, 0.7); |
|
|
|
mixer_r.gain(1, 0.2); |
|
|
|
mixer_r.gain(1, 0.3); |
|
|
|
mixer_l.gain(1, 0.2); |
|
|
|
mixer_l.gain(1, 0.3); |
|
|
|
|
|
|
|
mixer_r.gain(2, 0.5); |
|
|
|
mixer_r.gain(2, 0.5); |
|
|
|
mixer_l.gain(2, 0.5); |
|
|
|
mixer_l.gain(2, 0.5); |
|
|
|
|
|
|
|
|
|
|
|