Skip to content

Commit

Permalink
add parameters to faust2dplug to configure plugin.json
Browse files Browse the repository at this point in the history
  • Loading branch information
abaga129 committed Dec 15, 2020
1 parent e20c183 commit 3ba03b6
Showing 1 changed file with 116 additions and 95 deletions.
211 changes: 116 additions & 95 deletions tools/faust2appls/faust2dplug
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

DEBUG=false

IS_SYNTH="0"
# MIDI not yet supported in this file. Needs to be connected in minimal-dplug.d architecture file
IS_MIDI="0"
FAUSTFLOAT="float"
VENDOR="Faust"
VENDORID="FaUs"
PLUGINID="PlUg"
HOMEPAGE="https://faust.grame.fr/"
EFFECTTYPE="effectOther"

while [ $1 ]
do
Expand All @@ -29,18 +29,34 @@ do
usage faust2dplug "[options] [Faust options] <file.dsp>"
require Dplug
echo "Compiles Faust programs to Dplug plugins."
option
options "-vendor <My Company Name>"
options "-vendorid <FaUs>"
options "-pluginid <PlUg>"
options "-homepage <https://faust.grame.fr/>"
options "-effectType <effectDynamics>"
exit
fi

if [ "$p" = -debug ]; then
DEBUG=true
elif [ $p = "-midi" ]; then
IS_MIDI="1"
elif [ ${p:0:1} = "-" ]; then
if [ $p = "-double" ]; then
FAUSTFLOAT="double"
fi
OPTIONS="$OPTIONS $p"
elif [ $p = "-vendor" ]; then
shift
VENDOR=$1
elif [ $p = "-vendorid" ]; then
shift
VENDORID=$1
elif [ $p = "-pluginid" ]; then
shift
PLUGINID=$1
elif [ $p = "-homepage" ]; then
shift
HOMEPAGE=$1
elif [ $p = "-effectType" ]; then
shift
EFFECTTYPE=$1
elif [[ -f "$p" ]]; then
FILES="$FILES $p"
else
Expand All @@ -51,6 +67,11 @@ shift

done

if [ $IS_MIDI -eq 1 ]; then
echo "MIDI not currently supported in Dplug architecture file."
exit
fi

DUBFILE="dub.json"
PLUGFILE="plugin.json"

Expand All @@ -67,111 +88,111 @@ for p in $FILES; do
mkdir $SRCDIR/$dspName
mkdir $SRCDIR/$dspName/source

sed -e"s?@vendor@?$VENDOR?g" -e"s?@vendorid@?$VENDORID?g" -e"s?@name@?$dspName?g" -e"s?@plugid@?$PLUGINID?g" -e"s?@homepage@?$HOMEPAGE?g" > $SRCDIR/$dspName/$PLUGFILE <<EOF
{
"\$schema": "https://raw.githubusercontent.com/AuburnSounds/dplug/master/plugin-schema.json",
"vendorName": "@vendor@",
"vendorUniqueID": "@vendorid@",
"vendorSupportEmail": "[email protected]",
"pluginName": "@name@",
"pluginHomepage": "@homepage@",
"pluginUniqueID": "@plugid@",
"publicVersion": "1.0.0",
"CFBundleIdentifierPrefix": "com.@venderid@",
"hasGUI": false,
"isSynth": false,
"receivesMIDI": false,
"category": "effectDistortion"
}
sed -e"s?@vendor@?$VENDOR?g" -e"s?@vendorid@?$VENDORID?g" -e"s?@name@?$dspName?g" -e"s?@plugid@?$PLUGINID?g" -e"s?@homepage@?$HOMEPAGE?g" -e"s?@effecttype@?$EFFECTTYPE?g" > $SRCDIR/$dspName/$PLUGFILE <<EOF
{
"\$schema": "https://raw.githubusercontent.com/AuburnSounds/dplug/master/plugin-schema.json",
"vendorName": "@vendor@",
"vendorUniqueID": "@vendorid@",
"vendorSupportEmail": "[email protected]",
"pluginName": "@name@",
"pluginHomepage": "@homepage@",
"pluginUniqueID": "@plugid@",
"publicVersion": "1.0.0",
"CFBundleIdentifierPrefix": "com.@vendorid@",
"hasGUI": false,
"isSynth": false,
"receivesMIDI": false,
"category": "@effecttype@"
}
EOF

