Fixing errors.

dev
Holger Wirtz 6 years ago
parent 1f51969bdc
commit 63f8d45ebb
  1. 2
      UI.hpp
  2. 29
      mdaEPiano.cpp
  3. 2
      mdaEPiano.h

@ -1180,9 +1180,7 @@ void callback_midi_soft_thru_function()
menu_system.change_menu(midi_soft_thru_menu); menu_system.change_menu(midi_soft_thru_menu);
menu_position[SYSTEM] = encoder_value[RIGHT_ENCODER]; menu_position[SYSTEM] = encoder_value[RIGHT_ENCODER];
encoder_value[RIGHT_ENCODER] = configuration.midi_soft_thru; encoder_value[RIGHT_ENCODER] = configuration.midi_soft_thru;
Serial.print("XXXXXX");Serial.println(configuration.midi_soft_thru,DEC);
enc[RIGHT_ENCODER].write(configuration.midi_soft_thru, ENC_MIDI_SOFT_THRU_MIN, ENC_MIDI_SOFT_THRU_MAX); enc[RIGHT_ENCODER].write(configuration.midi_soft_thru, ENC_MIDI_SOFT_THRU_MIN, ENC_MIDI_SOFT_THRU_MAX);
Serial.print("YYYYYYYY");Serial.println(configuration.midi_soft_thru,DEC);
menu_system.update(); menu_system.update();
} }

@ -35,10 +35,11 @@ mdaEPiano::mdaEPiano() // mdaEPiano::mdaEPiano(audioMasterCallback audioMaster)
{ {
Fs = SAMPLE_RATE; iFs = 1.0f / Fs; //just in case... Fs = SAMPLE_RATE; iFs = 1.0f / Fs; //just in case...
/*
programs = new mdaEPianoProgram[NPROGS]; programs = new mdaEPianoProgram[NPROGS];
if (programs) /*
{ if (programs)
{
//fill patches... //fill patches...
int32_t i = 0; int32_t i = 0;
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); 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);
@ -50,8 +51,8 @@ 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); 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);
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); 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); setProgram(0);
} }
*/ */
waves = (short*)epianoDataXfade; waves = (short*)epianoDataXfade;
@ -104,6 +105,8 @@ mdaEPiano::mdaEPiano() // mdaEPiano::mdaEPiano(audioMasterCallback audioMaster)
//initialise... //initialise...
reset_voices(); reset_voices();
curProgram = 0;
} }
void mdaEPiano::reset_voices(void) // reset all voices void mdaEPiano::reset_voices(void) // reset all voices
@ -165,11 +168,11 @@ mdaEPiano::~mdaEPiano () //destroy any buffers...
} }
/* /*
void mdaEPiano::setProgram(int32_t program) void mdaEPiano::setProgram(int32_t program)
{ {
curProgram = program; curProgram = program;
update(); update();
} }
*/ */
void mdaEPiano::setParameter(int32_t index, float value) void mdaEPiano::setParameter(int32_t index, float value)
@ -179,9 +182,9 @@ void mdaEPiano::setParameter(int32_t index, float value)
} }
/* /*
void mdaEPiano::fillpatch(int32_t p, char *name, float p0, float p1, float p2, float p3, float p4, 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) float p5, float p6, float p7, float p8, float p9, float p10, float p11)
{ {
strcpy(programs[p].name, name); strcpy(programs[p].name, name);
programs[p].param[0] = p0; programs[p].param[1] = p1; programs[p].param[0] = p0; programs[p].param[1] = p1;
programs[p].param[2] = p2; programs[p].param[3] = p3; programs[p].param[2] = p2; programs[p].param[3] = p3;
@ -189,11 +192,11 @@ void mdaEPiano::fillpatch(int32_t p, char *name, float p0, float p1, float p2, f
programs[p].param[6] = p6; programs[p].param[7] = p7; programs[p].param[6] = p6; programs[p].param[7] = p7;
programs[p].param[8] = p8; programs[p].param[9] = p9; programs[p].param[8] = p8; programs[p].param[9] = p9;
programs[p].param[10] = p10; programs[p].param[11] = p11; programs[p].param[10] = p10; programs[p].param[11] = p11;
} }
float mdaEPiano::getParameter(int32_t index) { float mdaEPiano::getParameter(int32_t index) {
return programs[curProgram].param[index]; return programs[curProgram].param[index];
} }
*/ */
void mdaEPiano::process(int16_t* outputs_r, int16_t* outputs_l) void mdaEPiano::process(int16_t* outputs_r, int16_t* outputs_l)

@ -112,7 +112,7 @@ class mdaEPiano
float tune, fine, random, stretch, overdrive; float tune, fine, random, stretch, overdrive;
float muff, muffvel, sizevel, velsens, volume, modwhl; float muff, muffvel, sizevel, velsens, volume, modwhl;
float vol; float vol;
const uint8_t curProgram = 0; uint8_t curProgram;
}; };
#endif #endif

Loading…
Cancel
Save