Merge pull request 'fixed small menu-renumbering error' (#3) from positionhigh-patch-1 into dev

Reviewed-on: https://codeberg.org/positionhigh/MicroDexed/pulls/3
pull/76/head
positionhigh 3 years ago
commit 2f1d304044
  1. 39
      dexed_sd.cpp
  2. 43
      sequencer.cpp
  3. 29
      sequencer.h

@ -1158,25 +1158,6 @@ bool save_sd_seq_json(uint8_t seq_number)
data_json["seq_oct_shift"] = seq_oct_shift; data_json["seq_oct_shift"] = seq_oct_shift;
data_json["seq_element_shift"] = seq_element_shift; data_json["seq_element_shift"] = seq_element_shift;
/*
<<<<<<< HEAD
data_json["reverb_roomsize"] = configuration.fx.reverb_roomsize;
data_json["reverb_damping"] = configuration.fx.reverb_damping;
data_json["reverb_lowpass"] = configuration.fx.reverb_lowpass;
data_json["reverb_lodamp"] = configuration.fx.reverb_lodamp;
data_json["reverb_hidamp"] = configuration.fx.reverb_hidamp;
data_json["reverb_diffusion"] = configuration.fx.reverb_diffusion;
data_json["reverb_level"] = configuration.fx.reverb_level;
data_json["eq_1"] = configuration.fx.eq_1;
data_json["eq_2"] = configuration.fx.eq_2;
data_json["eq_3"] = configuration.fx.eq_3;
data_json["eq_4"] = configuration.fx.eq_4;
data_json["eq_5"] = configuration.fx.eq_5;
data_json["eq_6"] = configuration.fx.eq_6;
data_json["eq_7"] = configuration.fx.eq_7;
=======
*/
for (uint8_t i = 0; i < sizeof(seq_track_type); i++) { for (uint8_t i = 0; i < sizeof(seq_track_type); i++) {
data_json["track_type"][i] = seq_track_type[i]; data_json["track_type"][i] = seq_track_type[i];
} }
@ -1187,7 +1168,6 @@ bool save_sd_seq_json(uint8_t seq_number)
data_json["seq_inst_dexed"][i] = seq_inst_dexed[i]; data_json["seq_inst_dexed"][i] = seq_inst_dexed[i];
} }
//>>>>>>> 4af597461ea0ae5e49069d309862018eb651ccb4
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Write JSON data:")); Serial.println(F("Write JSON data:"));
serializeJsonPretty(data_json, Serial); serializeJsonPretty(data_json, Serial);
@ -1296,24 +1276,6 @@ bool load_sd_seq_json(uint8_t seq_number)
for (uint8_t i = 0; i < sizeof(seq_inst_dexed); i++) { for (uint8_t i = 0; i < sizeof(seq_inst_dexed); i++) {
seq_inst_dexed[i] = data_json["seq_inst_dexed"][i]; seq_inst_dexed[i] = data_json["seq_inst_dexed"][i];
} }
/*
<<<<<<< HEAD
configuration.fx.reverb_roomsize = data_json["reverb_roomsize"];
configuration.fx.reverb_damping = data_json["reverb_damping"];
configuration.fx.reverb_lowpass = data_json["reverb_lowpass"];
configuration.fx.reverb_lodamp = data_json["reverb_lodamp"];
configuration.fx.reverb_hidamp = data_json["reverb_hidamp"];
configuration.fx.reverb_diffusion = data_json["reverb_diffusion"];
configuration.fx.reverb_level = data_json["reverb_level"];
configuration.fx.eq_1 = data_json["eq_1"];
configuration.fx.eq_2 = data_json["eq_2"];
configuration.fx.eq_3 = data_json["eq_3"];
configuration.fx.eq_4 = data_json["eq_4"];
configuration.fx.eq_5 = data_json["eq_5"];
configuration.fx.eq_6 = data_json["eq_6"];
configuration.fx.eq_7 = data_json["eq_7"];
=======
*/
count = 0; count = 0;
seq_tempo_ms = data_json["seq_tempo_ms"] ; seq_tempo_ms = data_json["seq_tempo_ms"] ;
@ -1329,7 +1291,6 @@ bool load_sd_seq_json(uint8_t seq_number)
seq_chord_key_ammount = data_json["chord_key_ammount"]; seq_chord_key_ammount = data_json["chord_key_ammount"];
seq_oct_shift = data_json["seq_oct_shift"]; seq_oct_shift = data_json["seq_oct_shift"];
seq_element_shift = data_json["seq_element_shift"]; seq_element_shift = data_json["seq_element_shift"];
//>>>>>>> 4af597461ea0ae5e49069d309862018eb651ccb4
//set_fx_params(); //set_fx_params();

