parent
c2ce0c270d
commit
3197d138ad
@ -0,0 +1,63 @@ |
||||
/*
|
||||
MicroDexed |
||||
|
||||
MicroDexed is a port of the Dexed sound engine |
||||
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
|
||||
|
||||
(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
||||
*/ |
||||
|
||||
#include <Arduino.h> |
||||
#include <ArduinoJson.h> |
||||
#include <Audio.h> |
||||
#include "config.h" |
||||
|
||||
|
||||
void read_drum_config(void) |
||||
{ |
||||
File json; |
||||
|
||||
AudioNoInterrupts(); |
||||
if (SD.exists("/DRM/CFGDrums.json")) |
||||
{ |
||||
#ifdef DEBUG |
||||
Serial.println(F("Found drum configuration file.")); |
||||
#endif |
||||
json = SD.open("/DRM/CFGDrums.json"); |
||||
if (json) |
||||
{ |
||||
DynamicJsonDocument drums_json(5000); |
||||
|
||||
deserializeJson(drums_json, json); |
||||
#ifdef DEBUG |
||||
Serial.println("Drums:"); |
||||
serializeJsonPretty(drums_json, Serial); |
||||
Serial.println(); |
||||
Serial.print(F("Drum Objects: ")); |
||||
Serial.println(drums_json["drums"].size()); |
||||
#endif |
||||
json.close(); |
||||
|
||||
while (1); |
||||
} |
||||
} |
||||
AudioInterrupts(); |
||||
} |
Loading…
Reference in new issue