Dateien hochladen nach „“

pull/71/head
positionhigh 3 years ago
parent f707082624
commit 466e105b39
  1. 3989
      MicroDexed.ino
  2. 87
      UI.hpp
  3. 231
      sequencer.cpp
  4. 11
      sequencer.h

File diff suppressed because it is too large Load Diff

@ -51,6 +51,9 @@
#endif #endif
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar #define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
extern PeriodicTimer timer1;
extern void sequencer(void);
extern config_t configuration; extern config_t configuration;
extern void set_volume(uint8_t v, uint8_t m); extern void set_volume(uint8_t v, uint8_t m);
extern bool load_sysex(uint8_t b, uint8_t v); extern bool load_sysex(uint8_t b, uint8_t v);
@ -65,6 +68,7 @@ extern float pseudo_log_curve(float value);
extern uint8_t selected_instance_id; extern uint8_t selected_instance_id;
extern char receive_bank_filename[FILENAME_LEN]; extern char receive_bank_filename[FILENAME_LEN];
#if NUM_DRUMS > 0 #if NUM_DRUMS > 0
#include "drums.h" #include "drums.h"
extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; extern drum_config_t drum_config[NUM_DRUMSET_CONFIG];
@ -82,7 +86,6 @@ extern bool seq_recording;
uint8_t seq_active_function = 99; uint8_t seq_active_function = 99;
uint8_t activesample; uint8_t activesample;
extern uint8_t seq_active_track; extern uint8_t seq_active_track;
extern elapsedMillis seq_millis_timer;
extern uint8_t seq_menu; extern uint8_t seq_menu;
extern uint8_t seq_temp_select_menu; extern uint8_t seq_temp_select_menu;
extern uint8_t seq_temp_active_menu; extern uint8_t seq_temp_active_menu;
@ -4068,7 +4071,7 @@ void UI_func_seq_lenght(uint8_t param)
void UI_func_seq_tempo(uint8_t param) void UI_func_seq_tempo(uint8_t param)
{ {
char tmp[5]; char tmp[7];
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
@ -4084,19 +4087,21 @@ void UI_func_seq_tempo(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
seq_bpm = constrain(seq_bpm + ENCODER[ENC_R].speed(), 60, 180); seq_bpm = constrain(seq_bpm + ENCODER[ENC_R].speed(), 50, 190);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
seq_bpm = constrain(seq_bpm - ENCODER[ENC_R].speed(), 60, 180); seq_bpm = constrain(seq_bpm - ENCODER[ENC_R].speed(), 50, 190);
} }
seq_tempo_ms = 60000 / seq_bpm / 4; // seq_tempo_ms = 60000 / seq_bpm / 4;
seq_tempo_ms = 60000000 / seq_bpm / 4;
sprintf(tmp, "[%3d]", seq_bpm);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
sprintf(tmp, "[%3d]", seq_bpm);
lcd.print(tmp); lcd.print(tmp);
lcd.setCursor(11, 1);
lcd.setCursor(9, 1); sprintf(tmp, "%3d", seq_tempo_ms / 1000);
sprintf(tmp, "[%3d]", seq_tempo_ms);
lcd.print(tmp); lcd.print(tmp);
//timer1.stop();
timer1.begin(sequencer, seq_tempo_ms / 2);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
@ -4522,6 +4527,7 @@ void UI_func_sequencer(uint8_t param)
{ {
seq_running = true; seq_running = true;
lcd.print("REC"); lcd.print("REC");
timer1.start();
} else if (seq_running == true && seq_recording == false) } else if (seq_running == true && seq_recording == false)
{ {
seq_running = true; seq_running = true;
@ -4536,6 +4542,7 @@ void UI_func_sequencer(uint8_t param)
seq_step = 0; seq_step = 0;
seq_chain_active_step = 0; seq_chain_active_step = 0;
lcd.print("PLY"); lcd.print("PLY");
timer1.stop();
MicroDexed[0]->panic(); MicroDexed[0]->panic();
} }
} else if ( seq_menu == 2) } else if ( seq_menu == 2)
@ -4788,7 +4795,8 @@ void UI_func_arpeggio(uint8_t param)
lcd.print("Maj"); lcd.print("Maj");
lcd.setCursor( 11, 1); lcd.setCursor( 11, 1);
lcd.print("1/16"); lcd.print("1/16");
lcd.setCursor( 7, 0);
lcd.print(" ");
arp_refresh_display_play_status(); arp_refresh_display_play_status();
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -4841,15 +4849,26 @@ void UI_func_arpeggio(uint8_t param)
seq_temp_active_menu = 0; seq_temp_active_menu = 0;
} }
else if ( seq_temp_select_menu == 2 && seq_temp_active_menu == 0 ) //else if ( seq_temp_select_menu == 2 && seq_temp_active_menu == 0 )
else if ( seq_temp_select_menu == 2 )
{ {
seq_running = !seq_running;
arp_refresh_display_play_status(); if (seq_running) {
MicroDexed[0]->panic(); seq_running = !seq_running;
seq_step = 0; timer1.stop();
arp_octave = 0; MicroDexed[0]->panic();
arp_step = 0; arp_refresh_display_play_status();
seq_chain_active_step = 0; seq_step = 0;
arp_octave = 0;
arp_step = 0;
seq_chain_active_step = 0;
} else
{
seq_running = !seq_running;
arp_refresh_display_play_status();
timer1.start();
}
} }
else if ( seq_temp_select_menu == 3 && seq_temp_active_menu == 0 ) else if ( seq_temp_select_menu == 3 && seq_temp_active_menu == 0 )
{ {
@ -4871,6 +4890,10 @@ void UI_func_arpeggio(uint8_t param)
if (arp_speed == 0)lcd.print("1/16"); else if (arp_speed == 1)lcd.print("1/8 "); if (arp_speed == 0)lcd.print("1/16"); else if (arp_speed == 1)lcd.print("1/8 ");
if (seq_temp_select_menu == 0) { if (seq_temp_select_menu == 0) {
lcd.setCursor( 3, 0);
lcd.print("[");
lcd.setCursor( 5, 0);
lcd.print("]");
lcd.setCursor( 11, 0); lcd.setCursor( 11, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 15, 0); lcd.setCursor( 15, 0);
@ -4879,24 +4902,22 @@ void UI_func_arpeggio(uint8_t param)
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 9, 1); lcd.setCursor( 9, 1);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 3, 0);
lcd.print("[");
lcd.setCursor( 5, 0);
lcd.print("]");
lcd.setCursor( 10, 1); lcd.setCursor( 10, 1);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 15, 1); lcd.setCursor( 15, 1);
lcd.print(" "); lcd.print(" ");
} }
else if (seq_temp_select_menu == 1) else if (seq_temp_select_menu == 1)
{ {
lcd.setCursor( 11, 0);
lcd.print(" ");
lcd.print(" ");
lcd.setCursor( 3, 0); lcd.setCursor( 3, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 5, 0); lcd.setCursor( 5, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 11, 0);
lcd.print(" ");
lcd.setCursor( 15, 0);
lcd.print(" ");
lcd.setCursor( 5, 1); lcd.setCursor( 5, 1);
lcd.print("["); lcd.print("[");
lcd.setCursor( 9, 1); lcd.setCursor( 9, 1);
@ -4908,14 +4929,14 @@ void UI_func_arpeggio(uint8_t param)
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 9, 1); lcd.setCursor( 9, 1);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 11, 0);
lcd.print("[");
lcd.setCursor( 15, 0);
lcd.print("]");
lcd.setCursor( 10, 1); lcd.setCursor( 10, 1);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 15, 1); lcd.setCursor( 15, 1);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 11, 0);
lcd.print("[");
lcd.setCursor( 15, 0);
lcd.print("]");
} }
else if (seq_temp_select_menu == 3) else if (seq_temp_select_menu == 3)
{ {
@ -4923,14 +4944,14 @@ void UI_func_arpeggio(uint8_t param)
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 15, 0); lcd.setCursor( 15, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 10, 1);
lcd.print("[");
lcd.setCursor( 15, 1);
lcd.print("]");
lcd.setCursor( 3, 0); lcd.setCursor( 3, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 5, 0); lcd.setCursor( 5, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 10, 1);
lcd.print("[");
lcd.setCursor( 15, 1);
lcd.print("]");
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********

@ -12,8 +12,9 @@ extern void handleNoteOff(byte , byte , byte );
extern void UI_func_sequencer(uint8_t); extern void UI_func_sequencer(uint8_t);
extern void UI_func_arpeggio(uint8_t); extern void UI_func_arpeggio(uint8_t);
extern const char* seq_find_shortname(uint8_t); extern const char* seq_find_shortname(uint8_t);
boolean interrupt_swapper = false;
void sequencer(void) void sequencer_part1(void)
{ {
//if (seq_note_in > 0 && seq_note_in < 62 && seq_recording == false ) { //if (seq_note_in > 0 && seq_note_in < 62 && seq_recording == false ) {
//handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step] + seq_transpose , 0); //handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step] + seq_transpose , 0);
@ -24,155 +25,143 @@ void sequencer(void)
//seq_note_in = 0; //seq_note_in = 0;
//} //}
if (seq_millis_timer > seq_timer_previous + seq_tempo_ms) // if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sequencer)) { //is in UI of Sequencer
{
seq_timer_previous = seq_millis_timer;
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sequencer)) { //is in UI of Sequencer
//write to sequencer if in sequencer menu //write to sequencer if in sequencer menu
if (seq_note_in > 0 && seq_recording == true) { // if (seq_note_in > 0 && seq_recording == true) {
//
// // if ( seq_content_type[ seq_patternchain[seq_chain_active_step][active_track] ] == 1) handleNoteOff(configuration.dexed[0].midi_channel, seq_data[active_track][seq_step] + seq_transpose , 0);
//
// seq_data[seq_active_track][seq_step] = seq_note_in;
// seq_vel[seq_active_track][seq_step] = seq_note_in_velocity;
// seq_note_in = 0;
// seq_note_in_velocity = 0;
// }
// if ( seq_content_type[ seq_patternchain[seq_chain_active_step][active_track] ] == 1) handleNoteOff(configuration.dexed[0].midi_channel, seq_data[active_track][seq_step] + seq_transpose , 0); for (uint8_t d = 0; d < 4; d++)
{
seq_data[seq_active_track][seq_step] = seq_note_in; if ( seq_track_type[d] == 0) { // drum track
seq_vel[seq_active_track][seq_step] = seq_note_in_velocity; if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0)
seq_note_in = 0;
seq_note_in_velocity = 0;
}
lcd.setCursor(seq_step, 1);
lcd.print("X");
if (seq_step == 0) {
lcd.setCursor(15, 1);
lcd.print(seq_find_shortname(15)[0]);
}
else
{ {
lcd.setCursor(seq_step - 1, 1); handleNoteOn(DRUM_MIDI_CHANNEL, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]);
lcd.print(seq_find_shortname(seq_step - 1)[0]);
} }
} }
else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_arpeggio)) { //is in UI of Arpeggiator else {
lcd.setCursor(7, 0); if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0) // instrument track
lcd.print( seq_chord_names[arp_chord - 200][0]); {
lcd.print( seq_chord_names[arp_chord - 200][1]); if (seq_track_type[d] == 1 || seq_track_type[d] == 3 )
lcd.print( seq_chord_names[arp_chord - 200][2]);
lcd.print( seq_chord_names[arp_chord - 200][3]);
}
for (uint8_t d = 0; d < 4; d++)
{
if ( seq_track_type[d] == 0) { // drum track
if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0)
{ {
handleNoteOn(DRUM_MIDI_CHANNEL, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]); handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]);
} }
} seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
else { seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0) // instrument track if (seq_track_type[d] == 2) { //Chords
{ if (seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 199)
if (seq_track_type[d] == 1 || seq_track_type[d] == 3 )
{ {
handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]); handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][0], seq_chord_velocity);
} handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][1], seq_chord_velocity);
seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose; handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][2], seq_chord_velocity);
seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][3], seq_chord_velocity);
if (seq_track_type[d] == 2) { //Chords
if (seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 199)
{
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][0], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][1], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][2], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][3], seq_chord_velocity);
}
}
else if (seq_track_type[d] == 3) { //Arp
arp_step = 0;
arp_counter = 0;
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
arp_chord = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
} }
} }
else if (seq_track_type[d] == 3) { //Arp
arp_step = 0;
arp_counter = 0;
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
arp_chord = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
}
} }
if (seq_track_type[d] == 3) }
{ //Arp if (seq_track_type[d] == 3)
if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 2) ) { { //Arp
if (arp_step == 0 ) { if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 2) ) {
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + arp_octave * 12 , seq_chord_velocity); if (arp_step == 0 ) {
arp_note_prev = arp_note + arp_octave * 12; handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + arp_octave * 12 , seq_chord_velocity);
arp_note_prev = arp_note + arp_octave * 12;
}
else
{ if (arp_style == 0) { //arp up
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12, seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12;
} }
else else if (arp_style == 3) { //arp random
{ if (arp_style == 0) { //arp up uint8_t rnd1 = random(4);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12, seq_chord_velocity); uint8_t rnd2 = random(arp_oct_usersetting + 1) * 12;
arp_note_prev = arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12; handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord - 200][rnd1] + rnd2, seq_chord_velocity);
} arp_note_prev = arp_note + seq_chords[arp_chord - 200][rnd1] + rnd2;
else if (arp_style == 3) { //arp random
uint8_t rnd1 = random(4);
uint8_t rnd2 = random(arp_oct_usersetting + 1) * 12;
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord - 200][rnd1] + rnd2, seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord - 200][rnd1] + rnd2;
}
} }
} }
} }
seq_noteoffsent[d] = false;
} }
seq_noteoffsent[d] = false;
}
seq_step++; seq_step++;
if (arp_speed == 0) // Arp Speed 1/16 if (arp_speed == 0) // Arp Speed 1/16
{ {
arp_step++; arp_step++;
} }
else else
{
if (arp_speed == 1) // Arp Speed 1/8
{ {
if (arp_speed == 1) // Arp Speed 1/8 if (arp_counter > 1) {
{ arp_counter = 0;
if (arp_counter > 1) { arp_step++;
arp_counter = 0;
arp_step++;
}
arp_counter++;
} }
arp_counter++;
} }
if (arp_step > 3 || seq_chords[arp_chord - 200][arp_step] == 0 ) { }
arp_step = 0; if (arp_step > 3 || seq_chords[arp_chord - 200][arp_step] == 0 ) {
arp_octave++; arp_step = 0;
if (arp_octave > arp_oct_usersetting) arp_octave = 0; arp_octave++;
} if (arp_octave > arp_oct_usersetting) arp_octave = 0;
if (seq_step > 15) { }
seq_step = 0; if (seq_step > 15) {
if (seq_chain_lenght > 0) { seq_step = 0;
seq_chain_active_step++; if (seq_chain_lenght > 0) {
if (seq_chain_active_step > seq_chain_lenght) seq_chain_active_step++;
{ if (seq_chain_active_step > seq_chain_lenght)
seq_chain_active_step = 0; {
} seq_chain_active_step = 0;
} }
} }
} }
if (seq_millis_timer > seq_timer_previous + 80 ) }
void sequencer_part2(void)
{
for (uint8_t d = 0; d < 4; d++)
{ {
for (uint8_t d = 0; d < 4; d++) if ( seq_noteoffsent[d] == false) {
{ if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0)
if ( seq_noteoffsent[d] == false) { {
if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) //test instrument sequencer Instance=0 handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0);
{ if (seq_track_type[d] == 2) { //Chords
handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0); if ( seq_prev_vel[d] > 199) {
if (seq_track_type[d] == 2) { //Chords handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][0], 0);
if ( seq_prev_vel[d] > 199) { handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][1] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][0], 0); handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][2] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][1] , 0); handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][2] , 0);
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0);
}
}
else if (seq_track_type[d] == 3)
{ //Arp
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0);
} }
} }
else if (seq_track_type[d] == 3)
{ //Arp
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0);
}
} }
seq_noteoffsent[d] = true; seq_noteoffsent[d] = true;
} }
} }
} }
void sequencer(void)
{ // Runs in Interrupt Timer. Switches between the Noteon and Noteoff Task, each cycle
interrupt_swapper = !interrupt_swapper;
if (interrupt_swapper) sequencer_part1();
else sequencer_part2();
}

