As I created many amSynth presets for standalone usage, I needed to convert them to a different standard as I wanted to use them within the LV2 plugin version of amSynth. I converted the first presets by hand, which was a painstaking experience. As I had many more to go, I wondered whether I could automate this process. With trial and error, I created a script. It uses a template, copies it, and replaces the values from the given preset.
You can download the script and the template here or copy, paste and save the code below, between and :
#!/bin/bash
# Name: amSynthPresetConverter.sh
#
# Author: Winko Erades van den Berg
# Date: October 23, 2018
# Revised: October 23, 2018
#
# Purpose: To convert amSynth presets to LV2 preset
#
# You would need to make this file executable by giving executable
# permissions: eg. chmod +x ./netbook.bash
# Usage:
# ./amSynthPresetConverter.sh
TEMPLATE=$1
FILENAME=$2
CPTEMPLATE=$(date +%Y%m%d%H%M%S)$TEMPLATE
cp $TEMPLATE $CPTEMPLATE
while read LINE; do
PARAMETER=””
VALUE=$(echo $LINE | cut -d ‘ ‘ -f 3)
if [[ $VALUE = *”.”* ]]
then
sed -i “s/$PARAMETER/$VALUE/g” $CPTEMPLATE
else
sed -i “s/$PARAMETER/$VALUE”.0″/g” $CPTEMPLATE
fi
done
Don’t forget to change the executable status of the file you just created by typing: sudo chmod +x ./amSynthPresetConverter.sh
It creates a new textfile called: (date and time) amSynthTemplate.txt
You can copy and paste its contents to your amsynth.lv2 folder into your amSynth.bank.ttl.
Dont forget to:
- change your preset name 🙂
- add your presets to amsynth.ttl
Suggestions for improving this article are welcome, please let me know and drop me a line.