From 498bdd2502d26fd78e4b604a9ac21a2cde962d00 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 21 May 2019 14:10:57 +0200 Subject: [PATCH] Removed all unnecessary code from mdaEPiano for multiple programs. --- mdaEPiano.cpp | 11 +++++++---- mdaEPiano.h | 16 ++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mdaEPiano.cpp b/mdaEPiano.cpp index 686ef40..d386d20 100644 --- a/mdaEPiano.cpp +++ b/mdaEPiano.cpp @@ -35,6 +35,7 @@ mdaEPiano::mdaEPiano() // mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) { Fs = SAMPLE_RATE; iFs = 1.0f / Fs; //just in case... +/* programs = new mdaEPianoProgram[NPROGS]; if (programs) { @@ -50,6 +51,7 @@ mdaEPiano::mdaEPiano() // mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) fillpatch(i++, "(default)", 0.500f, 0.500f, 0.500f, 0.500f, 0.500f, 0.650f, 0.250f, 0.500f, 1.0f, 0.500f, 0.146f, 0.000f); setProgram(0); } +*/ waves = (short*)epianoDataXfade; @@ -118,7 +120,7 @@ void mdaEPiano::reset_voices(void) // reset all voices tl = tr = lfo0 = dlfo = 0.0f; lfo1 = 1.0f; - guiUpdate = 0; + //guiUpdate = 0; vol = VOLUME; update(); @@ -162,13 +164,13 @@ mdaEPiano::~mdaEPiano () //destroy any buffers... if (programs) delete [] programs; } - +/* void mdaEPiano::setProgram(int32_t program) { curProgram = program; update(); } - +*/ void mdaEPiano::setParameter(int32_t index, float value) { @@ -176,7 +178,7 @@ void mdaEPiano::setParameter(int32_t index, float value) update(); } - +/* void mdaEPiano::fillpatch(int32_t p, char *name, float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8, float p9, float p10, float p11) { @@ -192,6 +194,7 @@ void mdaEPiano::fillpatch(int32_t p, char *name, float p0, float p1, float p2, f float mdaEPiano::getParameter(int32_t index) { return programs[curProgram].param[index]; } +*/ void mdaEPiano::process(int16_t* outputs_r, int16_t* outputs_l) { diff --git a/mdaEPiano.h b/mdaEPiano.h index f4a5b2a..76ea13c 100644 --- a/mdaEPiano.h +++ b/mdaEPiano.h @@ -28,7 +28,7 @@ #include "config.h" #define NPARAMS 12 //number of parameters -#define NPROGS 8 //number of programs +#define NPROGS 1 //number of programs #define NOUTS 2 //number of outputs #define SUSTAIN 128 #define SILENCE 0.0001f //voice choking @@ -83,19 +83,19 @@ class mdaEPiano virtual void process(int16_t *outputs_r, int16_t *outputs_l); void noteOn(int32_t note, int32_t velocity); virtual bool processMidiController(uint8_t data1, uint8_t data2); - virtual void setProgram(int32_t program); + //virtual void setProgram(int32_t program); virtual void setParameter(int32_t index, float value); - virtual float getParameter(int32_t index); + //virtual float getParameter(int32_t index); virtual void resume(); void reset_voices(void); - int32_t guiUpdate; - void guiGetDisplay(int32_t index, char *label); + //int32_t guiUpdate; + //void guiGetDisplay(int32_t index, char *label); private: void update(); //my parameter update - void fillpatch(int32_t p, char *name, float p0, float p1, float p2, float p3, float p4, - float p5, float p6, float p7, float p8, float p9, float p10, float p11); + /* void fillpatch(int32_t p, char *name, float p0, float p1, float p2, float p3, float p4, + float p5, float p6, float p7, float p8, float p9, float p10, float p11); */ mdaEPianoProgram* programs; float Fs, iFs; @@ -112,7 +112,7 @@ class mdaEPiano float tune, fine, random, stretch, overdrive; float muff, muffvel, sizevel, velsens, volume, modwhl; float vol; - uint8_t curProgram; + const uint8_t curProgram = 0; }; #endif