You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MicroDexed/addon/tools/banks2c.sh

22 lines
858 B

#!/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