Fix reading voice/bank data from EEPROM.

Simple loudness reduction changed.
Added MIDI CC 121 (reset controllers) and 126/127 (set mono on/off).
pull/4/head
Holger Wirtz 6 years ago
parent 892f3f66db
commit b8015f455f
  1. 5
      MicroDexed.ino
  2. 8
      config.h
  3. 32
      dexed.cpp
  4. 1
      dexed.h

@ -159,8 +159,11 @@ void setup()
// load default SYSEX data // load default SYSEX data
load_sysex(bank, EEPROM.read(EEPROM_VOICE_ADDR)); load_sysex(bank, EEPROM.read(EEPROM_VOICE_ADDR));
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("Bank/Voice from EEPROM: "));
Serial.print(EEPROM.read(EEPROM_BANK_ADDR), DEC);
Serial.print(F("/"));
Serial.println(EEPROM.read(EEPROM_VOICE_ADDR), DEC);
show_patch(); show_patch();
#endif #endif

@ -2,7 +2,8 @@
MicroDexed MicroDexed
MicroDexed is a port of the Dexed sound engine MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de> (c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -55,7 +56,7 @@
// Some optimizations // Some optimizations
#define USE_TEENSY_DSP 1 #define USE_TEENSY_DSP 1
#define SUM_UP_AS_INT 1 #define SUM_UP_AS_INT 1
#define REDUCE_LOUDNESS 2 #define REDUCE_LOUDNESS 1
// Enable TEST_NOTE for adding code to drop some midi notes for testing without keyboard // Enable TEST_NOTE for adding code to drop some midi notes for testing without keyboard
//#define TEST_NOTE MIDI_E2 //#define TEST_NOTE MIDI_E2
@ -78,5 +79,6 @@
#define INITIAL_ENC1_VALUE 0 #define INITIAL_ENC1_VALUE 0
// EEPROM address // EEPROM address
#define EEPROM_VOICE_ADDR 0
#define EEPROM_BANK_ADDR 0 #define EEPROM_BANK_ADDR 0
#define EEPROM_VOICE_ADDR 1

@ -65,13 +65,7 @@ Dexed::Dexed(int rate)
max_notes = 16; max_notes = 16;
currentNote = 0; currentNote = 0;
controllers.values_[kControllerPitch] = 0x2000; resetControllers();
controllers.values_[kControllerPitchRange] = 0;
controllers.values_[kControllerPitchStep] = 0;
controllers.modwheel_cc = 0;
controllers.foot_cc = 0;
controllers.breath_cc = 0;
controllers.aftertouch_cc = 0;
controllers.masterTune = 0; controllers.masterTune = 0;
controllers.opSwitch = 0x3f; // enable all operators controllers.opSwitch = 0x3f; // enable all operators
//controllers.opSwitch=0x00; //controllers.opSwitch=0x00;
@ -263,10 +257,22 @@ bool Dexed::processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2)
panic(); panic();
return (true); return (true);
break; break;
case 121:
resetControllers();
return (true);
break;
case 123: case 123:
notesOff(); notesOff();
return (true); return (true);
break; break;
case 126:
setMonoMode(true);
return (true);
break;
case 127:
setMonoMode(false);
return (true);
break;
} }
break; break;
} }
@ -533,6 +539,18 @@ void Dexed::panic(void) {
} }
} }
void Dexed::resetControllers(void)
{
controllers.values_[kControllerPitch] = 0x2000;
controllers.values_[kControllerPitchRange] = 0;
controllers.values_[kControllerPitchStep] = 0;
controllers.modwheel_cc = 0;
controllers.foot_cc = 0;
controllers.breath_cc = 0;
controllers.aftertouch_cc = 0;
controllers.refresh();
}
void Dexed::notesOff(void) { void Dexed::notesOff(void) {
for (uint8_t i = 0; i < MAX_ACTIVE_NOTES; i++) { for (uint8_t i = 0; i < MAX_ACTIVE_NOTES; i++) {
if (voices[i].live == true && voices[i].keydown == true) { if (voices[i].live == true && voices[i].keydown == true) {

@ -147,6 +147,7 @@ class Dexed
bool processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2); bool processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2);
void panic(void); void panic(void);
void notesOff(void); void notesOff(void);
void resetControllers(void);
void setMaxNotes(uint8_t n); void setMaxNotes(uint8_t n);
void doRefreshVoice(void); void doRefreshVoice(void);
void setOPs(uint8_t ops); void setOPs(uint8_t ops);

Loading…
Cancel
Save