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_sysex(bank, EEPROM.read(EEPROM_VOICE_ADDR));
#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();
#endif

@ -2,7 +2,8 @@
MicroDexed
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>
@ -55,7 +56,7 @@
// Some optimizations
#define USE_TEENSY_DSP 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
//#define TEST_NOTE MIDI_E2
@ -78,5 +79,6 @@
#define INITIAL_ENC1_VALUE 0
// EEPROM address
#define EEPROM_VOICE_ADDR 0
#define EEPROM_BANK_ADDR 0
#define EEPROM_VOICE_ADDR 1

@ -65,13 +65,7 @@ Dexed::Dexed(int rate)
max_notes = 16;
currentNote = 0;
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;
resetControllers();
controllers.masterTune = 0;
controllers.opSwitch = 0x3f; // enable all operators
//controllers.opSwitch=0x00;
@ -263,10 +257,22 @@ bool Dexed::processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2)
panic();
return (true);
break;
case 121:
resetControllers();
return (true);
break;
case 123:
notesOff();
return (true);
break;
case 126:
setMonoMode(true);
return (true);
break;
case 127:
setMonoMode(false);
return (true);
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) {
for (uint8_t i = 0; i < MAX_ACTIVE_NOTES; i++) {
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);
void panic(void);
void notesOff(void);
void resetControllers(void);
void setMaxNotes(uint8_t n);
void doRefreshVoice(void);
void setOPs(uint8_t ops);

Loading…
Cancel
Save