Merge pull request 'Live Recording fixes: fixed note double triggering' (#74) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/74
pull/76/head
Holger Wirtz 3 years ago
commit 07b4e28671
  1. 19
      MicroDexed.ino
  2. 60
      UI.hpp
  3. 31
      UI_FX_T4.h
  4. 5
      dexed_sd.cpp
  5. 4
      midi_devices.hpp
  6. 47
      sequencer.cpp
  7. 25
      sequencer.h

@ -367,7 +367,7 @@ BiquadCoef graphic_eq(7);
extern void getNoteName(char* noteName, uint8_t noteNumber); extern void getNoteName(char* noteName, uint8_t noteNumber);
PeriodicTimer timer1; PeriodicTimer timer1;
extern char seq_chord_names[6][4]; extern char seq_chord_names[7][4];
/*********************************************************************** /***********************************************************************
SETUP SETUP
@ -641,9 +641,7 @@ void setup()
#endif #endif
LCDML.OTHER_jumpToFunc(UI_func_voice_select); LCDML.OTHER_jumpToFunc(UI_func_voice_select);
timer1.begin(sequencer, 90000, false);
timer1.begin(sequencer, 74'000,false);
} }
void loop() void loop()
@ -683,10 +681,10 @@ void setup()
else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_arpeggio)) //is in UI of Arpeggiator else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_arpeggio)) //is in UI of Arpeggiator
{ {
lcd.setCursor(7, 0); lcd.setCursor(7, 0);
lcd.print( seq_chord_names[arp_chord - 200][0]); lcd.print( seq_chord_names[arp_chord][0]);
lcd.print( seq_chord_names[arp_chord - 200][1]); lcd.print( seq_chord_names[arp_chord][1]);
lcd.print( seq_chord_names[arp_chord - 200][2]); lcd.print( seq_chord_names[arp_chord][2]);
lcd.print( seq_chord_names[arp_chord - 200][3]); lcd.print( seq_chord_names[arp_chord][3]);
} }
} }
} }
@ -773,6 +771,9 @@ void setup()
MIDI MESSAGE HANDLER MIDI MESSAGE HANDLER
******************************************************************************/ ******************************************************************************/
void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
{
//Ignore the note when playing & recording the same note into the sequencer
if (seq_recording == false || (seq_recording && inNumber != seq_note_in ))
{ {
// Check for MicroDexed // Check for MicroDexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
@ -823,7 +824,6 @@ void setup()
Serial.print(F("]: ")); Serial.print(F("]: "));
Serial.println(note_name); Serial.println(note_name);
#endif #endif
for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++) for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++)
{ {
if (inNumber == drum_config[d].midinote) if (inNumber == drum_config[d].midinote)
@ -861,6 +861,7 @@ void setup()
} }
#endif #endif
} }
}
#if NUM_DRUMS > 0 #if NUM_DRUMS > 0
uint8_t drum_get_slot(uint8_t dt) uint8_t drum_get_slot(uint8_t dt)

