Call for Surge's LV2-presets

I just commited 2 new factory banks for Surge: Monosynth & Bass

For enjoying them, follow the standard procedure:

  • update
  • from webconf->LV2-Plugins, click “Search for new Plugin & Presets” button and wait (it takes a little bit to parse the LV2 world)
  • restart zynthian-UI (or reboot)

I assume that all the presets available initially from the Surge’s GUI are free, as they are included on the github repository, that has GPL3 license. If not, i hope you send me a decent cake. Over 2 years of wyleu’s rook soup is enough for anyone :sweat_smile:

Ahhh! The script:

create_lv2_bundle_bank_surge.sh (1.9 KB)

#!/bin/bash

#------------------------------------------------------------------------------
# Script to generate a LV2-preset-bank from a set of single-preset bundles,
# like those generated by jalv.gtk and others.
#------------------------------------------------------------------------------
# => First parameter:  Bank sufix common to all single-preset bundles. 
#                      For instance, if all preset-bundles have dirnames like 
#                      "Surge_006-Factory_Monosynth_XXX.lv2", you should take 
#                      "006-Factory_Monosynth".
#
# => Second parameter: If specified, it will be used for naming the generated
#                      bank. If not, the first parameter is used.
#------------------------------------------------------------------------------

BANK_NAME=$1

if [ ! -z "$2" ]; then
	BANK_RENAME=$2
else
	BANK_RENAME=$BANK_NAME
fi

PLUGIN_URI="https://surge-synthesizer.github.io/lv2/surge"
PREFIX="Surge_$BANK_NAME"

DEST_DIR="$ZYNTHIAN_MY_DATA_DIR/presets/lv2/Surge_$BANK_RENAME.lv2"

# Create Bundle directory
rm -rf "$DEST_DIR"
mkdir "$DEST_DIR"

# Copy Preset files
cp $PREFIX*/$BANK_NAME*.ttl "$DEST_DIR"

# Copy manifest header
cd $(ls -d $PREFIX*/|head -n 1)
sed -n '/^@/p' manifest.ttl > "$DEST_DIR/manifest.ttl"
cd ..

# Add Bank definition to manifest
echo -e "" >> "$DEST_DIR/manifest.ttl"
echo -e "<$BANK_RENAME>" >> "$DEST_DIR/manifest.ttl"
echo -e "\tlv2:appliesTo <$PLUGIN_URI> ;" >> "$DEST_DIR/manifest.ttl"
echo -e "\ta pset:Bank ;" >> "$DEST_DIR/manifest.ttl"
echo -e "\trdfs:label \"${BANK_RENAME//_/ }\" ." >> "$DEST_DIR/manifest.ttl"

# Combine manifest bodies
for f in $PREFIX*/manifest.ttl; do
	sed '/^@/d' "$f" >> "$DEST_DIR/manifest.ttl"
done

# Add Bank to Presets
sed -i "s/a pset:Preset ;/a pset:Preset ;\n\tpset:bank <$BANK_RENAME> ;/g" "$DEST_DIR/manifest.ttl" 

# Remove Bank Name from Preset Label
cd "$DEST_DIR"
for f in $BANK_NAME*.ttl; do
	sed -i "s/$BANK_NAME-//g" $f
done
cd ..

Regards!

3 Likes