Dateien hochladen nach „“

pull/60/head
positionhigh 3 years ago
parent 8125a895e4
commit bc025445fa
  1. 1
      MicroDexed.ino
  2. 13
      UI.hpp
  3. 4
      drums.cpp
  4. 2
      drums.h

@ -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++)

@ -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);

@ -86,6 +86,7 @@ uint8_t read_drum_config(const char* drumset)
uint8_t drum = 0;
JsonObject root = drums_json["drums"].as<JsonObject>();
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);
}

@ -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)

Loading…
Cancel
Save