From 2ff0998085513993f4f022c7e1d22dbd2baf0ea0 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 19 Sep 2022 14:04:38 +0200 Subject: [PATCH] New bash script for creating a big bank file in progmem. --- MicroDexed.ino | 1 + addon/tools/banks2c.sh | 21 +++++++++++++++ third-party/Synth_Dexed/tools/gen_includes.sh | 26 ------------------- third-party/Synth_Dexed/tools/includes.txt | 17 ------------ 4 files changed, 22 insertions(+), 43 deletions(-) create mode 100755 addon/tools/banks2c.sh delete mode 100755 third-party/Synth_Dexed/tools/gen_includes.sh delete mode 100644 third-party/Synth_Dexed/tools/includes.txt diff --git a/MicroDexed.ino b/MicroDexed.ino index 2cc28b4..b2c9ba7 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -55,6 +55,7 @@ #include "synth_mda_epiano.h" #include #endif +#include "voices.h" // Audio engines AudioSynthDexed* MicroDexed[NUM_DEXED]; diff --git a/addon/tools/banks2c.sh b/addon/tools/banks2c.sh new file mode 100755 index 0000000..6999292 --- /dev/null +++ b/addon/tools/banks2c.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +rm -f /tmp/banks2c_[0-9].tmp +for b in `find ../SD/ -iname "*.syx" | sort -V` +do + python ../../third-party/Synth_Dexed/tools/sysex2c.py "${b}" >> /tmp/banks2c_1.tmp +done + +cat /tmp/banks2c_1.tmp | sed "s/^\/\/.*//" | sed -e '/^$/d' | sed -e '/^#/d' > /tmp/banks2c_2.tmp +cat /tmp/banks2c_2.tmp | sed -e '/uint8_t progmem_bank\[1\]/d' | sed -e '/^\}\;/d' | sed -e '/^{/d' > /tmp/banks2c_3.tmp +cat /tmp/banks2c_3.tmp | sed -e 's/^\t}/\t},/' > /tmp/banks2c_4.tmp +head -n -1 /tmp/banks2c_4.tmp > /tmp/banks2c_5.tmp +echo "#pragma once" > /tmp/banks2c_6.tmp +echo "" >> /tmp/banks2c_6.tmp +echo "uint8_t progmem_bank[100][32][128] PROGMEM =" >> /tmp/banks2c_6.tmp +echo "{" >> /tmp/banks2c_6.tmp +cat /tmp/banks2c_5.tmp >> /tmp/banks2c_6.tmp +echo " }" >> /tmp/banks2c_6.tmp +echo "};" >> /tmp/banks2c_6.tmp +cat /tmp/banks2c_6.tmp +rm -f /tmp/banks2c_[0-9].tmp diff --git a/third-party/Synth_Dexed/tools/gen_includes.sh b/third-party/Synth_Dexed/tools/gen_includes.sh deleted file mode 100755 index 07a1efb..0000000 --- a/third-party/Synth_Dexed/tools/gen_includes.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -echo "#include " > synth_dexed.h -echo "#include " >> synth_dexed.h -echo "#include \"config.h\"" >> synth_dexed.h -for i in `cat includes.txt` -do - echo "/*****************************************************" >> synth_dexed.h - echo " * CODE; ${i}" >> synth_dexed.h - echo " *****************************************************/" >> synth_dexed.h - - cat $i >> synth_dexed.h - echo "" >> synth_dexed.h - echo "//=====================================================" >> synth_dexed.h -done - -echo "#include \"synth_dexed.h\"" > synth_dexed.cpp -for i in `ls orig_code/*.cpp` -do - echo "/*****************************************************" >> synth_dexed.cpp - echo " * CODE; ${i}" >> synth_dexed.cpp - echo " *****************************************************/" >> synth_dexed.cpp - cat $i >> synth_dexed.cpp - echo "" >> synth_dexed.cpp - echo "//=====================================================" >> synth_dexed.cpp -done diff --git a/third-party/Synth_Dexed/tools/includes.txt b/third-party/Synth_Dexed/tools/includes.txt deleted file mode 100644 index 2835504..0000000 --- a/third-party/Synth_Dexed/tools/includes.txt +++ /dev/null @@ -1,17 +0,0 @@ -orig_code/synth.h -orig_code/aligned_buf.h -orig_code/sin.h -orig_code/exp2.h -orig_code/fast_log.h -orig_code/freqlut.h -orig_code/lfo.h -orig_code/env.h -orig_code/pitchenv.h -orig_code/controllers.h -orig_code/PluginFx.h -orig_code/fm_op_kernel.h -orig_code/fm_core.h -orig_code/dx7note.h -orig_code/dexed.h -orig_code/porta.h -orig_code/source_microdexed.h