#!/bin/bash ZYN_URI="http://kxstudio.sf.net/carla/plugins/zynaddsubfx" rm -rf carla-zyn-presets.lv2 mkdir carla-zyn-presets.lv2 cd carla-zyn-presets.lv2 echo "\ @prefix lv2: . @prefix pset: . @prefix rdfs: . " > manifest.ttl ls "/usr/share/zynaddsubfx/banks/" | while read i; do BANK_NAME=$i BANK_URI=`echo $BANK_NAME | awk '{ sub(" ","%20"); print }' | awk '{ sub(" ","%20"); print }'` echo "\ <$ZYN_URI#bank_$BANK_URI> a pset:Bank ; rdfs:label \"$BANK_NAME\" . " >> manifest.ttl echo "\ @prefix lv2: . @prefix pset: . @prefix state: . " > "bank-$BANK_NAME.ttl" ls "/usr/share/zynaddsubfx/banks/$i" | while read j; do if [ "$j"x != "README"x ]; then PROG_NAME=$j PROG_URI=`echo $PROG_NAME | awk '{ sub(".xiz",""); print }' | awk '{ sub(" ","%20"); print }' | awk '{ sub(" ","%20"); print }' | awk '{ sub(" ","%20"); print }' | awk '{ sub(" ","%20"); print }'` echo "\ <$ZYN_URI#preset_"$BANK_URI"_"$PROG_URI"> a pset:Preset ; lv2:appliesTo <$ZYN_URI> ; rdfs:label \"$BANK_NAME: $PROG_NAME\" ; rdfs:seeAlso . " >> manifest.ttl echo "\ <$ZYN_URI#preset_"$BANK_URI"_"$PROG_URI"> a pset:Preset ; lv2:appliesTo <$ZYN_URI> ; pset:bank <$ZYN_URI#bank_$BANK_URI> ; state:state [ \"\"\"" >> "bank-$BANK_NAME.ttl" echo $j cat "/usr/share/zynaddsubfx/banks/$i/$j" | gzip -d >> "bank-$BANK_NAME.ttl" echo "\"\"\" ] . " >> "bank-$BANK_NAME.ttl" fi done done