|
|
@ -22,7 +22,6 @@ |
|
|
|
#define VOLUME 0.2 |
|
|
|
#define VOLUME 0.2 |
|
|
|
#define SAMPLE_RATE 44100 |
|
|
|
#define SAMPLE_RATE 44100 |
|
|
|
#define DEXED_ENGINE DEXED_ENGINE_MODERN |
|
|
|
#define DEXED_ENGINE DEXED_ENGINE_MODERN |
|
|
|
//#define INIT_AUDIO_QUEUE 1
|
|
|
|
|
|
|
|
//#define SHOW_DEXED_TIMING 1
|
|
|
|
//#define SHOW_DEXED_TIMING 1
|
|
|
|
#define SHOW_XRUN 1 |
|
|
|
#define SHOW_XRUN 1 |
|
|
|
#define SHOW_CPU_LOAD_MSEC 5000 |
|
|
|
#define SHOW_CPU_LOAD_MSEC 5000 |
|
|
@ -50,12 +49,16 @@ MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI); |
|
|
|
Dexed* dexed = new Dexed(SAMPLE_RATE); |
|
|
|
Dexed* dexed = new Dexed(SAMPLE_RATE); |
|
|
|
IntervalTimer sched; |
|
|
|
IntervalTimer sched; |
|
|
|
bool sd_card_available = false; |
|
|
|
bool sd_card_available = false; |
|
|
|
|
|
|
|
#ifdef TEST_MIDI |
|
|
|
|
|
|
|
IntervalTimer sched_note_on; |
|
|
|
|
|
|
|
IntervalTimer sched_note_off; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void setup() |
|
|
|
void setup() |
|
|
|
{ |
|
|
|
{ |
|
|
|
//while (!Serial) ; // wait for Arduino Serial Monitor
|
|
|
|
//while (!Serial) ; // wait for Arduino Serial Monitor
|
|
|
|
Serial.begin(SERIAL_SPEED); |
|
|
|
Serial.begin(SERIAL_SPEED); |
|
|
|
delay(250); |
|
|
|
delay(50); |
|
|
|
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); |
|
|
|
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); |
|
|
|
Serial.println(F("(c)2018 H. Wirtz")); |
|
|
|
Serial.println(F("(c)2018 H. Wirtz")); |
|
|
|
Serial.println(F("setup start")); |
|
|
|
Serial.println(F("setup start")); |
|
|
@ -86,61 +89,33 @@ void setup() |
|
|
|
AudioMemoryUsageMaxReset(); |
|
|
|
AudioMemoryUsageMaxReset(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef INIT_AUDIO_QUEUE |
|
|
|
|
|
|
|
// initial fill audio buffer with empty data
|
|
|
|
|
|
|
|
while (queue1.available()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int16_t* audio_buffer = queue1.getBuffer(); |
|
|
|
|
|
|
|
if (audio_buffer != NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
memset(audio_buffer, 0, sizeof(int16_t)*AUDIO_BLOCK_SAMPLES); |
|
|
|
|
|
|
|
queue1.playBuffer(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
load_sysex("ROM1A.SYX", 20); |
|
|
|
load_sysex("ROM1A.SYX", 20); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
show_patch(); |
|
|
|
show_patch(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
dexed->activate(); |
|
|
|
//dexed->activate();
|
|
|
|
dexed->setMaxNotes(MAX_NOTES); |
|
|
|
//dexed->setMaxNotes(MAX_NOTES);
|
|
|
|
dexed->setEngineType(DEXED_ENGINE); |
|
|
|
//dexed->setEngineType(DEXED_ENGINE);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
sched.begin(cpu_and_mem_usage, SHOW_CPU_LOAD_MSEC * 1000); |
|
|
|
sched.begin(cpu_and_mem_usage, SHOW_CPU_LOAD_MSEC * 1000); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
Serial.print(F("AUDIO_BLOCK_SAMPLES=")); |
|
|
|
Serial.print(F("AUDIO_BLOCK_SAMPLES=")); |
|
|
|
Serial.println(AUDIO_BLOCK_SAMPLES); |
|
|
|
Serial.println(AUDIO_BLOCK_SAMPLES); |
|
|
|
Serial.println(F("setup end")); |
|
|
|
|
|
|
|
cpu_and_mem_usage(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TEST_MIDI |
|
|
|
#ifdef TEST_MIDI |
|
|
|
delay(200); |
|
|
|
Serial.println(F("MIDI test enabled")); |
|
|
|
randomSeed(analogRead(A0)); |
|
|
|
sched_note_on.begin(note_on, 2000000); |
|
|
|
queue_midi_event(0x90, TEST_NOTE, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 1
|
|
|
|
sched_note_off.begin(note_off, 1333333); |
|
|
|
queue_midi_event(0x90, TEST_NOTE + 5, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 2
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 8, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 3
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 12, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 4
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 17, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 5
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 20, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 6
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 24, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 7
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 29, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 8
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 32, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 9
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 37, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 10
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 40, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 11
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 44, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 12
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 49, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 13
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 52, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 14
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 57, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 15
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 60, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 16
|
|
|
|
|
|
|
|
delay(200); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(F("setup end")); |
|
|
|
|
|
|
|
cpu_and_mem_usage(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void loop() |
|
|
|
void loop() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int16_t* audio_buffer; // pointer to 128 * int16_t
|
|
|
|
int16_t* audio_buffer; // pointer to 128 * int16_t (=256 bytes!)
|
|
|
|
bool break_for_calculation; |
|
|
|
bool break_for_calculation; |
|
|
|
|
|
|
|
|
|
|
|
while (42 == 42) // DON'T PANIC!
|
|
|
|
while (42 == 42) // DON'T PANIC!
|
|
|
@ -153,7 +128,7 @@ void loop() |
|
|
|
|
|
|
|
|
|
|
|
while (MIDI.read()) |
|
|
|
while (MIDI.read()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
break_for_calculation = dexed->ProcessMidiMessage(MIDI.getType(), MIDI.getData1(), MIDI.getData2()); |
|
|
|
break_for_calculation = dexed->processMidiMessage(MIDI.getType(), MIDI.getData1(), MIDI.getData2()); |
|
|
|
if (break_for_calculation == true) |
|
|
|
if (break_for_calculation == true) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -164,10 +139,10 @@ void loop() |
|
|
|
#if defined(SHOW_DEXED_TIMING) || defined(SHOW_XRUN) |
|
|
|
#if defined(SHOW_DEXED_TIMING) || defined(SHOW_XRUN) |
|
|
|
elapsedMicros t1; |
|
|
|
elapsedMicros t1; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
dexed->GetSamples(AUDIO_BLOCK_SAMPLES, audio_buffer); |
|
|
|
dexed->getSamples(AUDIO_BLOCK_SAMPLES, audio_buffer); |
|
|
|
#ifdef SHOW_XRUN |
|
|
|
#ifdef SHOW_XRUN |
|
|
|
uint32_t t2 = t1; |
|
|
|
uint32_t t2 = t1; |
|
|
|
if (t2 > 2900) |
|
|
|
if (t2 > 2900) // everything greater 2.9ms is a buffer underrun!
|
|
|
|
Serial.println(F("xrun")); |
|
|
|
Serial.println(F("xrun")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef SHOW_DEXED_TIMING |
|
|
|
#ifdef SHOW_DEXED_TIMING |
|
|
@ -177,9 +152,53 @@ void loop() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TEST_MIDI |
|
|
|
|
|
|
|
void note_on(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
randomSeed(analogRead(A0)); |
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE, random(TEST_VEL_MIN, TEST_VEL_MAX)); |
|
|
|
|
|
|
|
// 1
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 5, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 2
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 8, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 3
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 12, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 4
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 17, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 5
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 20, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 6
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 24, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 7
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 29, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 8
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 32, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 9
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 37, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 10
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 40, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 11
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 44, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 12
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 49, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 13
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 52, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 14
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 57, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 15
|
|
|
|
|
|
|
|
queue_midi_event(0x90, TEST_NOTE + 60, random(TEST_VEL_MIN, TEST_VEL_MAX)); // 16
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void note_off(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE, 0); // 1
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 5, 0); // 2
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 8, 0); // 3
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 12, 0); // 4
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 17, 0); // 5
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 20, 0); // 6
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 24, 0); // 7
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 29, 0); // 8
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 32, 0); // 9
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 37, 0); // 10
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 40, 0); // 11
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 44, 0); // 12
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 49, 0); // 13
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 52, 0); // 14
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 57, 0); // 15
|
|
|
|
|
|
|
|
queue_midi_event(0x80, TEST_NOTE + 60, 0); // 16
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2) |
|
|
|
bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return (dexed->ProcessMidiMessage(type, data1, data2)); |
|
|
|
return (dexed->processMidiMessage(type, data1, data2)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
@ -230,108 +249,6 @@ void load_sysex(char *name, uint8_t voice_number) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
void show_patch(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t i; |
|
|
|
|
|
|
|
char voicename[11]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(voicename, 0, sizeof(voicename)); |
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(F("OP")); |
|
|
|
|
|
|
|
Serial.print(6 - i, DEC); |
|
|
|
|
|
|
|
Serial.println(F(":")); |
|
|
|
|
|
|
|
Serial.println(F("R1|R2|R3|R4|L1|L2|L3|L4 LEV_SCL_BRK_PT|SCL_LEFT_DEPTH|SCL_RGHT_DEPTH")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 0], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 1], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 2], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 3], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 4], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 5], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 6], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 7], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 8], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 9], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[(i * 21) + 10], DEC); |
|
|
|
|
|
|
|
Serial.println(F("SCL_L_CURVE|SCL_R_CURVE|OSC_DET|RT_SCALE|VEL_SENS|MOD_SENS|OUT_LEV|FRQ_C|FRQ_F|MOD")); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 11], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 12], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 13], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 14], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 15], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 16], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 17], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 18], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 19], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[(i * 21) + 20], DEC); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Serial.println(F("PR1|PR2|PR3|PR4|PL1|PL2|PL3|PL4")); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(dexed->data[125 + i], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Serial.println(); |
|
|
|
|
|
|
|
Serial.print(F("ALG: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[133], DEC); |
|
|
|
|
|
|
|
Serial.print(F("OSC_SYNC: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[134], DEC); |
|
|
|
|
|
|
|
Serial.print(F("FB: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[135], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO SPD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[136], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_DLY: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[137], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO PMD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[138], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_AMD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[139], DEC); |
|
|
|
|
|
|
|
Serial.print(F("PMS: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[140], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_WAVEFRM: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[141], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_SYNC: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[142], DEC); |
|
|
|
|
|
|
|
Serial.print(F("TRNSPSE: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[143], DEC); |
|
|
|
|
|
|
|
Serial.print(F("NAME: ")); |
|
|
|
|
|
|
|
strncpy(voicename, (char *)&dexed->data[144], sizeof(voicename) - 1); |
|
|
|
|
|
|
|
Serial.print(F("[")); |
|
|
|
|
|
|
|
Serial.print(voicename); |
|
|
|
|
|
|
|
Serial.println(F("]")); |
|
|
|
|
|
|
|
for (i = 155; i < 173; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(i, DEC); |
|
|
|
|
|
|
|
Serial.print(F(": ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool load_sysex_voice(File sysex, uint8_t voice_number) |
|
|
|
bool load_sysex_voice(File sysex, uint8_t voice_number) |
|
|
|
{ |
|
|
|
{ |
|
|
|
File file; |
|
|
|
File file; |
|
|
@ -395,18 +312,19 @@ bool load_sysex_voice(File sysex, uint8_t voice_number) |
|
|
|
*(p_data + 171) = 1; // OP6 ENABLE
|
|
|
|
*(p_data + 171) = 1; // OP6 ENABLE
|
|
|
|
*(p_data + 172) = MAX_NOTES; |
|
|
|
*(p_data + 172) = MAX_NOTES; |
|
|
|
|
|
|
|
|
|
|
|
dexed->panic(); |
|
|
|
|
|
|
|
dexed->setOPs((*(p_data + 166) << 5) | (*(p_data + 167) << 4) | (*(p_data + 168) << 3) | (*(p_data + 166) << 2) | (*(p_data + 170) << 1) | *(p_data + 171)); |
|
|
|
dexed->setOPs((*(p_data + 166) << 5) | (*(p_data + 167) << 4) | (*(p_data + 168) << 3) | (*(p_data + 166) << 2) | (*(p_data + 170) << 1) | *(p_data + 171)); |
|
|
|
dexed->setMaxNotes(*(p_data + 172)); |
|
|
|
dexed->setMaxNotes(*(p_data + 172)); |
|
|
|
dexed->doRefreshVoice(); |
|
|
|
dexed->doRefreshVoice(); |
|
|
|
dexed->activate(); |
|
|
|
dexed->activate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
char voicename[11]; |
|
|
|
char voicename[11]; |
|
|
|
memset(voicename, 0, sizeof(voicename)); |
|
|
|
memset(voicename, 0, sizeof(voicename)); |
|
|
|
strncpy(voicename, (char *)&dexed->data[144], sizeof(voicename) - 1); |
|
|
|
strncpy(voicename, (char *)&dexed->data[144], sizeof(voicename) - 1); |
|
|
|
Serial.print(F("[")); |
|
|
|
Serial.print(F("[")); |
|
|
|
Serial.print(voicename); |
|
|
|
Serial.print(voicename); |
|
|
|
Serial.println(F("]")); |
|
|
|
Serial.println(F("]")); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
return (true); |
|
|
|
return (true); |
|
|
|
} |
|
|
|
} |
|
|
@ -460,4 +378,104 @@ bool check_sysex(File sysex) |
|
|
|
return (true); |
|
|
|
return (true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
void show_patch(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t i; |
|
|
|
|
|
|
|
char voicename[11]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(voicename, 0, sizeof(voicename)); |
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(F("OP")); |
|
|
|
|
|
|
|
Serial.print(6 - i, DEC); |
|
|
|
|
|
|
|
Serial.println(F(":")); |
|
|
|
|
|
|
|
Serial.println(F("R1|R2|R3|R4|L1|L2|L3|L4 LEV_SCL_BRK_PT|SCL_LEFT_DEPTH|SCL_RGHT_DEPTH")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 0], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 1], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 2], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 3], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 4], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 5], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 6], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 7], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 8], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 9], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[(i * 21) + 10], DEC); |
|
|
|
|
|
|
|
Serial.println(F("SCL_L_CURVE|SCL_R_CURVE|RT_SCALE| AMS | KVS |OUT_LEV|OP_MOD|FRQ_C|FRQ_F")); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 11], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 12], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 13], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 14], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 15], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 16], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 17], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 18], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.print(dexed->data[(i * 21) + 19], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[(i * 21) + 20], DEC); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Serial.println(F("PR1|PR2|PR3|PR4|PL1|PL2|PL3|PL4")); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(dexed->data[125 + i], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Serial.println(); |
|
|
|
|
|
|
|
Serial.print(F("ALG: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[134], DEC); |
|
|
|
|
|
|
|
Serial.print(F("FB: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[135], DEC); |
|
|
|
|
|
|
|
Serial.print(F("OKS: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[136], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO SPD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[137], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_DLY: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[138], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO PMD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[139], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_AMD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[140], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_SYNC: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[141], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_WAVEFRM: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[142], DEC); |
|
|
|
|
|
|
|
Serial.print(F("LFO_PMD: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[143], DEC); |
|
|
|
|
|
|
|
Serial.print(F("TRNSPSE: ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[143], DEC); |
|
|
|
|
|
|
|
Serial.print(F("NAME: ")); |
|
|
|
|
|
|
|
strncpy(voicename, (char *)&dexed->data[144], sizeof(voicename) - 1); |
|
|
|
|
|
|
|
Serial.print(F("[")); |
|
|
|
|
|
|
|
Serial.print(voicename); |
|
|
|
|
|
|
|
Serial.println(F("]")); |
|
|
|
|
|
|
|
for (i = 155; i < 173; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(i, DEC); |
|
|
|
|
|
|
|
Serial.print(F(": ")); |
|
|
|
|
|
|
|
Serial.println(dexed->data[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|