Dateien hochladen nach „“

pull/50/head
positionhigh 4 years ago
parent 49b80dd7b7
commit af8426da31
  1. 34
      MicroDexed.ino

@ -268,6 +268,7 @@ int16_t _midi_bpm = -1;
elapsedMillis midi_bpm_timer; elapsedMillis midi_bpm_timer;
elapsedMillis long_button_pressed; elapsedMillis long_button_pressed;
elapsedMillis control_rate; elapsedMillis control_rate;
elapsedMillis sequencer_timer;
uint8_t active_voices[NUM_DEXED]; uint8_t active_voices[NUM_DEXED];
uint8_t midi_voices[NUM_DEXED]; uint8_t midi_voices[NUM_DEXED];
#ifdef SHOW_CPU_LOAD_MSEC #ifdef SHOW_CPU_LOAD_MSEC
@ -288,7 +289,15 @@ char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
char g_bank_name[NUM_DEXED][BANK_NAME_LEN]; char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
char receive_bank_filename[FILENAME_LEN]; char receive_bank_filename[FILENAME_LEN];
uint8_t selected_instance_id = 0; uint8_t selected_instance_id = 0;
uint8_t seqsteptimer = 0;
uint32_t seqtimer_old = 0;
bool seq_running = false;
//uint8_t seqdata[1][16]={48,48,54,48,49,54,54,48,54,54,48,54,49,54,54,54};
//uint8_t seqdata[1][16]={72,72,78,72,75,78,78,72,78,78,72,78,75,78,78,78};
uint8_t seqdata[3][16] = {72, 72, 0, 72, 75, 0, 0, 72, 0, 0, 72, 0, 75, 0, 0, 0,
73, 73, 0, 73, 0, 0, 73, 73, 0, 0, 73, 73, 0, 0, 0, 0,
78, 0, 0, 78, 0, 0, 78, 0, 78, 78, 0, 0, 0, 0, 0, 0
};
#ifdef TEENSY4 #ifdef TEENSY4
#if NUM_DEXED>1 #if NUM_DEXED>1
int8_t midi_decay[NUM_DEXED] = { -1, -1}; int8_t midi_decay[NUM_DEXED] = { -1, -1};
@ -599,6 +608,29 @@ void loop()
ENCODER[ENC_L].update(); ENCODER[ENC_L].update();
ENCODER[ENC_R].update(); ENCODER[ENC_R].update();
if (seq_running) {
if (sequencer_timer > seqtimer_old + 125)
{
seqtimer_old = sequencer_timer;
if (seqdata[0][seqsteptimer] > 0) {
handleNoteOn(DRUM_MIDI_CHANNEL, seqdata[0][seqsteptimer] , 99);
}
if (seqdata[1][seqsteptimer] > 0) {
handleNoteOn(DRUM_MIDI_CHANNEL, seqdata[1][seqsteptimer] , 99);
}
if (seqdata[2][seqsteptimer] > 0) {
handleNoteOn(DRUM_MIDI_CHANNEL, seqdata[2][seqsteptimer] , 99);
}
seqsteptimer++;
}
if (seqsteptimer > 15)seqsteptimer = 0;
}
#ifdef ENABLE_LCD_UI #ifdef ENABLE_LCD_UI
LCDML.loop(); LCDML.loop();
#endif #endif

Loading…
Cancel
Save