sed -e"s?@name@?$dspName?g" > $SRCDIR/$dspName/$DUBFILE <<EOF
{
"\$schema": "https://raw.githubusercontent.com/Pure-D/code-d/master/json-validation/dub.schema.json",
"name": "@name@",
"license": "public domain",
"importPaths": [ "." ],
"sourcePaths": [ "." ],
"stringImportPaths": ["gfx", "fonts", "."],
"copyright": "none",
"dflags-linux-dmd": ["-defaultlib=libphobos2.a"],
"dflags-osx-ldc": ["-static"],
"dflags-linux-ldc": ["-link-defaultlib-shared=false"],
"dflags-linux-x86_64-ldc": ["-fvisibility=hidden"],
"dflags-windows-ldc": ["-mscrtlib=libcmt"],
"comment-WARNING-READ-THIS-IS-IMPORTANT": [
" When making your own plug-in you have to CHANGE THESE DEPENDENCY ",
" SPECIFICATIONS below from path-based to ~>MAJOR.MINOR ",
" Example: ~>7.0 ",
" See also the DUB documentation: ",
" https://code.dlang.org/package-format?lang=json#version-specs "],
"dependencies":
{
"\$schema": "https://raw.githubusercontent.com/Pure-D/code-d/master/json-validation/dub.schema.json",
"name": "@name@",
"license": "public domain",
"importPaths": [ "." ],
"sourcePaths": [ "." ],
"stringImportPaths": ["gfx", "fonts", "."],
"copyright": "none",
"dflags-linux-dmd": ["-defaultlib=libphobos2.a"],
"dflags-osx-ldc": ["-static"],
"dflags-linux-ldc": ["-link-defaultlib-shared=false"],
"dflags-linux-x86_64-ldc": ["-fvisibility=hidden"],
"dflags-windows-ldc": ["-mscrtlib=libcmt"],
"comment-WARNING-READ-THIS-IS-IMPORTANT": [
" When making your own plug-in you have to CHANGE THESE DEPENDENCY ",
" SPECIFICATIONS below from path-based to ~>MAJOR.MINOR ",
" Example: ~>7.0 ",
" See also the DUB documentation: ",
" https://code.dlang.org/package-format?lang=json#version-specs "],
"dependencies":
"dplug:dsp": "~>10",
"dplug:vst3": "~>10",
"dplug:vst": "~>10",
"dplug:au": "~>10",
"dplug:lv2": "~>10",
"dplug:gui": "~>10",
"dplug:pbr-widgets": "~>10"
},
"versions": ["futureMouseOver", "futurePBRNormals"],
"configurations": [
{
"dplug:dsp": "~>10",
"dplug:vst3": "~>10",
"dplug:vst": "~>10",
"dplug:au": "~>10",
"dplug:lv2": "~>10",
"dplug:gui": "~>10",
"dplug:pbr-widgets": "~>10"
"name": "VST3",
"versions": ["VST3"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-vst3.lst", "-dead_strip" ]
},
"versions": ["futureMouseOver", "futurePBRNormals"],
"configurations": [
{
"name": "VST3",
"versions": ["VST3"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-vst3.lst", "-dead_strip" ]
},
{
"name": "VST",
"versions": ["VST"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ]
},
{
"name": "AU",
"versions": ["AU"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-au.lst", "-dead_strip" ]
},
{
"name": "LV2",
"versions": ["LV2"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-lv2.lst", "-dead_strip" ]
}
]
}
{
"name": "VST",
"versions": ["VST"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ]
},
{
"name": "AU",
"versions": ["AU"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-au.lst", "-dead_strip" ]
},
{
"name": "LV2",
"versions": ["LV2"],
"targetType": "dynamicLibrary",
"lflags-osx-ldc": [ "-exported_symbols_list", "module-lv2.lst", "-dead_strip" ]
}
]
}
EOF

cat > $SRCDIR/$dspName/module-au.lst << EndOfFile
_dplugAUEntryPoint
_dplugAUComponentFactoryFunction
_dplugAUEntryPoint
_dplugAUComponentFactoryFunction
EndOfFile

cat > $SRCDIR/$dspName/module-lv2.lst << EndOfFile
_GenerateManifestFromClient
_lv2_descriptor
_lv2ui_descriptor
_GenerateManifestFromClient
_lv2_descriptor
_lv2ui_descriptor
EndOfFile

cat > $SRCDIR/$dspName/module-vst3.lst << EndOfFile
_InitDll
_ExitDll
_GetPluginFactory
_bundleEntry
_bundleExit
_InitDll
_ExitDll
_GetPluginFactory
_bundleEntry
_bundleExit
EndOfFile

Expand Down

0 comments on commit 3ba03b6

Please sign in to comment.