@ -83,10 +83,26 @@ void sequencer_part1(void)
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][arp_step + seq_element_shift] , seq_chord_velocity); handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][arp_step + seq_element_shift] , seq_chord_velocity);
arp_note_prev = arp_note + seq_arps[arp_chord][arp_step + seq_element_shift] ; arp_note_prev = arp_note + seq_arps[arp_chord][arp_step + seq_element_shift] ;
} }
else if (arp_style == 1) { //arp down
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][10 - arp_step + seq_element_shift] , seq_chord_velocity);
arp_note_prev = arp_note + seq_arps[arp_chord][10 - arp_step + seq_element_shift] ;
}
else if (arp_style == 2) { //arp up & down
if (seq_step < arp_lenght) {
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][arp_step+1] , seq_chord_velocity);
arp_note_prev = arp_note + seq_arps[arp_chord][arp_step +1] ;
}
else {
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][arp_lenght*2-2 - arp_step ] , seq_chord_velocity);
arp_note_prev = arp_note + seq_arps[arp_chord][arp_lenght*2- - arp_step ] ;
}
}
else if (arp_style == 3) { //arp random else if (arp_style == 3) { //arp random
uint8_t rnd1 = random(5); uint8_t rnd1 = random(arp_lenght);
handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_chords[arp_chord][rnd1] + (seq_oct_shift * 12), seq_chord_velocity); handleNoteOn(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note + seq_arps[arp_chord][rnd1 + seq_element_shift] + (seq_oct_shift * 12), seq_chord_velocity);
arp_note_prev = arp_note + seq_chords[arp_chord][rnd1] + (seq_oct_shift * 12); arp_note_prev = arp_note + seq_arps[arp_chord][rnd1 + seq_element_shift] + (seq_oct_shift * 12);
} }
} }
} }
@ -110,11 +126,24 @@ void sequencer_part1(void)
} }
} }
} }
if ( (arp_step > 1 && seq_arps[arp_chord][arp_step] == 0) || arp_step == arp_lenght)
{ if (arp_style != 2){
arp_step = 0;
if ( (arp_step > 1 && seq_arps[arp_chord][arp_step] == 0) || arp_step == arp_lenght)
{
arp_step = 0;
}
}
else
{
if ( (arp_step > 1 && seq_arps[arp_chord][arp_step] == 0) || arp_step == arp_lenght*2)
{
arp_step = 0;
}
} }
if (seq_step > 15) if (seq_step > 15)
{ {
seq_step = 0; seq_step = 0;
if (seq_chain_lenght > 0) { if (seq_chain_lenght > 0) {

@ -14,25 +14,17 @@ 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 = 60; uint8_t seq_chord_velocity = 60;
uint8_t seq_chord_key_ammount = 4; uint8_t seq_chord_key_ammount = 4;
uint8_t seq_element_shift=0; uint8_t seq_element_shift = 0;
int seq_oct_shift=0; int seq_oct_shift = 0;
uint8_t arp_style = 0; // up, down, up&down, random uint8_t arp_style = 0; // up, down, up&down, random
uint8_t seq_chords[7][4] = { 4, 7, 0, 0, //major
3, 7, 0, 0, //minor
4, 7, 10, 0, //seventh
4, 8, 0, 0, //augmented
3, 6, 0 , 0, //dim
4, 7, 11, 0, //maj7,
0, 0, 0 , 0 //no Chord
};
uint8_t seq_arps[7][22] = { //up
0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43, 48, 52, 55, 60 ,99,0,0,0,0,0,//major
0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43, 48, 51, 55, 60 ,99,0,0,0,0,0,//minor
0, 4, 7, 10, 12, 16, 19, 22, 24, 28, 31, 34, 36, 40, 43, 46, 48, 52, 55, 58, 60 ,99,//seventh
0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60 ,99,0,0,0,0,0,//augmented
0, 3, 6, 12, 15, 18, 24, 27, 30, 36, 39, 42, 48, 51, 54, 60 ,99,0,0,0,0,0,//dim
0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35, 36, 40, 43, 47, 48, 52, 55, 59, 60 ,99//maj7
uint8_t seq_arps[7][23] = {
0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43, 48, 52, 55, 60, 64, 67, 72, 76, 79, 84, 0, //major
0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43, 48, 51, 55, 60, 63, 67, 72, 75, 79, 84, 0, //minor
0, 4, 7, 10, 12, 16, 19, 22, 24, 28, 31, 34, 36, 40, 43, 46, 48, 52, 55, 58, 60, 64, 0, //seventh
0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 0, //augmented
0, 3, 6, 12, 15, 18, 24, 27, 30, 36, 39, 42, 48, 51, 54, 60, 63, 66, 72, 75, 78, 84, 0, //dim
0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35, 36, 40, 43, 47, 48, 52, 55, 59, 60, 64, 0 //maj7
}; };
char seq_chord_names[7][4] = { 'M', 'a', 'j', ' ' , //major char seq_chord_names[7][4] = { 'M', 'a', 'j', ' ' , //major
@ -44,7 +36,6 @@ char seq_chord_names[7][4] = { 'M', 'a', 'j', ' ' , //major
'N', 'o', 'C', 'd' , 'N', 'o', 'C', 'd' ,
}; };
char arp_style_names[4][3] = { 'u', 'p', ' ', char arp_style_names[4][3] = { 'u', 'p', ' ',
'd', 'w', 'n', 'd', 'w', 'n',
'u', '&', 'd', 'u', '&', 'd',
@ -95,7 +86,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, 2, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp uint8_t seq_track_type[4] = { 0, 0, 3, 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