@ -3,15 +3,13 @@ uint8_t seq_active_track = 0;
uint8_t seq_menu; uint8_t seq_menu;
bool seq_button_r = false; bool seq_button_r = false;
bool seq_noteoffsent[4] = {false, false, false, false}; bool seq_noteoffsent[4] = {false, false, false, false};
elapsedMillis seq_millis_timer;
uint8_t seq_step = 0; uint8_t seq_step = 0;
uint32_t seq_timer_previous = 0;
bool seq_running = false; bool seq_running = false;
bool seq_recording = false; bool seq_recording = false;
uint8_t seq_note_in; uint8_t seq_note_in;
uint8_t seq_note_in_velocity; uint8_t seq_note_in_velocity;
int seq_transpose; int seq_transpose;
uint8_t seq_inst_dexed[4] = { 1, 1, 1, 1 }; uint8_t seq_inst_dexed[4] = { 0, 0, 0, 1 };
uint8_t seq_chord_dexed_inst = 0; uint8_t seq_chord_dexed_inst = 0;
uint8_t seq_chord_velocity = 50; uint8_t seq_chord_velocity = 50;
uint8_t arp_style = 0; // up, down, up&down, random uint8_t arp_style = 0; // up, down, up&down, random
@ -64,11 +62,10 @@ uint8_t seq_data[10][16] = {72 , 0 , 0 , 0 , 72 , 0 , 0 , 0 , 72 , 0 , 0
74 , 0 , 0 , 72 , 0 , 0 , 74 , 0 , 0 , 0 , 76 , 0 , 0 , 0 , 0 , 0 , 74 , 0 , 0 , 72 , 0 , 0 , 74 , 0 , 0 , 0 , 76 , 0 , 0 , 0 , 0 , 0 ,
74 , 0 , 0 , 72 , 0 , 0 , 71 , 0 , 0 , 0 , 67 , 0 , 0 , 0 , 0 , 0 , 74 , 0 , 0 , 72 , 0 , 0 , 71 , 0 , 0 , 0 , 67 , 0 , 0 , 0 , 0 , 0 ,
69 , 0 , 0 , 76 , 0 , 0 , 69 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 69 , 0 , 0 , 76 , 0 , 0 , 69 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}; };
uint8_t seq_vel[10][16] = {120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, uint8_t seq_vel[10][16] = {120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0,
105, 80, 105, 70, 106, 98, 106, 70, 126, 97, 106, 70, 106, 99, 90, 65, 105, 80, 105, 70, 106, 98, 106, 70, 126, 97, 106, 70, 106, 99, 90, 65,
120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 120, 50, 120, 120, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 120, 60, 120, 120, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200,
200, 200, 200, 200, 200, 200, 201, 0, 0, 0, 0, 0, 0, 0, 0, 200, 200, 200, 200, 200, 200, 200, 201, 0, 0, 0, 0, 0, 0, 0, 0, 200,
@ -80,8 +77,8 @@ uint8_t seq_vel[10][16] = {120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 120, 0, 0,
uint8_t seq_patternchain[4][4] = { 0 , 1 , 6 , 9 , 0 , 1 , 5 , 8 , 0 , 1 , 6 , 9 , 2 , 1 , 5 , 7 uint8_t seq_patternchain[4][4] = { 0 , 1 , 6 , 9 , 0 , 1 , 5 , 8 , 0 , 1 , 6 , 9 , 2 , 1 , 5 , 7
}; };
uint8_t seq_content_type[10] = { 0, 0, 0, 0 , 1, 2, 2 , 1 , 1 , 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack, 2= Chord or Arpeggio uint8_t seq_content_type[10] = { 0, 0, 0, 0 , 1, 1, 1 , 1 , 1 , 1 }; // 0 = track is Drumtrack, 1= Instrumenttrack, 2= Chord or Arpeggio
uint8_t seq_track_type[4] = { 0, 0, 3, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp uint8_t seq_track_type[4] = { 0, 0, 1, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp
//uint8_t seq_reverb[4][16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //uint8_t seq_reverb[4][16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, // 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0,

Loading…
Cancel
Save