@ -100,6 +100,7 @@ extern uint8_t arp_oct_usersetting;
extern uint8_t arp_style; extern uint8_t arp_style;
extern uint8_t arp_speed; extern uint8_t arp_speed;
extern char arp_style_names[4][3]; extern char arp_style_names[4][3];
extern char seq_chord_names[7][4];
#endif #endif
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
@ -4243,7 +4244,6 @@ void UI_func_seq_vel_editor(uint8_t param)
else if (seq_vel[seq_active_track][seq_menu - 1] == 203) lcd.print("Aug" ); else if (seq_vel[seq_active_track][seq_menu - 1] == 203) lcd.print("Aug" );
else if (seq_vel[seq_active_track][seq_menu - 1] == 204) lcd.print("Dim" ); else if (seq_vel[seq_active_track][seq_menu - 1] == 204) lcd.print("Dim" );
else if (seq_vel[seq_active_track][seq_menu - 1] == 205) lcd.print("Mj7" ); else if (seq_vel[seq_active_track][seq_menu - 1] == 205) lcd.print("Mj7" );
} }
} }
} }
@ -4301,8 +4301,6 @@ void arp_refresh_display_play_status()
} }
} }
void UI_func_sequencer(uint8_t param) void UI_func_sequencer(uint8_t param)
{ {
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -4786,17 +4784,19 @@ void UI_func_arpeggio(uint8_t param)
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
seq_temp_select_menu=0;
seq_temp_active_menu=0; seq_temp_active_menu=0;
lcd.setCursor( 0, 0); lcd.setCursor( 0, 0);
lcd.print("Oct"); lcd.print("Oct");
lcd.setCursor(7, 0);
lcd.print( seq_chord_names[arp_chord][0]);
lcd.print( seq_chord_names[arp_chord][1]);
lcd.print( seq_chord_names[arp_chord][2]);
lcd.print( seq_chord_names[arp_chord][3]);
lcd.setCursor( 0, 1); lcd.setCursor( 0, 1);
lcd.print("Style"); lcd.print("Style");
lcd.setCursor( 7, 0);
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 *********
@ -4830,6 +4830,7 @@ void UI_func_arpeggio(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
arp_speed = constrain(arp_speed - ENCODER[ENC_R].speed(), 0, 1); arp_speed = constrain(arp_speed - ENCODER[ENC_R].speed(), 0, 1);
} }
if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{ {
if ( seq_temp_select_menu == 0 && seq_temp_active_menu == 0 ) if ( seq_temp_select_menu == 0 && seq_temp_active_menu == 0 )
@ -4849,7 +4850,6 @@ 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 ) else if ( seq_temp_select_menu == 2 )
{ {
@ -4880,6 +4880,8 @@ void UI_func_arpeggio(uint8_t param)
} }
} }
} }
lcd.setCursor( 4, 0); lcd.setCursor( 4, 0);
lcd.print(arp_oct_usersetting); lcd.print(arp_oct_usersetting);
lcd.setCursor( 6, 1); lcd.setCursor( 6, 1);
@ -4894,10 +4896,6 @@ void UI_func_arpeggio(uint8_t param)
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);
@ -4910,6 +4908,11 @@ void UI_func_arpeggio(uint8_t param)
} }
else if (seq_temp_select_menu == 1) else if (seq_temp_select_menu == 1)
{ {
lcd.setCursor( 5, 1);
lcd.print("[");
lcd.setCursor( 9, 1);
lcd.print("]");
lcd.setCursor( 3, 0); lcd.setCursor( 3, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor( 5, 0); lcd.setCursor( 5, 0);
@ -4918,10 +4921,6 @@ 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( 5, 1);
lcd.print("[");
lcd.setCursor( 9, 1);
lcd.print("]");
} }
else if (seq_temp_select_menu == 2) else if (seq_temp_select_menu == 2)
{ {
@ -4929,14 +4928,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( 10, 1);
lcd.print(" ");
lcd.setCursor( 15, 1);
lcd.print(" ");
lcd.setCursor( 11, 0); lcd.setCursor( 11, 0);
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(" ");
} }
else if (seq_temp_select_menu == 3) else if (seq_temp_select_menu == 3)
{ {
@ -4944,15 +4943,16 @@ 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( 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("]");
lcd.setCursor( 3, 0);
lcd.print(" ");
lcd.setCursor( 5, 0);
lcd.print(" ");
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
@ -4965,7 +4965,8 @@ void UI_func_seq_pat_chain(uint8_t param)
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
// setup function // setup function
seq_temp_select_menu = 0;
seq_temp_active_menu = 99;
lcd.setCursor( 12, 0); lcd.setCursor( 12, 0);
lcd.print(seq_chain_active_chainstep + 1); lcd.print(seq_chain_active_chainstep + 1);
lcd.setCursor( 13, 0); lcd.setCursor( 13, 0);
@ -4974,22 +4975,22 @@ void UI_func_seq_pat_chain(uint8_t param)
lcd.print(seq_chain_lenght + 1); lcd.print(seq_chain_lenght + 1);
lcd.setCursor(0 , 0); lcd.setCursor(0 , 0);
if (seq_track_type[0] == 0 ) lcd.print("D"); else lcd.print("I"); if (seq_track_type[0] == 0 ) lcd.print("D"); else if (seq_track_type[0] == 1 ) lcd.print("I"); else if (seq_track_type[0] == 2 ) lcd.print("C"); else lcd.print("A");
lcd.setCursor(2 , 0); lcd.setCursor(2 , 0);
lcd.print( seq_patternchain[seq_chain_active_chainstep][0]); lcd.print( seq_patternchain[seq_chain_active_chainstep][0]);
lcd.setCursor(0 , 1); lcd.setCursor(0 , 1);
if (seq_track_type[1] == 0 )lcd.print("D"); else lcd.print("I"); if (seq_track_type[1] == 0 ) lcd.print("D"); else if (seq_track_type[1] == 1 ) lcd.print("I"); else if (seq_track_type[1] == 2 ) lcd.print("C"); else lcd.print("A");
lcd.setCursor(2 , 1); lcd.setCursor(2 , 1);
lcd.print( seq_patternchain[seq_chain_active_chainstep][1]); lcd.print( seq_patternchain[seq_chain_active_chainstep][1]);
lcd.setCursor(6 , 0); lcd.setCursor(6 , 0);
if (seq_track_type[2] == 0 ) lcd.print("D"); else lcd.print("I"); if (seq_track_type[2] == 0 ) lcd.print("D"); else if (seq_track_type[2] == 1 ) lcd.print("I"); else if (seq_track_type[2] == 2 ) lcd.print("C"); else lcd.print("A");
lcd.setCursor(8 , 0); lcd.setCursor(8 , 0);
lcd.print( seq_patternchain[seq_chain_active_chainstep][2]); lcd.print( seq_patternchain[seq_chain_active_chainstep][2]);
lcd.setCursor(6 , 1); lcd.setCursor(6 , 1);
if (seq_track_type[3] == 0 )lcd.print("D"); else lcd.print("I"); if (seq_track_type[3] == 0 ) lcd.print("D"); else if (seq_track_type[3] == 1 ) lcd.print("I"); else if (seq_track_type[3] == 2 ) lcd.print("C"); else lcd.print("A");
lcd.setCursor(8 , 1); lcd.setCursor(8 , 1);
lcd.print( seq_patternchain[seq_chain_active_chainstep][3]); lcd.print( seq_patternchain[seq_chain_active_chainstep][3]);
} }
@ -5021,6 +5022,7 @@ void UI_func_seq_pat_chain(uint8_t param)
seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] = constrain(seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] - 1, 0, 9); seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] = constrain(seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] - 1, 0, 9);
} }
} }
if (seq_temp_select_menu == 0 && seq_temp_active_menu == 99) // Drum 0 if (seq_temp_select_menu == 0 && seq_temp_active_menu == 99) // Drum 0
{ {
lcd.setCursor(1 , 0); lcd.setCursor(1 , 0);

@ -124,19 +124,20 @@ LCDML_add(90, LCDML_0, 5, "Sequencer", NULL);
LCDML_add(91, LCDML_0_5, 1, "Sequencer", UI_func_sequencer); LCDML_add(91, LCDML_0_5, 1, "Sequencer", UI_func_sequencer);
LCDML_add(92, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); LCDML_add(92, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor);
LCDML_add(93, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); LCDML_add(93, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain);
LCDML_add(94, LCDML_0_5, 4, "Seq. Length", UI_func_seq_lenght); LCDML_add(94, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio);
LCDML_add(95, LCDML_0_5, 5, "Tempo", UI_func_seq_tempo); LCDML_add(95, LCDML_0_5, 5, "Seq. Length", UI_func_seq_lenght);
LCDML_add(96, LCDML_0_5, 6, "L.Transp.Key", UI_func_seq_live_transpose_oct); LCDML_add(96, LCDML_0_5, 6, "Tempo", UI_func_seq_tempo);
LCDML_add(97, LCDML_0_5, 7, "Track Setup", UI_func_seq_track_setup); LCDML_add(97, LCDML_0_5, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct);
LCDML_add(98, LCDML_0_5, 8, "Seq.Disp.Style", UI_func_seq_display_style); LCDML_add(98, LCDML_0_5, 8, "Track Setup", UI_func_seq_track_setup);
LCDML_add(99, LCDML_0_5, 9, "LOAD Patterns", UI_func_seq_pattern_load); LCDML_add(99, LCDML_0_5, 9, "Seq.Disp.Style", UI_func_seq_display_style);
LCDML_add(100, LCDML_0_5, 10, "SAVE Patterns", UI_func_seq_pattern_save); LCDML_add(100, LCDML_0_5, 10, "LOAD Patterns", UI_func_seq_pattern_load);
LCDML_add(101, LCDML_0, 6, "System", NULL); LCDML_add(101, LCDML_0_5, 11, "SAVE Patterns", UI_func_seq_pattern_save);
LCDML_add(102, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); LCDML_add(102, LCDML_0, 6, "System", NULL);
LCDML_add(103, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); LCDML_add(103, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(104, LCDML_0_6, 3, "Favorites", UI_func_favorites); LCDML_add(104, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(105, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset); LCDML_add(105, LCDML_0_6, 3, "Favorites", UI_func_favorites);
LCDML_add(106, LCDML_0, 7, "Info", UI_func_information); LCDML_add(106, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_addAdvanced(107, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); LCDML_add(107, LCDML_0, 7, "Info", UI_func_information);
#define _LCDML_DISP_cnt 107 LCDML_addAdvanced(108, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 108
#endif #endif

@ -830,8 +830,6 @@ bool save_sd_seq_json(uint8_t seq_number)
for (uint8_t i = 0; i < MAX_DEXED; i++) for (uint8_t i = 0; i < MAX_DEXED; i++)
{ {
data_json["reverb_send"][i] = configuration.fx.reverb_send[i]; data_json["reverb_send"][i] = configuration.fx.reverb_send[i];
data_json["perform_attack_mod"][i] = perform_attack_mod[i];
data_json["perform_release_mod"][i] = perform_release_mod[i];
} }
data_json["reverb_roomsize"] = configuration.fx.reverb_roomsize; data_json["reverb_roomsize"] = configuration.fx.reverb_roomsize;
@ -955,9 +953,6 @@ bool load_sd_seq_json(uint8_t seq_number)
for (uint8_t i = 0; i < MAX_DEXED; i++) for (uint8_t i = 0; i < MAX_DEXED; i++)
{ {
configuration.fx.reverb_send[i] = data_json["reverb_send"][i]; configuration.fx.reverb_send[i] = data_json["reverb_send"][i];
//perform_attack_mod[i] = data_json["perform_attack_mod"][i];
//perform_release_mod[i] = data_json["perform_release_mod"][i];
} }
configuration.fx.reverb_roomsize = data_json["reverb_roomsize"]; configuration.fx.reverb_roomsize = data_json["reverb_roomsize"];
configuration.fx.reverb_damping = data_json["reverb_damping"]; configuration.fx.reverb_damping = data_json["reverb_damping"];

@ -83,9 +83,9 @@ void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value);
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity) void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity)
{ {
handleNoteOn(inChannel, inNumber, inVelocity);
seq_note_in=inNumber; seq_note_in=inNumber;
seq_note_in_velocity=inVelocity; seq_note_in_velocity=inVelocity;
handleNoteOn(inChannel, inNumber, inVelocity);
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] NoteOn")); Serial.print(F("[MIDI_DIN] NoteOn"));
#endif #endif
@ -584,9 +584,9 @@ void handleSystemReset_MIDI_DEVICE_DIN(void)
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity) void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity)
{ {
handleNoteOn(inChannel, inNumber, inVelocity);
seq_note_in=inNumber; seq_note_in=inNumber;
seq_note_in_velocity=inVelocity; seq_note_in_velocity=inVelocity;
handleNoteOn(inChannel, inNumber, inVelocity);
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] NoteOn")); Serial.print(F("[MIDI_USB_HOST] NoteOn"));
#endif #endif

@ -25,18 +25,13 @@ void sequencer_part1(void)
//seq_note_in = 0; //seq_note_in = 0;
//} //}
// if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sequencer)) { //is in UI of Sequencer //record to sequencer if sequencer menu is active and recording is active
if (seq_note_in > 0 && seq_recording == true && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sequencer)) {
//write to sequencer if in sequencer menu seq_data[seq_active_track][seq_step] = seq_note_in;
// if (seq_note_in > 0 && seq_recording == true) { seq_vel[seq_active_track][seq_step] = seq_note_in_velocity;
// seq_note_in = 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); seq_note_in_velocity = 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;
// }
for (uint8_t d = 0; d < 4; d++) for (uint8_t d = 0; d < 4; d++)
{ {
@ -49,7 +44,7 @@ void sequencer_part1(void)
else { else {
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_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] == 1 || seq_track_type[d] == 3 ) if (seq_track_type[d] == 1 || (seq_track_type[d] == 3 && arp_play_basenote) )
{ {
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_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]);
} }
@ -68,36 +63,37 @@ void sequencer_part1(void)
arp_step = 0; arp_step = 0;
arp_counter = 0; arp_counter = 0;
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose; 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_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200 >= 0)
arp_chord = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200;
} }
} }
} }
if (seq_track_type[d] == 3) if (seq_track_type[d] == 3)
{ //Arp { //Arp
if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 2) ) { if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 0) ) {
if (arp_step == 0 ) {
if (arp_step % 8 == 0 ) {
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + arp_octave * 12 , seq_chord_velocity); 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; arp_note_prev = arp_note + arp_octave * 12;
} }
else else
{ if (arp_style == 0) { //arp up { 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); handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord][arp_step] + arp_octave * 12, seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord - 200][arp_step - 1] + arp_octave * 12; arp_note_prev = arp_note + seq_chords[arp_chord][arp_step] + arp_octave * 12;
} }
else if (arp_style == 3) { //arp random else if (arp_style == 3) { //arp random
uint8_t rnd1 = random(4); uint8_t rnd1 = random(4);
uint8_t rnd2 = random(arp_oct_usersetting + 1) * 12; 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); handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord][rnd1] + rnd2, seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord - 200][rnd1] + rnd2; arp_note_prev = arp_note + seq_chords[arp_chord][rnd1] + rnd2;
} }
} }
} }
} }
seq_noteoffsent[d] = false; seq_noteoffsent[d] = false;
} }
arp_counter++;
seq_step++; seq_step++;
if (arp_speed == 0) // Arp Speed 1/16 if (arp_speed == 0) // Arp Speed 1/16
{ {
arp_step++; arp_step++;
@ -110,13 +106,14 @@ void sequencer_part1(void)
arp_counter = 0; arp_counter = 0;
arp_step++; arp_step++;
} }
arp_counter++;
} }
} }
if (arp_step > 3 || seq_chords[arp_chord - 200][arp_step] == 0 ) { //if (arp_step > 3 || seq_chords[arp_chord][arp_step] == 0 ) {
if (arp_step > 3 || seq_chords[arp_chord][arp_step] == 0 ) {
arp_step = 0; arp_step = 0;
arp_octave++; arp_octave++;
if (arp_octave > arp_oct_usersetting) arp_octave = 0; if (arp_octave >= arp_oct_usersetting) arp_octave = 0;
} }
if (seq_step > 15) { if (seq_step > 15) {
seq_step = 0; seq_step = 0;

@ -9,23 +9,25 @@ 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] = { 0, 0, 0, 1 }; uint8_t seq_inst_dexed[4] = { 0, 0, 1, 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
uint8_t seq_chords[6][4] = { 4, 7, 12, 0, //major uint8_t seq_chords[7][4] = { 4, 7, 0, 0, //major
3, 7, 12, 0, //minor 3, 7, 0, 0, //minor
4, 7, 10, 12, //seventh 4, 7, 10, 0, //seventh
4, 8, 12, 0, //augmented 4, 8, 0, 0, //augmented
3, 6, 12, 0, //dim 3, 6, 0 , 0, //dim
4, 7, 11 , 0 //maj7, 4, 7, 11, 0, //maj7,
0, 0, 0 , 0 //no Chord
}; };
char seq_chord_names[6][4] = { 'M', 'a', 'j', ' ' , //major char seq_chord_names[7][4] = { 'M', 'a', 'j', ' ' , //major
'M', 'i', 'n', ' ' , 'M', 'i', 'n', ' ' ,
's', 'e', 'v', ' ' , 's', 'e', 'v', ' ' ,
'a', 'u', 'g', ' ' , 'a', 'u', 'g', ' ' ,
'd', 'i', 'm', ' ' , 'd', 'i', 'm', ' ' ,
'M', 'a', 'j', '7' , 'M', 'a', 'j', '7' ,
'N', 'o', 'C', 'd' ,
}; };
@ -39,13 +41,14 @@ int seq_bpm = 102;
uint8_t seq_temp_select_menu; uint8_t seq_temp_select_menu;
uint8_t seq_temp_active_menu = 99; uint8_t seq_temp_active_menu = 99;
uint8_t seq_chain_active_chainstep; uint8_t seq_chain_active_chainstep;
uint8_t seq_chain_lenght = 3; // 0 = 16 steps, 1 = 32 Steps, 2 = 46 Steps, 3 = 64 Steps uint8_t seq_chain_lenght = 0; // 0 = 16 steps, 1 = 32 Steps, 2 = 46 Steps, 3 = 64 Steps
uint8_t seq_chain_active_step = 0; uint8_t seq_chain_active_step = 0;
uint8_t seq_prev_note[4]; // note_offs for every (instr.) track uint8_t seq_prev_note[4]; // note_offs for every (instr.) track
uint8_t seq_prev_vel[4]; uint8_t seq_prev_vel[4];
uint8_t arp_step; uint8_t arp_step;
uint8_t arp_note; uint8_t arp_note;
uint8_t arp_chord; uint8_t arp_chord = 6;
bool arp_play_basenote=true;
uint8_t arp_note_prev; uint8_t arp_note_prev;
uint8_t arp_octave; uint8_t arp_octave;
uint8_t arp_prev_oct; uint8_t arp_prev_oct;
@ -78,7 +81,7 @@ 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, 1, 1 , 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, 1, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp uint8_t seq_track_type[4] = { 0, 0, 0, 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