|
|
@ -64,6 +64,8 @@ uint8_t voice = 0; |
|
|
|
float vol = VOLUME; |
|
|
|
float vol = VOLUME; |
|
|
|
float vol_right = 1.0; |
|
|
|
float vol_right = 1.0; |
|
|
|
float vol_left = 1.0; |
|
|
|
float vol_left = 1.0; |
|
|
|
|
|
|
|
elapsedMicros fill_audio_buffer; |
|
|
|
|
|
|
|
const uint16_t audio_block_time_us = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLES); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef MASTER_KEY_MIDI |
|
|
|
#ifdef MASTER_KEY_MIDI |
|
|
|
bool master_key_enabled = false; |
|
|
|
bool master_key_enabled = false; |
|
|
@ -173,6 +175,23 @@ void setup() |
|
|
|
sched_note_off.begin(note_off, 6333333); |
|
|
|
sched_note_off.begin(note_off, 6333333); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
0 decay |
|
|
|
|
|
|
|
1 release |
|
|
|
|
|
|
|
2 hardness |
|
|
|
|
|
|
|
3 treble |
|
|
|
|
|
|
|
4 pan_trem |
|
|
|
|
|
|
|
5 lfo_rate |
|
|
|
|
|
|
|
6 velocity_sense |
|
|
|
|
|
|
|
7 stereo |
|
|
|
|
|
|
|
8 max_poly |
|
|
|
|
|
|
|
9 tune |
|
|
|
|
|
|
|
10 detune |
|
|
|
|
|
|
|
11 overdrive |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
//ep->setParameter(11,1.0); // overdrive
|
|
|
|
|
|
|
|
//ep->setParameter(10,1.0); // overdrive
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
|
|
|
|
|
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
@ -188,8 +207,10 @@ void loop() |
|
|
|
const uint16_t audio_block_time_ms = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLES); |
|
|
|
const uint16_t audio_block_time_ms = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLES); |
|
|
|
|
|
|
|
|
|
|
|
// Main sound calculation
|
|
|
|
// Main sound calculation
|
|
|
|
if (queue_r.available() && queue_l.available()) |
|
|
|
if (queue_r.available() && queue_l.available() && fill_audio_buffer > audio_block_time_us - 10) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
fill_audio_buffer = 0; |
|
|
|
|
|
|
|
|
|
|
|
audio_buffer_r = queue_r.getBuffer(); |
|
|
|
audio_buffer_r = queue_r.getBuffer(); |
|
|
|
audio_buffer_l = queue_l.getBuffer(); |
|
|
|
audio_buffer_l = queue_l.getBuffer(); |
|
|
|
|
|
|
|
|
|
|
@ -201,8 +222,6 @@ void loop() |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
handle_input(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
audio_buffer_r = queue_r.getBuffer(); |
|
|
|
audio_buffer_r = queue_r.getBuffer(); |
|
|
|
if (audio_buffer_r == NULL) |
|
|
|
if (audio_buffer_r == NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -242,6 +261,8 @@ void loop() |
|
|
|
queue_r.playBuffer(); |
|
|
|
queue_r.playBuffer(); |
|
|
|
queue_l.playBuffer(); |
|
|
|
queue_l.playBuffer(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handle_input(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handle_input(void) |
|
|
|
void handle_input(void) |
|
|
|