diff --git a/MicroDexed.ino b/MicroDexed.ino index e103a6e..fae5e67 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -29,6 +29,7 @@ #include #include #include +#include #include "midi_devices.hpp" #include "synth_dexed.h" #include "dexed_sd.h" @@ -482,6 +483,32 @@ void setup() #endif create_audio_drum_chain(instance_id); + File json; + // first check if file exists... + AudioNoInterrupts(); + if (SD.exists("/DRM/CFG_MDDrums.json")) + { + // ... and if: load +#ifdef DEBUG + Serial.println(F("Found drum configuration file.")); +#endif + json = SD.open("/DRM/CFG_MDDrums.json"); + if (json) + { + StaticJsonDocument data_json; + JsonObject object = data_json.to(); + + deserializeJson(data_json, json); + deserializeJson(data_json, Serial); + json.close(); + + Serial.print(F("objects: ")); + Serial.println(object["drums"].size()); + + } + } + AudioInterrupts(); + drum_mixer_r.gain(instance_id, 1.0); drum_mixer_l.gain(instance_id, 1.0); drum_reverb_send_mixer_r.gain(instance_id, 0.0); diff --git a/addon/SD/drm/808Clap1.raw b/addon/SD/drm/808Clap1.raw deleted file mode 100644 index ce59dcb..0000000 Binary files a/addon/SD/drm/808Clap1.raw and /dev/null differ diff --git a/addon/SD/drm/808HHCL1.raw b/addon/SD/drm/808HHCL1.raw deleted file mode 100644 index 0d37f0a..0000000 Binary files a/addon/SD/drm/808HHCL1.raw and /dev/null differ diff --git a/addon/SD/drm/808RimS1.raw b/addon/SD/drm/808RimS1.raw deleted file mode 100644 index ee057d6..0000000 Binary files a/addon/SD/drm/808RimS1.raw and /dev/null differ diff --git a/addon/SD/drm/CFG_MDDrums.json b/addon/SD/drm/CFG_MDDrums.json index bfdbcd4..720a221 100644 --- a/addon/SD/drm/CFG_MDDrums.json +++ b/addon/SD/drm/CFG_MDDrums.json @@ -1,6 +1,7 @@ { + "drums": { "bd01": { - "type": "DRUM_BASS", + "drum_class": "DRUM_BASS", "midinote": "MIDI_C3", "shortname": "B", "pan": 0.0, @@ -9,142 +10,132 @@ "reverb_send": 0.0 }, "cp02": { - "type": "DRUM_HANDCLAP", + "drum_class": "DRUM_HANDCLAP", "midinote": "MIDI_CIS3", "shortname": "C", "pan": -0.4, - "vol_max:" 0.6, - "vol_min:" 0.0, - "reverb_send:" 0.4 + "vol_max": 0.6, + "vol_min": 0.0, + "reverb_send": 0.4 + }, + "sd15": { + "drum_class": "DRUM_SNARE", + "midinote": "MIDI_D3", + "shortname": "S", + "pan": 0.2, + "vol_max": 0.6, + "vol_min": 0.2, + "reverb_send": 0.0 + }, + "hh01": { + "drum_class": "DRUM_HIHAT", + "midinote": "MIDI_FIS3", + "shortname": "h", + "pan": 0.8, + "vol_max": 0.2, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "hh02": { + "drum_class": "DRUM_HIHAT", + "midinote": "MIDI_GIS3", + "shortname": "h", + "pan": 0.8, + "vol_max": 0.2, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "oh02": { + "drum_class": "DRUM_HIHAT", + "midinote": "MIDI_AIS3", + "shortname": "H", + "pan": 0.8, + "vol_max": 0.2, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "lt01": { + "drum_class": "DRUM_LOWTOM", + "midinote": "MIDI_G3", + "shortname": "T", + "pan": -0.7, + "vol_max": 0.8, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "ht01": { + "drum_class": "DRUM_HIGHTOM", + "midinote": "MIDI_A3", + "shortname": "T", + "pan": -0.5, + "vol_max": 0.8, + "vol_min": 0.0, + "reverb_send": 0.0 }, - [ - type: "DRUM_SNARE", - midinote: "MIDI_D3", - filename: "sd15.raw", - shortname: "S", - pan: 0.2, - vol_max: 0.6, - vol_min: 0.2, - reverb_send: 0.0 - ], - [ - type: "DRUM_HIHAT", - midinote: "MIDI_FIS3", - filename: "hh01.raw", - shortname: "h", - pan: 0.8, - vol_max: 0.2, - vol_min: 0.0, - reverb_send: 0.0 - ], - [ - type: "DRUM_HIHAT", - midinote: "MIDI_GIS3", - filename: "hh02.raw", - shortname: "h", - pan: 0.8, - vol_max: 0.2, - vol_min: 0.0, - reverb_send: 0.0 - ], - [ - type: "DRUM_HIHAT", - midinote: "MIDI_AIS3", - filename: "oh02.raw", - shortname: "H", - pan: 0.8, - vol_max: 0.2, - vol_min: 0.0, - reverb_send: 0.0 - ], - [ - type: "DRUM_LOWTOM", - midinote: "MIDI_G3", - filename: "lt01.raw", - shortname: "T", - pan: -0.7, - vol_max: 0.8, - vol_min: 0.0, - reverb_send: 0.0 - ], - [ - type: "DRUM_HIGHTOM", - midinote: "MIDI_A3", - filename: "ht01.raw", - shortname: "T", - pan: -0.5 - vol_max: 0.8 - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_RIDE", - midinote: "MIDI_CIS4", - filename: "rd01.raw", - shortname: "R", - pan: -0.6, - vol_max: 0.3, - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_RIDE", - midinote: "MIDI_DIS4", - filename: "rd02.raw", - shortname: "R", - pan: -0.6, - vol_max: 0.3, - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_BASS", - midinote: "MIDI_C5", - filename: "PHKick1.raw", - shortname: "B", - pan: 0.0, - vol_max: 0.9, - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_HANDCLAP", - midinote: "MIDI_DIS5", - filename: "808Clap1.raw", - shortname: "C", - pan: 0.0, - vol_max: 0.9, - vol_min: 0.0 - reverb_send: 0.4 - ], - [ - type: "DRUM_SNARE", - midinote: "MIDI_CIS5", - filename: "808RimS1.raw", - shortname: "R", - pan: -0.3, - vol_max: 0.5, - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_HIHAT", - midinote: "MIDI_FIS5", - filename: "808HHCL1.raw", - shortname: "H", - pan: 0.4, - vol_max: 0.6, - vol_min: 0.0 - reverb_send: 0.0 - ], - [ - type: "DRUM_NONE", - midinote: "MIDI_NONE", - filename: "EMPTY", - shortname: "-", - pan: 0.0, - vol_max: 0.0, - vol_min: 0.0 - reverb_send: 0.0 - ], + "rd01": { + "drum_class": "DRUM_RIDE", + "midinote": "MIDI_CIS4", + "shortname": "R", + "pan": -0.6, + "vol_max": 0.3, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "rd02": { + "drum_class": "DRUM_RIDE", + "midinote": "MIDI_DIS4", + "shortname": "R", + "pan": -0.6, + "vol_max": 0.3, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "PHKick1": { + "drum_class": "DRUM_BASS", + "midinote": "MIDI_C5", + "shortname": "B", + "pan": 0.0, + "vol_max": 0.9, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "808Clap1": { + "drum_class": "DRUM_HANDCLAP", + "midinote": "MIDI_DIS5", + "filename": "808Clap1.raw", + "shortname": "C", + "pan": 0.0, + "vol_max": 0.9, + "vol_min": 0.0, + "reverb_send": 0.4 + }, + "808RimS1": { + "drum_class": "DRUM_SNARE", + "midinote": "MIDI_CIS5", + "shortname": "R", + "pan": -0.3, + "vol_max": 0.5, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "808HHCL1": { + "drum_class": "DRUM_HIHAT", + "midinote": "MIDI_FIS5", + "shortname": "H", + "pan": 0.4, + "vol_max": 0.6, + "vol_min": 0.0, + "reverb_send": 0.0 + }, + "EMPTY": { + "drum_class": "DRUM_NONE", + "midinote": "MIDI_NONE", + "filename": "EMPTY", + "shortname": "-", + "pan": 0.0, + "vol_max": 0.0, + "vol_min": 0.0, + "reverb_send": 0.0 + } +} } diff --git a/addon/SD/drm/PHKick1.raw b/addon/SD/drm/PHKick1.raw deleted file mode 100644 index 44a5e20..0000000 Binary files a/addon/SD/drm/PHKick1.raw and /dev/null differ diff --git a/addon/SD/drm/bd01.raw b/addon/SD/drm/bd01.raw deleted file mode 100644 index 3c56d4f..0000000 Binary files a/addon/SD/drm/bd01.raw and /dev/null differ diff --git a/addon/SD/drm/bd02.raw b/addon/SD/drm/bd02.raw deleted file mode 100644 index 95cd3c2..0000000 Binary files a/addon/SD/drm/bd02.raw and /dev/null differ diff --git a/addon/SD/drm/bd03.raw b/addon/SD/drm/bd03.raw deleted file mode 100644 index 7b345d1..0000000 Binary files a/addon/SD/drm/bd03.raw and /dev/null differ diff --git a/addon/SD/drm/bd04.raw b/addon/SD/drm/bd04.raw deleted file mode 100644 index 33cf2da..0000000 Binary files a/addon/SD/drm/bd04.raw and /dev/null differ diff --git a/addon/SD/drm/bd05.raw b/addon/SD/drm/bd05.raw deleted file mode 100644 index cc95ee5..0000000 Binary files a/addon/SD/drm/bd05.raw and /dev/null differ diff --git a/addon/SD/drm/bd06.raw b/addon/SD/drm/bd06.raw deleted file mode 100644 index 8ecb3db..0000000 Binary files a/addon/SD/drm/bd06.raw and /dev/null differ diff --git a/addon/SD/drm/bd07.raw b/addon/SD/drm/bd07.raw deleted file mode 100644 index d6ca432..0000000 Binary files a/addon/SD/drm/bd07.raw and /dev/null differ diff --git a/addon/SD/drm/bd08.raw b/addon/SD/drm/bd08.raw deleted file mode 100644 index 89a2cfc..0000000 Binary files a/addon/SD/drm/bd08.raw and /dev/null differ diff --git a/addon/SD/drm/bd09.raw b/addon/SD/drm/bd09.raw deleted file mode 100644 index bb121f8..0000000 Binary files a/addon/SD/drm/bd09.raw and /dev/null differ diff --git a/addon/SD/drm/bd10.raw b/addon/SD/drm/bd10.raw deleted file mode 100644 index 21d151e..0000000 Binary files a/addon/SD/drm/bd10.raw and /dev/null differ diff --git a/addon/SD/drm/cp01.raw b/addon/SD/drm/cp01.raw deleted file mode 100644 index 5e3339c..0000000 Binary files a/addon/SD/drm/cp01.raw and /dev/null differ diff --git a/addon/SD/drm/cp02.raw b/addon/SD/drm/cp02.raw deleted file mode 100644 index 38987af..0000000 Binary files a/addon/SD/drm/cp02.raw and /dev/null differ diff --git a/addon/SD/drm/cr01.raw b/addon/SD/drm/cr01.raw deleted file mode 100644 index edfd4eb..0000000 Binary files a/addon/SD/drm/cr01.raw and /dev/null differ diff --git a/addon/SD/drm/cr02.raw b/addon/SD/drm/cr02.raw deleted file mode 100644 index 1240777..0000000 Binary files a/addon/SD/drm/cr02.raw and /dev/null differ diff --git a/addon/SD/drm/hh01.raw b/addon/SD/drm/hh01.raw deleted file mode 100644 index 775e954..0000000 Binary files a/addon/SD/drm/hh01.raw and /dev/null differ diff --git a/addon/SD/drm/hh02.raw b/addon/SD/drm/hh02.raw deleted file mode 100644 index 224b24b..0000000 Binary files a/addon/SD/drm/hh02.raw and /dev/null differ diff --git a/addon/SD/drm/ht01.raw b/addon/SD/drm/ht01.raw deleted file mode 100644 index ec83a9c..0000000 Binary files a/addon/SD/drm/ht01.raw and /dev/null differ diff --git a/addon/SD/drm/ht02.raw b/addon/SD/drm/ht02.raw deleted file mode 100644 index b882daa..0000000 Binary files a/addon/SD/drm/ht02.raw and /dev/null differ diff --git a/addon/SD/drm/lt01.raw b/addon/SD/drm/lt01.raw deleted file mode 100644 index 26308a2..0000000 Binary files a/addon/SD/drm/lt01.raw and /dev/null differ diff --git a/addon/SD/drm/lt02.raw b/addon/SD/drm/lt02.raw deleted file mode 100644 index 6c6ff35..0000000 Binary files a/addon/SD/drm/lt02.raw and /dev/null differ diff --git a/addon/SD/drm/mt01.raw b/addon/SD/drm/mt01.raw deleted file mode 100644 index 977e695..0000000 Binary files a/addon/SD/drm/mt01.raw and /dev/null differ diff --git a/addon/SD/drm/mt02.raw b/addon/SD/drm/mt02.raw deleted file mode 100644 index bba2b57..0000000 Binary files a/addon/SD/drm/mt02.raw and /dev/null differ diff --git a/addon/SD/drm/oh01.raw b/addon/SD/drm/oh01.raw deleted file mode 100644 index c7f0121..0000000 Binary files a/addon/SD/drm/oh01.raw and /dev/null differ diff --git a/addon/SD/drm/oh02.raw b/addon/SD/drm/oh02.raw deleted file mode 100644 index d2b80ee..0000000 Binary files a/addon/SD/drm/oh02.raw and /dev/null differ diff --git a/addon/SD/drm/rd01.raw b/addon/SD/drm/rd01.raw deleted file mode 100644 index 3cc3ab5..0000000 Binary files a/addon/SD/drm/rd01.raw and /dev/null differ diff --git a/addon/SD/drm/rd02.raw b/addon/SD/drm/rd02.raw deleted file mode 100644 index 4b3996e..0000000 Binary files a/addon/SD/drm/rd02.raw and /dev/null differ diff --git a/addon/SD/drm/rs01.raw b/addon/SD/drm/rs01.raw deleted file mode 100644 index 05a9662..0000000 Binary files a/addon/SD/drm/rs01.raw and /dev/null differ diff --git a/addon/SD/drm/sd01.raw b/addon/SD/drm/sd01.raw deleted file mode 100644 index df5222d..0000000 Binary files a/addon/SD/drm/sd01.raw and /dev/null differ diff --git a/addon/SD/drm/sd02.raw b/addon/SD/drm/sd02.raw deleted file mode 100644 index 842cbe8..0000000 Binary files a/addon/SD/drm/sd02.raw and /dev/null differ diff --git a/addon/SD/drm/sd03.raw b/addon/SD/drm/sd03.raw deleted file mode 100644 index 353faf5..0000000 Binary files a/addon/SD/drm/sd03.raw and /dev/null differ diff --git a/addon/SD/drm/sd04.raw b/addon/SD/drm/sd04.raw deleted file mode 100644 index 16e9fb4..0000000 Binary files a/addon/SD/drm/sd04.raw and /dev/null differ diff --git a/addon/SD/drm/sd05.raw b/addon/SD/drm/sd05.raw deleted file mode 100644 index 2bb1f8c..0000000 Binary files a/addon/SD/drm/sd05.raw and /dev/null differ diff --git a/addon/SD/drm/sd06.raw b/addon/SD/drm/sd06.raw deleted file mode 100644 index b6eee84..0000000 Binary files a/addon/SD/drm/sd06.raw and /dev/null differ diff --git a/addon/SD/drm/sd07.raw b/addon/SD/drm/sd07.raw deleted file mode 100644 index 8be15fa..0000000 Binary files a/addon/SD/drm/sd07.raw and /dev/null differ diff --git a/addon/SD/drm/sd08.raw b/addon/SD/drm/sd08.raw deleted file mode 100644 index f293dc4..0000000 Binary files a/addon/SD/drm/sd08.raw and /dev/null differ diff --git a/addon/SD/drm/sd09.raw b/addon/SD/drm/sd09.raw deleted file mode 100644 index c41363e..0000000 Binary files a/addon/SD/drm/sd09.raw and /dev/null differ diff --git a/addon/SD/drm/sd10.raw b/addon/SD/drm/sd10.raw deleted file mode 100644 index bf2a793..0000000 Binary files a/addon/SD/drm/sd10.raw and /dev/null differ diff --git a/addon/SD/drm/sd11.raw b/addon/SD/drm/sd11.raw deleted file mode 100644 index ce1e42d..0000000 Binary files a/addon/SD/drm/sd11.raw and /dev/null differ diff --git a/addon/SD/drm/sd12.raw b/addon/SD/drm/sd12.raw deleted file mode 100644 index f20b8fb..0000000 Binary files a/addon/SD/drm/sd12.raw and /dev/null differ diff --git a/addon/SD/drm/sd13.raw b/addon/SD/drm/sd13.raw deleted file mode 100644 index 9801bd7..0000000 Binary files a/addon/SD/drm/sd13.raw and /dev/null differ diff --git a/addon/SD/drm/sd14.raw b/addon/SD/drm/sd14.raw deleted file mode 100644 index 6e00d27..0000000 Binary files a/addon/SD/drm/sd14.raw and /dev/null differ diff --git a/addon/SD/drm/sd15.raw b/addon/SD/drm/sd15.raw deleted file mode 100644 index 6648b86..0000000 Binary files a/addon/SD/drm/sd15.raw and /dev/null differ