|
|
|
@ -45,12 +45,15 @@ extern uint8_t seq_vel[10][16]; |
|
|
|
|
extern uint8_t seq_patternchain[4][4]; |
|
|
|
|
extern uint8_t seq_content_type[10]; |
|
|
|
|
extern uint8_t seq_track_type[4]; |
|
|
|
|
extern uint8_t seq_chord_key_ammount; |
|
|
|
|
extern uint8_t seq_element_shift; |
|
|
|
|
extern int seq_oct_shift; |
|
|
|
|
extern int seq_transpose; |
|
|
|
|
extern int seq_tempo_ms ; |
|
|
|
|
extern int seq_bpm; |
|
|
|
|
extern bool arp_play_basenote; |
|
|
|
|
extern uint8_t arp_speed; |
|
|
|
|
extern uint8_t arp_oct_usersetting; |
|
|
|
|
extern uint8_t arp_lenght; |
|
|
|
|
extern uint8_t arp_style; |
|
|
|
|
extern uint8_t seq_chord_velocity; |
|
|
|
|
extern uint8_t seq_chord_dexed_inst; |
|
|
|
@ -830,6 +833,8 @@ bool load_sd_seq_drumsettings_json(uint8_t number) |
|
|
|
|
} |
|
|
|
|
bool load_sd_seq_voicesettings_json(uint8_t number) |
|
|
|
|
{ |
|
|
|
|
uint8_t bank[MAX_DEXED]; |
|
|
|
|
uint8_t voice[MAX_DEXED]; |
|
|
|
|
if (number < 0) |
|
|
|
|
return (false); |
|
|
|
|
|
|
|
|
@ -870,8 +875,8 @@ bool load_sd_seq_voicesettings_json(uint8_t number) |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < MAX_DEXED; i++) |
|
|
|
|
{ |
|
|
|
|
configuration.performance.bank[i] = data_json["bank"][i]; |
|
|
|
|
configuration.performance.voice[i] = data_json["voice"][i]; |
|
|
|
|
bank[i] = data_json["bank"][i]; |
|
|
|
|
voice[i] = data_json["voice"][i]; |
|
|
|
|
configuration.fx.reverb_send[i] = data_json["rev_send"][i]; |
|
|
|
|
configuration.dexed[i].midi_channel = data_json["midi_ch"][i]; |
|
|
|
|
configuration.dexed[i].sound_intensity = data_json["vol"][i]; |
|
|
|
@ -890,7 +895,7 @@ bool load_sd_seq_voicesettings_json(uint8_t number) |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < NUM_DEXED; i++) |
|
|
|
|
{ |
|
|
|
|
load_sd_voice(configuration.performance.bank[i], configuration.performance.voice[i], i); |
|
|
|
|
load_sd_voice(bank[i], voice[i], i); |
|
|
|
|
MicroDexed[i]->doRefreshVoice(); |
|
|
|
|
MicroDexed[i]->panic(); |
|
|
|
|
} |
|
|
|
@ -945,14 +950,14 @@ bool save_sd_seq_drumsettings_json(uint8_t number) |
|
|
|
|
json = SD.open(filename, FILE_WRITE); |
|
|
|
|
if (json) |
|
|
|
|
{ |
|
|
|
|
data_json["drums_volume"] = drums_volume; |
|
|
|
|
// data_json["drums_volume"] = drums_volume;
|
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < 20; i++) // needs to be replaced by NUM_DRUMSET_CONFIG
|
|
|
|
|
{ |
|
|
|
|
data_json["pan"][i] = drum_config[i].pan; |
|
|
|
|
data_json["vol_max"][i] = drum_config[i].vol_max; |
|
|
|
|
data_json["vol_min"][i] = drum_config[i].vol_min; |
|
|
|
|
data_json["reverb_send"][i] = drum_config[i].reverb_send; |
|
|
|
|
// data_json["pan"][i] = drum_config[i].pan;
|
|
|
|
|
// data_json["vol_max"][i] = drum_config[i].vol_max;
|
|
|
|
|
// data_json["vol_min"][i] = drum_config[i].vol_min;
|
|
|
|
|
// data_json["reverb_send"][i] = drum_config[i].reverb_send;
|
|
|
|
|
} |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(F("Write JSON data:")); |
|
|
|
@ -1050,8 +1055,23 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
int count = 0; |
|
|
|
|
seq_number = constrain(seq_number, 0, 99); |
|
|
|
|
|
|
|
|
|
save_sd_seq_drumsettings_json(seq_number); |
|
|
|
|
save_sd_seq_voicesettings_json(seq_number); |
|
|
|
|
|
|
|
|
|
if (sd_card > 0) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, seq_number); |
|
|
|
|
|
|
|
|
|
AudioNoInterrupts(); |
|
|
|
|
|
|
|
|
|
if (SD.exists(filename)) { |
|
|
|
|
Serial.println("Remove"); |
|
|
|
|
Serial.print(filename); |
|
|
|
|
SD.remove(filename); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AudioInterrupts(); |
|
|
|
|
File json; |
|
|
|
|
|
|
|
|
|
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, seq_number); |
|
|
|
@ -1071,7 +1091,9 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
Serial.print(" Columns: "); |
|
|
|
|
Serial.print(columns); |
|
|
|
|
Serial.print(F(" ")); |
|
|
|
|
|
|
|
|
|
AudioNoInterrupts(); |
|
|
|
|
|
|
|
|
|
json = SD.open(filename, FILE_WRITE); |
|
|
|
|
if (json) |
|
|
|
|
{ |
|
|
|
@ -1114,12 +1136,15 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
data_json["seq_bpm"] = seq_bpm; |
|
|
|
|
data_json["arp_play_basenote"] = arp_play_basenote; |
|
|
|
|
data_json["arp_speed"] = arp_speed; |
|
|
|
|
data_json["arp_oct_usersetting"] = arp_oct_usersetting; |
|
|
|
|
data_json["arp_lenght"] = arp_lenght; |
|
|
|
|
data_json["arp_style"] = arp_style; |
|
|
|
|
data_json["seq_chord_velocity"] = seq_chord_velocity; |
|
|
|
|
data_json["seq_chord_dexed_inst"] = seq_chord_dexed_inst; |
|
|
|
|
data_json["seq_chain_lenght"] = seq_chain_lenght; |
|
|
|
|
data_json["seq_transpose"] = seq_transpose; |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < sizeof(seq_track_type); i++) { |
|
|
|
|
data_json["track_type"][i] = seq_track_type[i]; |
|
|
|
@ -1138,10 +1163,11 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
#endif |
|
|
|
|
serializeJsonPretty(data_json, json); |
|
|
|
|
json.close(); |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
|
|
|
|
|
return (true); |
|
|
|
|
} |
|
|
|
|
json.close(); |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -1151,8 +1177,6 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
|
Serial.println(F(" on SD.")); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
save_sd_seq_drumsettings_json(seq_number); |
|
|
|
|
save_sd_seq_voicesettings_json(seq_number); |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
return (false); |
|
|
|
|
} |
|
|
|
@ -1165,6 +1189,9 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
|
|
|
|
|
seq_number = constrain(seq_number, 0, 99); |
|
|
|
|
|
|
|
|
|
load_sd_seq_drumsettings_json(seq_number); |
|
|
|
|
load_sd_seq_voicesettings_json(seq_number); |
|
|
|
|
|
|
|
|
|
if (sd_card > 0) |
|
|
|
|
{ |
|
|
|
|
File json; |
|
|
|
@ -1243,12 +1270,15 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
seq_bpm = data_json["seq_bpm"]; |
|
|
|
|
arp_play_basenote = data_json["arp_play_basenote"]; |
|
|
|
|
arp_speed = data_json["arp_speed"] ; |
|
|
|
|
arp_oct_usersetting = data_json["arp_oct_usersetting"]; |
|
|
|
|
arp_lenght = data_json["arp_lenght"]; |
|
|
|
|
arp_style = data_json["arp_style"]; |
|
|
|
|
seq_chord_velocity = data_json["seq_chord_velocity"]; |
|
|
|
|
seq_chord_dexed_inst = data_json["seq_chord_dexed_inst"] ; |
|
|
|
|
seq_transpose = data_json["seq_transpose"]; |
|
|
|
|
seq_chain_lenght = data_json["seq_chain_lenght"]; |
|
|
|
|
seq_transpose = data_json["seq_transpose"]; |
|
|
|
|
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"]; |
|
|
|
|
|
|
|
|
|
set_fx_params(); |
|
|
|
|
|
|
|
|
@ -1270,12 +1300,33 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
load_sd_seq_drumsettings_json(seq_number); |
|
|
|
|
load_sd_seq_voicesettings_json(seq_number); |
|
|
|
|
|
|
|
|
|
AudioInterrupts(); |
|
|
|
|
return (false); |
|
|
|
|
} |
|
|
|
|
bool check_sd_seq_exists(uint8_t number) |
|
|
|
|
{ |
|
|
|
|
if (number < 0) |
|
|
|
|
return (false); |
|
|
|
|
|
|
|
|
|
number = constrain(number, 0, 99); |
|
|
|
|
|
|
|
|
|
if (sd_card > 0) |
|
|
|
|
{ |
|
|
|
|
char filename[FILENAME_LEN]; |
|
|
|
|
|
|
|
|
|
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, number); |
|
|
|
|
|
|
|
|
|
// check if file exists...
|
|
|
|
|
AudioNoInterrupts(); |
|
|
|
|
if (SD.exists(filename)) |
|
|
|
|
{ |
|
|
|
|
return (true); |
|
|
|
|
} else return (false); |
|
|
|
|
} else |
|
|
|
|
return (false); |
|
|
|
|
AudioInterrupts(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
SD PERFORMANCE |
|
|
|
|