Audio plugin host https://kx.studio/carla
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.

generate-zynaddsubfx-presets.sh 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. ZYN_URI="http://kxstudio.sf.net/carla/plugins/zynaddsubfx"
  3. rm -rf carla-zyn-presets.lv2
  4. mkdir carla-zyn-presets.lv2
  5. cd carla-zyn-presets.lv2
  6. echo "\
  7. @prefix lv2: <http://lv2plug.in/ns/lv2core#> .
  8. @prefix pset: <http://lv2plug.in/ns/ext/presets#> .
  9. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
  10. " > manifest.ttl
  11. ls "/usr/share/zynaddsubfx/banks/" | while read i; do
  12. BANK_NAME=$i
  13. BANK_URI=`echo $BANK_NAME | awk '{ sub(" ","%20"); print }' | awk '{ sub(" ","%20"); print }'`
  14. echo "\
  15. <$ZYN_URI#bank_$BANK_URI>
  16. a pset:Bank ;
  17. rdfs:label \"$BANK_NAME\" .
  18. " >> manifest.ttl
  19. echo "\
  20. @prefix lv2: <http://lv2plug.in/ns/lv2core#> .
  21. @prefix pset: <http://lv2plug.in/ns/ext/presets#> .
  22. @prefix state: <http://lv2plug.in/ns/ext/state#> .
  23. " > "bank-$BANK_NAME.ttl"
  24. ls "/usr/share/zynaddsubfx/banks/$i" | while read j; do
  25. if [ "$j"x != "README"x ]; then
  26. PROG_NAME=$j
  27. 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 }'`
  28. echo "\
  29. <$ZYN_URI#preset_"$BANK_URI"_"$PROG_URI">
  30. a pset:Preset ;
  31. lv2:appliesTo <$ZYN_URI> ;
  32. rdfs:label \"$BANK_NAME: $PROG_NAME\" ;
  33. rdfs:seeAlso <bank-$BANK_URI.ttl> .
  34. " >> manifest.ttl
  35. echo "\
  36. <$ZYN_URI#preset_"$BANK_URI"_"$PROG_URI">
  37. a pset:Preset ;
  38. lv2:appliesTo <$ZYN_URI> ;
  39. pset:bank <$ZYN_URI#bank_$BANK_URI> ;
  40. state:state [
  41. <http://kxstudio.sf.net/ns/carla/chunk>
  42. \"\"\"" >> "bank-$BANK_NAME.ttl"
  43. echo $j
  44. cat "/usr/share/zynaddsubfx/banks/$i/$j" | gzip -d >> "bank-$BANK_NAME.ttl"
  45. echo "\"\"\"
  46. ] .
  47. " >> "bank-$BANK_NAME.ttl"
  48. fi
  49. done
  50. done