Merge pull request 'dev' (#60) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/60
pull/61/head
Holger Wirtz 3 years ago
commit 853895222e
  1. 1
      MicroDexed.ino
  2. 13
      UI.hpp
  3. 77
      addon/SD/drm/FutureRetro.json
  4. 4
      drums.cpp
  5. 2
      drums.h

@ -523,7 +523,6 @@ void setup()
{ {
strcpy(drumset_name,"StdDrums"); strcpy(drumset_name,"StdDrums");
num_drums = read_drum_config(drumset_name); num_drums = read_drum_config(drumset_name);
check_and_create_directories(); check_and_create_directories();
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)

@ -84,6 +84,7 @@ extern int seq_transpose;
#include "drums.h" #include "drums.h"
extern drum_config_t drum_config[DRUM_MAX_INSTRUMENTS + 1]; extern drum_config_t drum_config[DRUM_MAX_INSTRUMENTS + 1];
extern uint8_t num_drums; extern uint8_t num_drums;
extern char drumset_name[26];
#endif #endif
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
@ -3612,7 +3613,7 @@ void UI_func_drum_reverb_send(uint8_t param)
sprintf(displayname, "%02d", activesample); sprintf(displayname, "%02d", activesample);
lcd.print(displayname); lcd.print(displayname);
lcd.setCursor(4, 1); 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); lcd.print(displayname);
sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) ); sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) );
lcd.setCursor(12, 1); lcd.setCursor(12, 1);
@ -3701,7 +3702,7 @@ void UI_func_drum_volume(uint8_t param)
sprintf(displayname, "%02d", activesample); sprintf(displayname, "%02d", activesample);
lcd.print(displayname); lcd.print(displayname);
lcd.setCursor(4, 1); 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); lcd.print(displayname);
sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) ); sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) );
lcd.setCursor(12, 1); lcd.setCursor(12, 1);
@ -3790,7 +3791,7 @@ void UI_func_drum_pan(uint8_t param)
sprintf(displayname, "%02d", activesample); sprintf(displayname, "%02d", activesample);
lcd.print(displayname); lcd.print(displayname);
lcd.setCursor(4, 1); 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); lcd.print(displayname);
sprintf(displayname, "%+f", drum_config[activesample].pan); sprintf(displayname, "%+f", drum_config[activesample].pan);
lcd.setCursor(12, 1); lcd.setCursor(12, 1);
@ -3935,7 +3936,7 @@ void UI_func_seq_lenght(uint8_t param)
void UI_func_sequencer(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 ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
@ -3943,7 +3944,7 @@ void UI_func_sequencer(uint8_t param)
seq_note_in = 0; seq_note_in = 0;
// setup function // setup function
lcd.setCursor(1, 0); 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.print(displayname);
lcd.setCursor(9, 0); lcd.setCursor(9, 0);
if (seq_running == false && seq_recording == false) if (seq_running == false && seq_recording == false)
@ -4066,7 +4067,7 @@ void UI_func_sequencer(uint8_t param)
if (activesample < num_drums) { if (activesample < num_drums) {
lcd.setCursor(1, 0); 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.print(displayname);
} else if (activesample == num_drums) { } else if (activesample == num_drums) {
lcd.setCursor(1, 0); lcd.setCursor(1, 0);

@ -0,0 +1,77 @@
{
"drums": {
"phKick1": {
"drum_class": "DRUM_BASS",
"midinote": "C3",
"shortname": "B",
"pan": 0,
"vol_max": 0.8,
"vol_min": 0,
"reverb_send": 0
},
"LnClap": {
"drum_class": "DRUM_HANDCLAP",
"midinote": "C#3",
"shortname": "C",
"pan": -0.4,
"vol_max": 0.6,
"vol_min": 0,
"reverb_send": 0.4
},
"LnSnare1": {
"drum_class": "DRUM_SNARE",
"midinote": "D3",
"shortname": "S",
"pan": 0.2,
"vol_max": 0.6,
"vol_min": 0.2,
"reverb_send": 0
},
"phSnare1": {
"drum_class": "DRUM_SNARE",
"midinote": "E3",
"shortname": "S",
"pan": 0.2,
"vol_max": 0.6,
"vol_min": 0.2,
"reverb_send": 0
},
"808HhCl1": {
"drum_class": "DRUM_HIHAT",
"midinote": "F#3",
"shortname": "h",
"pan": 0.8,
"vol_max": 0.2,
"vol_min": 0,
"reverb_send": 0
},
"808HhCl1": {
"drum_class": "DRUM_HIHAT",
"midinote": "G#3",
"shortname": "h",
"pan": 0.8,
"vol_max": 0.2,
"vol_min": 0,
"reverb_send": 0
},
"808HhOp1": {
"drum_class": "DRUM_HIHAT",
"midinote": "A#3",
"shortname": "H",
"pan": 0.8,
"vol_max": 0.2,
"vol_min": 0,
"reverb_send": 0
},
"808Clap1": {
"drum_class": "DRUM_HANDCLAP",
"midinote": "D#5",
"filename": "808Clap1.raw",
"shortname": "C",
"pan": 0,
"vol_max": 0.9,
"vol_min": 0,
"reverb_send": 0.4
},
}
}

@ -86,6 +86,7 @@ uint8_t read_drum_config(const char* drumset)
uint8_t drum = 0; uint8_t drum = 0;
JsonObject root = drums_json["drums"].as<JsonObject>(); JsonObject root = drums_json["drums"].as<JsonObject>();
sprintf(ds, "/DRM/%s", drumset);
for (JsonPair kv : root) for (JsonPair kv : root)
{ {
sprintf(drum_config[drum].filename, "%s/%s.wav", ds, kv.key().c_str()); 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_max = 0.0;
drum_config[drum].vol_min = 0.0; drum_config[drum].vol_min = 0.0;
drum_config[drum].reverb_send = 0.0; drum_config[drum].reverb_send = 0.0;
return (drum); return (drum);
} }

@ -36,7 +36,7 @@ uint8_t read_drum_config(const char* drumset);
typedef struct drum_config_s { typedef struct drum_config_s {
uint8_t drum_class; // Type of drum uint8_t drum_class; // Type of drum
uint8_t midinote; // Triggered by note 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 char shortname[2]; // 1 char name for sequencer
float32_t pan; // Panorama (-1.0 - +1.0) float32_t pan; // Panorama (-1.0 - +1.0)
float32_t vol_max; // max. Volume (0.0 - 1.0) float32_t vol_max; // max. Volume (0.0 - 1.0)

Loading…
Cancel
Save