From bc025445fa8ef67bd4eff472e729a5cb2f5270b6 Mon Sep 17 00:00:00 2001 From: positionhigh Date: Thu, 5 Aug 2021 21:38:31 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MicroDexed.ino | 1 - UI.hpp | 13 +++++++------ drums.cpp | 4 +++- drums.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index d5efb09..12194c4 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -523,7 +523,6 @@ void setup() { strcpy(drumset_name,"StdDrums"); num_drums = read_drum_config(drumset_name); - check_and_create_directories(); for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) diff --git a/UI.hpp b/UI.hpp index 9b71111..2db98f3 100644 --- a/UI.hpp +++ b/UI.hpp @@ -84,6 +84,7 @@ extern int seq_transpose; #include "drums.h" extern drum_config_t drum_config[DRUM_MAX_INSTRUMENTS + 1]; extern uint8_t num_drums; +extern char drumset_name[26]; #endif #ifdef DISPLAY_LCD_SPI @@ -3612,7 +3613,7 @@ void UI_func_drum_reverb_send(uint8_t param) sprintf(displayname, "%02d", activesample); lcd.print(displayname); lcd.setCursor(4, 1); - strncpy(displayname, drum_config[activesample].filename + 5, 7); + strncpy(displayname, drum_config[activesample].filename + 6 + strlen(drumset_name), 7); lcd.print(displayname); sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) ); lcd.setCursor(12, 1); @@ -3701,7 +3702,7 @@ void UI_func_drum_volume(uint8_t param) sprintf(displayname, "%02d", activesample); lcd.print(displayname); lcd.setCursor(4, 1); - strncpy(displayname, drum_config[activesample].filename + 5, 7); + strncpy(displayname, drum_config[activesample].filename + 6+ strlen(drumset_name), 7); lcd.print(displayname); sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) ); lcd.setCursor(12, 1); @@ -3790,7 +3791,7 @@ void UI_func_drum_pan(uint8_t param) sprintf(displayname, "%02d", activesample); lcd.print(displayname); lcd.setCursor(4, 1); - strncpy(displayname, drum_config[activesample].filename + 5, 7); + strncpy(displayname, drum_config[activesample].filename + 6 + strlen(drumset_name), 7); lcd.print(displayname); sprintf(displayname, "%+f", drum_config[activesample].pan); lcd.setCursor(12, 1); @@ -3935,7 +3936,7 @@ void UI_func_seq_lenght(uint8_t param) void UI_func_sequencer(uint8_t param) { - char displayname[7] = {0, 0, 0, 0, 0, 0}; + char displayname[8]={0,0,0,0,0,0,0,0}; if (LCDML.FUNC_setup()) // ****** SETUP ********* { @@ -3943,7 +3944,7 @@ void UI_func_sequencer(uint8_t param) seq_note_in = 0; // setup function lcd.setCursor(1, 0); - strncpy(displayname, drum_config[activesample].filename + 5, 6); + strncpy(displayname, drum_config[activesample].filename + 6 + strlen(drumset_name), 6); lcd.print(displayname); lcd.setCursor(9, 0); if (seq_running == false && seq_recording == false) @@ -4066,7 +4067,7 @@ void UI_func_sequencer(uint8_t param) if (activesample < num_drums) { lcd.setCursor(1, 0); - strncpy(displayname, drum_config[activesample].filename + 5, 6); + strncpy(displayname, drum_config[activesample].filename + 6 + strlen(drumset_name), 6); lcd.print(displayname); } else if (activesample == num_drums) { lcd.setCursor(1, 0); diff --git a/drums.cpp b/drums.cpp index d4f5463..b0cc97c 100644 --- a/drums.cpp +++ b/drums.cpp @@ -86,6 +86,7 @@ uint8_t read_drum_config(const char* drumset) uint8_t drum = 0; JsonObject root = drums_json["drums"].as(); + sprintf(ds, "/DRM/%s", drumset); for (JsonPair kv : root) { sprintf(drum_config[drum].filename, "%s/%s.wav", ds, kv.key().c_str()); @@ -282,6 +283,7 @@ uint8_t read_drum_config(const char* drumset) drum_config[drum].vol_max = 0.0; drum_config[drum].vol_min = 0.0; drum_config[drum].reverb_send = 0.0; - + return (drum); + } diff --git a/drums.h b/drums.h index 728102a..4b2976a 100644 --- a/drums.h +++ b/drums.h @@ -36,7 +36,7 @@ uint8_t read_drum_config(const char* drumset); typedef struct drum_config_s { uint8_t drum_class; // Type of drum uint8_t midinote; // Triggered by note - char filename[18]; // 44.1kHz mono LSB wav-sample + char filename[28]; // 44.1kHz mono LSB wav-sample char shortname[2]; // 1 char name for sequencer float32_t pan; // Panorama (-1.0 - +1.0) float32_t vol_max; // max. Volume (0.0 - 1.0)