|
|
@ -34,6 +34,7 @@ using namespace TeensyTimerTool; |
|
|
|
#include "synth_dexed.h" |
|
|
|
#include "synth_dexed.h" |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#include "drums.h" |
|
|
|
#include "drums.h" |
|
|
|
|
|
|
|
extern void set_drums_volume(float vol); |
|
|
|
extern drum_config_t drum_config[]; |
|
|
|
extern drum_config_t drum_config[]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -43,11 +44,10 @@ extern void check_configuration_performance(void); |
|
|
|
extern void check_configuration_fx(void); |
|
|
|
extern void check_configuration_fx(void); |
|
|
|
extern void sequencer(); |
|
|
|
extern void sequencer(); |
|
|
|
extern float drums_volume; |
|
|
|
extern float drums_volume; |
|
|
|
//extern StaticJsonDocument<JSON_BUFFER> data_json;
|
|
|
|
|
|
|
|
extern uint8_t seq_chain_lenght; |
|
|
|
extern uint8_t seq_chain_lenght; |
|
|
|
extern uint8_t seq_data[NUM_SEQ_PATTERN][16]; |
|
|
|
extern uint8_t seq_data[NUM_SEQ_PATTERN][16]; |
|
|
|
extern uint8_t seq_vel[NUM_SEQ_PATTERN][16]; |
|
|
|
extern uint8_t seq_vel[NUM_SEQ_PATTERN][16]; |
|
|
|
extern uint8_t seq_patternchain[NUM_SEQ_TRACKS][4]; |
|
|
|
extern uint8_t seq_patternchain[4][NUM_SEQ_TRACKS]; |
|
|
|
extern uint8_t seq_content_type[NUM_SEQ_PATTERN]; |
|
|
|
extern uint8_t seq_content_type[NUM_SEQ_PATTERN]; |
|
|
|
extern uint8_t seq_track_type[NUM_SEQ_TRACKS]; |
|
|
|
extern uint8_t seq_track_type[NUM_SEQ_TRACKS]; |
|
|
|
extern uint8_t seq_chord_key_ammount; |
|
|
|
extern uint8_t seq_chord_key_ammount; |
|
|
@ -483,7 +483,7 @@ bool load_sd_drumsettings_json(uint8_t number, uint8_t target) |
|
|
|
Serial.println(); |
|
|
|
Serial.println(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
drums_volume = data_json["drums_volume"]; |
|
|
|
drums_volume = data_json["drums_volume"]; |
|
|
|
|
|
|
|
set_drums_volume(drums_volume); |
|
|
|
for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG; i++) |
|
|
|
for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
set_sample_pitch( i, data_json["pitch"][i] ); |
|
|
|
set_sample_pitch( i, data_json["pitch"][i] ); |
|
|
@ -1089,13 +1089,9 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
Serial.print(F(" to ")); |
|
|
|
Serial.print(F(" to ")); |
|
|
|
Serial.println(filename); |
|
|
|
Serial.println(filename); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
int total = sizeof(seq_data); |
|
|
|
int total = sizeof(seq_patternchain); |
|
|
|
int columns = sizeof(seq_data[0]); |
|
|
|
int columns = sizeof(seq_patternchain[0]); |
|
|
|
int rows = total / columns; |
|
|
|
int rows = total / columns; |
|
|
|
Serial.print(F("Rows: ")); |
|
|
|
|
|
|
|
Serial.print(rows); |
|
|
|
|
|
|
|
Serial.print(" Columns: "); |
|
|
|
|
|
|
|
Serial.print(columns); |
|
|
|
|
|
|
|
Serial.print(F(" ")); |
|
|
|
Serial.print(F(" ")); |
|
|
|
AudioNoInterrupts(); |
|
|
|
AudioNoInterrupts(); |
|
|
|
SD.begin(); |
|
|
|
SD.begin(); |
|
|
@ -1103,9 +1099,6 @@ bool save_sd_seq_json(uint8_t seq_number) |
|
|
|
json = SD.open(filename, FILE_WRITE); |
|
|
|
json = SD.open(filename, FILE_WRITE); |
|
|
|
if (json) |
|
|
|
if (json) |
|
|
|
{ |
|
|
|
{ |
|
|
|
total = sizeof(seq_patternchain); |
|
|
|
|
|
|
|
columns = sizeof(seq_patternchain[0]); |
|
|
|
|
|
|
|
rows = total / columns; |
|
|
|
|
|
|
|
Serial.print(F("Chain Rows: ")); |
|
|
|
Serial.print(F("Chain Rows: ")); |
|
|
|
Serial.print(rows); |
|
|
|
Serial.print(rows); |
|
|
|
Serial.print(" Chain Columns: "); |
|
|
|
Serial.print(" Chain Columns: "); |
|
|
@ -1401,23 +1394,29 @@ bool load_sd_seq_json(uint8_t seq_number) |
|
|
|
int count = 0; |
|
|
|
int count = 0; |
|
|
|
for (uint8_t i = 0; i < rows; i++) |
|
|
|
for (uint8_t i = 0; i < rows; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (uint8_t j = 0; j < columns; j++) { |
|
|
|
for (uint8_t j = 0; j < columns; j++) |
|
|
|
|
|
|
|
{ |
|
|
|
seq_patternchain[i][j] = data_json["seq_patternchain"][count]; |
|
|
|
seq_patternchain[i][j] = data_json["seq_patternchain"][count]; |
|
|
|
count++; |
|
|
|
count++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (uint8_t i = 0; i < sizeof(seq_track_type); i++) { |
|
|
|
for (uint8_t i = 0; i < sizeof(seq_track_type); i++) |
|
|
|
|
|
|
|
{ |
|
|
|
seq_track_type[i] = data_json["track_type"][i]; |
|
|
|
seq_track_type[i] = data_json["track_type"][i]; |
|
|
|
} |
|
|
|
} |
|
|
|
for (uint8_t i = 0; i < sizeof(seq_content_type); i++) { |
|
|
|
for (uint8_t i = 0; i < sizeof(seq_content_type); i++) |
|
|
|
|
|
|
|
{ |
|
|
|
seq_content_type[i] = data_json["content_type"][i]; |
|
|
|
seq_content_type[i] = data_json["content_type"][i]; |
|
|
|
} |
|
|
|
} |
|
|
|
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]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (data_json["seq_name"][0] != 0) { |
|
|
|
if (data_json["seq_name"][0] != 0) |
|
|
|
for (uint8_t i = 0; i < FILENAME_LEN; i++) { |
|
|
|
{ |
|
|
|
|
|
|
|
for (uint8_t i = 0; i < FILENAME_LEN; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
seq_name[i] = data_json["seq_name"][i]; |
|
|
|
seq_name[i] = data_json["seq_name"][i]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|