From eb809ac6cecbc331b195f690e4ee7e15ba56a027 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 9 Jan 2019 08:15:44 +0100 Subject: [PATCH] Added compiler option USE_XFADE_DATA for choosing which sample data to use. --- MicroMDAEPiano.ino | 5 ++++- config.h | 1 + mdaEPiano.cpp | 7 +++++-- mdaEPianoData.h | 2 ++ mdaEPianoDataXfade.h | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/MicroMDAEPiano.ino b/MicroMDAEPiano.ino index f7c84e1..5901ef9 100644 --- a/MicroMDAEPiano.ino +++ b/MicroMDAEPiano.ino @@ -30,8 +30,11 @@ #include #include #include "mdaEPiano.h" -//#include "mdaEPianoData.h" +#ifdef USE_XFADE_DATA #include "mdaEPianoDataXfade.h" +#else +#include "mdaEPianoData.h" +#endif #if defined(USBCON) #include #endif diff --git a/config.h b/config.h index 5cab52d..4195f1d 100644 --- a/config.h +++ b/config.h @@ -37,6 +37,7 @@ #define AUDIO_MEM 300 #define SAMPLE_RATE 44100 #define REDUCE_LOUDNESS 0 +#define USE_XFADE_DATA 1 #if !defined(__MK66FX1M0__) // check for Teensy-3.6 #undef USE_ONBOARD_USB_HOST diff --git a/mdaEPiano.cpp b/mdaEPiano.cpp index 3471c36..eb4ef02 100644 --- a/mdaEPiano.cpp +++ b/mdaEPiano.cpp @@ -1,10 +1,13 @@ +#include "config.h" +#ifdef USE_XFADE_DATA #include "mdaEPianoDataXfade.h" +#else +#include "mdaEPianoData.h" +#endif #include "mdaEPiano.h" - #include #include -#include "config.h" mdaEPiano::mdaEPiano() // mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, NPROGS, NPARAMS) { diff --git a/mdaEPianoData.h b/mdaEPianoData.h index 2bdb788..79476f0 100644 --- a/mdaEPianoData.h +++ b/mdaEPianoData.h @@ -1,3 +1,4 @@ +#ifndef USE_XFADE_DATA #include const int16_t epianoData[] PROGMEM = { @@ -21123,3 +21124,4 @@ const int16_t epianoData[] PROGMEM = { -1302,-3296,-4700,-5297,-5021,-3939,-2233,-189,1899,3696,4890,5299,4788,3436,1466,-757,-2846,-4450,-5294,-5248, -4377,-2810,-829,1280,3190,4588,5216,4960,3821,0,1,1,0,-1,0,0,0,0 }; +#endif diff --git a/mdaEPianoDataXfade.h b/mdaEPianoDataXfade.h index 7812ded..469ff8a 100644 --- a/mdaEPianoDataXfade.h +++ b/mdaEPianoDataXfade.h @@ -1,3 +1,4 @@ +#ifdef USE_XFADE_DATA #include const int16_t epianoDataXfade[] PROGMEM = { @@ -21123,3 +21124,4 @@ const int16_t epianoDataXfade[] PROGMEM = { -1302,-3296,-4700,-5297,-5021,-3939,-2233,-189,1899,3696,4890,5299,4788,3436,1466,-757,-2846,-4450,-5294,-5248, -4377,-2810,-829,1280,3190,4588,5216,4960,3821,0,1,1,0,-1,0,0,0,0, }; +#endif