diff --git a/MicroDexed.ino b/MicroDexed.ino index 4215b68..69c3fa2 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -605,6 +605,8 @@ void setup() #if NUM_DRUMS > 0 master_mixer_r.gain(2, VOL_MAX_FLOAT); master_mixer_l.gain(2, VOL_MAX_FLOAT); + drums_volume = VOL_MAX_FLOAT; + #else master_mixer_r.gain(2, 0.0); master_mixer_l.gain(2, 0.0); diff --git a/UI_FX.h b/UI_FX.h index 9be0d1f..3db2fd5 100644 --- a/UI_FX.h +++ b/UI_FX.h @@ -122,20 +122,21 @@ LCDML_add(88, LCDML_0_5, 1, "Sequencer", UI_func_sequencer); LCDML_add(89, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); LCDML_add(90, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); LCDML_add(91, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); -LCDML_add(92, LCDML_0_5, 5, "Seq. Length", UI_func_seq_lenght); -LCDML_add(93, LCDML_0_5, 6, "Tempo", UI_func_seq_tempo); -LCDML_add(94, LCDML_0_5, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); -LCDML_add(95, LCDML_0_5, 8, "L.Trp.Offset", NULL); -LCDML_add(96, LCDML_0_5, 9, "Track Setup", UI_func_seq_track_setup); -LCDML_add(97, LCDML_0_5, 10, "Seq.Disp.Style", UI_func_seq_display_style); -LCDML_add(98, LCDML_0_5, 11, "LOAD Patterns", UI_func_seq_pattern_load); -LCDML_add(99, LCDML_0_5, 12, "SAVE Patterns", UI_func_seq_pattern_save); -LCDML_add(100, LCDML_0, 6, "System", NULL); -LCDML_add(101, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(102, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(103, LCDML_0_6, 3, "Favorites", UI_func_favorites); -LCDML_add(104, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset); -LCDML_add(105, LCDML_0, 7, "Info", UI_func_information); -LCDML_addAdvanced(106, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 106 +LCDML_add(92, LCDML_0_5, 5, "Seq. Settings", NULL); +LCDML_add(93, LCDML_0_5_5, 1, "Tempo", UI_func_seq_tempo); +LCDML_add(94, LCDML_0_5_5, 2, "Seq. Length", UI_func_seq_lenght); +LCDML_add(95, LCDML_0_5_5, 3, "Track Setup", UI_func_seq_track_setup); +LCDML_add(96, LCDML_0_5_5, 4, "Seq.Disp.Style", UI_func_seq_display_style); +LCDML_add(97, LCDML_0_5_5, 5, "dexed assign", UI_func_dexed_assign); +LCDML_add(98, LCDML_0_5_5, 6, "L.Transp.Key", UI_func_seq_live_transpose_oct); +LCDML_add(99, LCDML_0_5, 6, "LOAD Seq.Data", UI_func_seq_pattern_load); +LCDML_add(100, LCDML_0_5, 7, "SAVE Seq.Data", UI_func_seq_pattern_save); +LCDML_add(101, LCDML_0, 6, "System", NULL); +LCDML_add(102, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(103, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(104, LCDML_0_6, 3, "Favorites", UI_func_favorites); +LCDML_add(105, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset); +LCDML_add(106, LCDML_0, 7, "Info", UI_func_information); +LCDML_addAdvanced(107, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); +#define _LCDML_DISP_cnt 107 #endif diff --git a/UI_FX_T4.h b/UI_FX_T4.h index 7519e5c..990ff47 100644 --- a/UI_FX_T4.h +++ b/UI_FX_T4.h @@ -116,7 +116,7 @@ LCDML_add(82, LCDML_0_3_5, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); LCDML_add(83, LCDML_0_3_5, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); LCDML_add(84, LCDML_0_3_5, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); LCDML_add(85, LCDML_0, 4, "Drums", NULL); -LCDML_add(86, LCDML_0_4, 1, "Drums Main Vol", UI_func_drum_main_volume); +LCDML_add(86, LCDML_0_4, 1, "Drums Main Vol", UI_func_drums_main_volume); LCDML_add(87, LCDML_0_4, 2, "Drum Volumes", UI_func_drum_volume); LCDML_add(88, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan); LCDML_add(89, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); @@ -125,19 +125,21 @@ 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(93, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); LCDML_add(94, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); -LCDML_add(95, LCDML_0_5, 5, "Seq. Length", UI_func_seq_lenght); -LCDML_add(96, LCDML_0_5, 6, "Tempo", UI_func_seq_tempo); -LCDML_add(97, LCDML_0_5, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); -LCDML_add(98, LCDML_0_5, 8, "Track Setup", UI_func_seq_track_setup); -LCDML_add(99, LCDML_0_5, 9, "Seq.Disp.Style", UI_func_seq_display_style); -LCDML_add(100, LCDML_0_5, 10, "LOAD Patterns", UI_func_seq_pattern_load); -LCDML_add(101, LCDML_0_5, 11, "SAVE Patterns", UI_func_seq_pattern_save); -LCDML_add(102, LCDML_0, 6, "System", NULL); -LCDML_add(103, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(104, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(105, LCDML_0_6, 3, "Favorites", UI_func_favorites); -LCDML_add(106, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset); -LCDML_add(107, LCDML_0, 7, "Info", UI_func_information); -LCDML_addAdvanced(108, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 108 +LCDML_add(95, LCDML_0_5, 5, "Seq. Settings", NULL); +LCDML_add(96, LCDML_0_5_5, 1, "Tempo", UI_func_seq_tempo); +LCDML_add(97, LCDML_0_5_5, 2, "Seq. Length", UI_func_seq_lenght); +LCDML_add(98, LCDML_0_5_5, 3, "Track Setup", UI_func_seq_track_setup); +LCDML_add(99, LCDML_0_5_5, 4, "Seq.Disp.Style", UI_func_seq_display_style); +LCDML_add(100, LCDML_0_5_5, 5, "dexed assign", UI_func_dexed_assign); +LCDML_add(101, LCDML_0_5_5, 6, "L.Transp.Key", UI_func_seq_live_transpose_oct); +LCDML_add(102, LCDML_0_5, 6, "LOAD Seq.Data", UI_func_seq_pattern_load); +LCDML_add(103, LCDML_0_5, 7, "SAVE Seq.Data", UI_func_seq_pattern_save); +LCDML_add(104, LCDML_0, 6, "System", NULL); +LCDML_add(105, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(106, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(107, LCDML_0_6, 3, "Favorites", UI_func_favorites); +LCDML_add(108, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset); +LCDML_add(109, LCDML_0, 7, "Info", UI_func_information); +LCDML_addAdvanced(110, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); +#define _LCDML_DISP_cnt 110 #endif diff --git a/UI_NO_FX.h b/UI_NO_FX.h index bd1e467..f82d44d 100644 --- a/UI_NO_FX.h +++ b/UI_NO_FX.h @@ -85,29 +85,32 @@ LCDML_add(51, LCDML_0_2, 4, "MIDI", NULL); LCDML_add(52, LCDML_0_2_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); LCDML_add(53, LCDML_0_2_4, 2, "MIDI Snd Bank", UI_func_sysex_send_bank); LCDML_add(54, LCDML_0_2_4, 3, "MIDI Snd Voice", UI_func_sysex_send_voice); -LCDML_add(55, LCDML_0, 3, "Drum", NULL); -LCDML_add(56, LCDML_0_3, 1, "Drums Main Vol", UI_func_drum_main_volume); -LCDML_add(57, LCDML_0_3, 2, "Drum Volumes", UI_func_drum_volume); -LCDML_add(58, LCDML_0_3, 3, "Drum Pan", UI_func_drum_pan); -LCDML_add(59, LCDML_0, 4, "Sequencer", NULL); -LCDML_add(60, LCDML_0_4, 1, "Sequencer", UI_func_sequencer); -LCDML_add(61, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); -LCDML_add(62, LCDML_0_4, 3, "Pattern Chain", UI_func_seq_pat_chain); -LCDML_add(63, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); -LCDML_add(64, LCDML_0_4, 5, "Seq. Length", UI_func_seq_lenght); -LCDML_add(65, LCDML_0_4, 6, "Tempo", UI_func_seq_tempo); -LCDML_add(66, LCDML_0_4, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); -LCDML_add(67, LCDML_0_5, 8, "Track Setup", UI_func_seq_track_setup); -LCDML_add(68, LCDML_0_5, 9, "Seq.Disp.Style", UI_func_seq_display_style); -LCDML_add(69, LCDML_0_4, 10, "LOAD Patterns", UI_func_seq_pattern_load); -LCDML_add(70, LCDML_0_4, 11, "SAVE Patterns", UI_func_seq_pattern_save); -LCDML_add(71, LCDML_0, 5, "System", NULL); -LCDML_add(72, LCDML_0_5, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(73, LCDML_0_5, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(74, LCDML_0_5, 3, "Favorites", UI_func_favorites); -LCDML_add(75, LCDML_0_5, 4, "EEPROM Reset", UI_func_eeprom_reset); -LCDML_add(76, LCDML_0, 6, "Info", UI_func_information); -LCDML_addAdvanced(77, LCDML_0, 5, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 77 +LCDML_add(55, LCDML_0, 4, "Drums", NULL); +LCDML_add(56, LCDML_0_4, 1, "Drums Main Vol", UI_func_drums_main_volume); +LCDML_add(57, LCDML_0_4, 2, "Drum Volumes", UI_func_drum_volume); +LCDML_add(58, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan); +LCDML_add(59, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); +LCDML_add(60, LCDML_0, 5, "Sequencer", NULL); +LCDML_add(61, LCDML_0_5, 1, "Sequencer", UI_func_sequencer); +LCDML_add(62, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); +LCDML_add(63, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); +LCDML_add(64, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); +LCDML_add(65, LCDML_0_5, 5, "Seq. Settings", NULL); +LCDML_add(66, LCDML_0_5_5, 1, "Tempo", UI_func_seq_tempo); +LCDML_add(67, LCDML_0_5_5, 2, "Seq. Length", UI_func_seq_lenght); +LCDML_add(68, LCDML_0_5_5, 3, "Track Setup", UI_func_seq_track_setup); +LCDML_add(69, LCDML_0_5_5, 4, "Seq.Disp.Style", UI_func_seq_display_style); +LCDML_add(70, LCDML_0_5_5, 5, "dexed assign", UI_func_dexed_assign); +LCDML_add(71, LCDML_0_5_5, 6, "L.Transp.Key", UI_func_seq_live_transpose_oct); +LCDML_add(72, LCDML_0_5, 6, "LOAD Seq.Data", UI_func_seq_pattern_load); +LCDML_add(73, LCDML_0_5, 7, "SAVE Seq.Data", UI_func_seq_pattern_save); +LCDML_add(74, LCDML_0, 5, "System", NULL); +LCDML_add(75, LCDML_0_5, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(76, LCDML_0_5, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(77, LCDML_0_5, 3, "Favorites", UI_func_favorites); +LCDML_add(78, LCDML_0_5, 4, "EEPROM Reset", UI_func_eeprom_reset); +LCDML_add(79, LCDML_0, 6, "Info", UI_func_information); +LCDML_addAdvanced(80, LCDML_0, 5, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); +#define _LCDML_DISP_cnt 80 #endif diff --git a/sequencer.cpp b/sequencer.cpp index 6255758..2e0bf02 100644 --- a/sequencer.cpp +++ b/sequencer.cpp @@ -36,56 +36,60 @@ void sequencer_part1(void) 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) + if (seq_data[ 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]); } } 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 ) // instrument track { 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_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; - seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; - 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] == 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); + + handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step], seq_chord_velocity); // basenote + + for (uint8_t x = 0; x < 3; x++) //play chord notes + { + handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][x], 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_note = seq_data[ 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; } + seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; + seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; } - } - if (seq_track_type[d] == 3) - { //Arp - if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 0) ) { + else if (seq_track_type[d] == 3) + { //Arp + if (arp_speed == 0 || (arp_speed == 1 && arp_counter == 0) ) { - if (arp_step % 8 == 0 ) { - 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][arp_step] + arp_octave * 12, seq_chord_velocity); - arp_note_prev = arp_note + seq_chords[arp_chord][arp_step] + arp_octave * 12; + if (arp_step % 8 == 0 ) { + 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 == 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][rnd1] + rnd2, seq_chord_velocity); - arp_note_prev = arp_note + seq_chords[arp_chord][rnd1] + rnd2; + else + { if (arp_style == 0) { //arp up + 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][arp_step] + arp_octave * 12; + } + 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][rnd1] + rnd2, seq_chord_velocity); + arp_note_prev = arp_note + seq_chords[arp_chord][rnd1] + rnd2; + } } } } @@ -137,10 +141,11 @@ void sequencer_part2(void) handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0); if (seq_track_type[d] == 2) { //Chords 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][0], 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][2] , 0); - handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0); + + for (uint8_t x = 0; x < 3; x++) //play chord notes + { + handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][x], 0); + } } } else if (seq_track_type[d] == 3)