|
|
|
@ -52,6 +52,7 @@ extern int seq_transpose; |
|
|
|
|
extern int seq_tempo_ms ; |
|
|
|
|
extern int seq_bpm; |
|
|
|
|
extern bool arp_play_basenote; |
|
|
|
|
extern bool seq_running; |
|
|
|
|
extern uint8_t arp_speed; |
|
|
|
|
extern uint8_t arp_lenght; |
|
|
|
|
extern uint8_t arp_style; |
|
|
|
@ -979,6 +980,7 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
data_json["chord_key_ammount"] = seq_chord_key_ammount; |
|
|
|
|
data_json["seq_oct_shift"] = seq_oct_shift; |
|
|
|
|
data_json["seq_element_shift"] = seq_element_shift; |
|
|
|
|
data_json["performance"] = configuration.sys.performance_number; |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < sizeof(seq_track_type); i++) { |
|
|
|
|
data_json["track_type"][i] = seq_track_type[i]; |
|
|
|
@ -1046,7 +1048,7 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
deserializeJson(data_json, json); |
|
|
|
|
|
|
|
|
|
json.close(); |
|
|
|
|
|
|
|
|
|
AudioInterrupts(); |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(F("Read JSON data:")); |
|
|
|
@ -1093,7 +1095,6 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
for (uint8_t i = 0; i < sizeof(seq_inst_dexed); i++) { |
|
|
|
|
seq_inst_dexed[i] = data_json["seq_inst_dexed"][i]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
count = 0; |
|
|
|
|
seq_tempo_ms = data_json["seq_tempo_ms"] ; |
|
|
|
|
seq_bpm = data_json["seq_bpm"]; |
|
|
|
@ -1108,10 +1109,15 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
seq_chord_key_ammount = data_json["chord_key_ammount"]; |
|
|
|
|
seq_oct_shift = data_json["seq_oct_shift"]; |
|
|
|
|
seq_element_shift = data_json["seq_element_shift"]; |
|
|
|
|
configuration.sys.performance_number = data_json["performance"]; |
|
|
|
|
load_sd_performance_json(configuration.sys.performance_number); |
|
|
|
|
|
|
|
|
|
if (seq_running) |
|
|
|
|
timer1.begin(sequencer, seq_tempo_ms / 2); |
|
|
|
|
else |
|
|
|
|
timer1.begin(sequencer, seq_tempo_ms / 2, false); |
|
|
|
|
|
|
|
|
|
return (true); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
else |
|
|
|
@ -1138,7 +1144,7 @@ bool check_sd_seq_exists(uint8_t number) |
|
|
|
|
return (false); |
|
|
|
|
|
|
|
|
|
number = constrain(number, 0, 99); |
|
|
|
|
|
|
|
|
|
AudioNoInterrupts(); |
|
|
|
|
if (sd_card > 0) |
|
|
|
|
{ |
|
|
|
|
char filename[FILENAME_LEN]; |
|
|
|
@ -1146,14 +1152,20 @@ bool check_sd_seq_exists(uint8_t number) |
|
|
|
|
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, number); |
|
|
|
|
|
|
|
|
|
// check if file exists...
|
|
|
|
|
AudioNoInterrupts(); |
|
|
|
|
|
|
|
|
|
if (SD.exists(filename)) |
|
|
|
|
{ |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
return (true); |
|
|
|
|
} else return (false); |
|
|
|
|
} else |
|
|
|
|
{ |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
return (false); |
|
|
|
|
} |
|
|
|
|
} else |
|
|
|
|
{ AudioInterrupts(); |
|
|
|
|
return (false); |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|