Added dx7lv2sounds2preset: A script which creates manifest.ttl and presets.ttl.

Added options to dx7sysex2lv2: "-b" (for adding bank-name to voice-name) and -n (for adding voice-number to voice-name).
Smaller fixes.
pull/1/head
root 8 years ago
parent 9700333fbe
commit 9978e4ab0a
  1. 99
      bin/dx7lv2sounds2preset
  2. 54
      bin/dx7sysex2lv2
  3. 3
      doc/mpb.txt
  4. 2
      src/Makefile
  5. 2
      src/dexed.mk

@ -0,0 +1,99 @@
#!/usr/bin/perl
#
# dx7lv2sounds2preset - create a presets.ttl and add this to manifest.ttl for
# Dexed.lv2 - LV2 plugin
#
# This generator builds the presets-ttl and a suitable manifest.ttl
#
# (c) by H. Wirtz <dcoredump@googlemail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
open(MANIFEST,">manifest.ttl")||die("Cannot open manifest.ttl for writing: $!\n");
print MANIFEST "\@prefix lv2: <http://lv2plug.in/ns/lv2core#> .\n";
print MANIFEST "\@prefix pset: <http://lv2plug.in/ns/ext/presets#> .\n";
print MANIFEST "\@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n";
print MANIFEST "\@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .\n";
print MANIFEST "\@prefix mdap: <http://moddevices.com/plugins/mda/presets#> .\n";
print MANIFEST "\@prefix pset: <http://lv2plug.in/ns/ext/presets#> .\n";
print MANIFEST "\@prefix doap: <http://usefulinc.com/ns/doap#> .\n";
print MANIFEST "\@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n";
print MANIFEST "\n";
print MANIFEST "<https://github.com/dcoredump/dexed.lv2>\n";
print MANIFEST " a lv2:Plugin, doap:Project, lv2:SynthPlugin ;\n";
print MANIFEST " rdfs:seeAlso <Dexed.ttl> ;\n";
print MANIFEST " rdfs:seeAlso <modgui.ttl> .\n";
print MANIFEST "\n";
open(PRESETS,">presets.ttl")||die("Cannot open presets.ttl for writing: $!\n");
print PRESETS "\@prefix lv2: <http://lv2plug.in/ns/lv2core#> .\n";
print PRESETS "\@prefix pset: <http://lv2plug.in/ns/ext/presets#> .\n";
print PRESETS "\@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n";
print PRESETS "\n";
while($voice=shift(@ARGV))
{
insert_data($voice);
}
close(PRESETS);
close(MANIFEST);
sub insert_data
{
my($voice)=@_;
open(M_VOICE,"<".$voice."/manifest.ttl")||die("Cannot open ".$voice."/manifest.ttl: $!\n");
while($l=<M_VOICE>)
{
if($l=~/^\s*rdfs:label \"(.+)\"/)
{
$voice_name=$1
}
elsif($l=~/\s*rdfs:seeAlso <(.+)>/)
{
$file=$1;
}
}
close(M_VOICE);
if($voice_name eq "" || $file eq "")
{
print "Voice data for ".$voice."/manifest.ttl is not consistent\n";
print "voice: [$voice_name] file: [$file]\n";
return;
}
print MANIFEST "<https://github.com/dcoredump/dexed.lv2#".$voice_name.">\n";
print MANIFEST " a pset:Preset ;\n";
print MANIFEST " rdfs:label \"".$voice_name."\"\n";
print MANIFEST " lv2:appliesTo <https://github.com/dcoredump/dexed.lv2> ;\n";
print MANIFEST " rdfs:seeAlso <presets.ttl> .\n";
print MANIFEST "\n";
print PRESETS "<https://github.com/dcoredump/dexed.lv2#".$voice_name.">\n";
open(VOICE,"<".$voice."/".$file)||die("Cannot open ".$voice."/".$file.": $!");
while($l=<VOICE>)
{
next if($l=~/^\s*$/);
next if($l=~/^[^ ]/);
print PRESETS $l;
}
close(VOICE);
print PRESETS "\n";
}

@ -3,7 +3,7 @@
# dx7sysex2lv2presets - SysEx patchset to LV2 converter for # dx7sysex2lv2presets - SysEx patchset to LV2 converter for
# Dexed.lv2 - LV2 plugin # Dexed.lv2 - LV2 plugin
# #
# This generator builds the presets-ttl and a suitable manifest.ttl # This generator converts DX7 SYSEX to LV2 suitable sounds for Dexed
# #
# (c) by H. Wirtz <dcoredump@googlemail.com> # (c) by H. Wirtz <dcoredump@googlemail.com>
# #
@ -33,14 +33,34 @@ $LV2_BUNDLE_NAME="dexed.lv2";
$LV2_URI="https://github.com/dcoredump/".$LV2_BUNDLE_NAME; $LV2_URI="https://github.com/dcoredump/".$LV2_BUNDLE_NAME;
$LV2_INSTALL_PATH="/zynthian/zynthian-my-plugins/lv2"; $LV2_INSTALL_PATH="/zynthian/zynthian-my-plugins/lv2";
@CMD_OPTION=@ARGV;
while($option=shift(@CMD_OPTION))
{
if($option=~/^-(.+)\s*/)
{
if($1=~/b/i)
{
$option{'bank'}=1;
}
elsif($1=~/n/i)
{
$option{'voice_no'}=1;
}
}
}
while($SYSEX=shift(@ARGV)) while($SYSEX=shift(@ARGV))
{ {
next if($SYSEX=~/^-/);
$BANK=$SYSEX; $BANK=$SYSEX;
$BANK=~s{.*/}{}; # removes path $BANK=~s{.*/}{}; # removes path
$BANK=~s{\.[^.]+$}{}; # removes extension $BANK=~s{\.[^.]+$}{}; # removes extension
$_LV2_BUNDLE_NAME="dexed_lv2"; $_LV2_BUNDLE_NAME="dexed_lv2";
$voice_no=0;
open(SYSEX,"$DXSYX -y $SYSEX |") || die ("Cannot open \'$DXSYX -y $SYSEX\': $!"); open(SYSEX,"$DXSYX -y $SYSEX |") || die ("Cannot open \'$DXSYX -y $SYSEX\': $!");
while($s=<SYSEX>) while($s=<SYSEX>)
{ {
@ -51,6 +71,7 @@ while($SYSEX=shift(@ARGV))
if($s=~/^\s+voice_name:\s+(.+)\s*/) if($s=~/^\s+voice_name:\s+(.+)\s*/)
{ {
my($voice)=$1; my($voice)=$1;
$voice_no++;
$voice=~s/\s+$//; # right trim $voice=~s/\s+$//; # right trim
my($voice_name)=$voice; my($voice_name)=$voice;
$voice=~tr/[ %§&-*+\"\'`\!\$\%\?\/\<\>\[\]\^\{\}]\|/_/; $voice=~tr/[ %§&-*+\"\'`\!\$\%\?\/\<\>\[\]\^\{\}]\|/_/;
@ -63,13 +84,26 @@ while($SYSEX=shift(@ARGV))
$voice=~s/%7d/_/i; $voice=~s/%7d/_/i;
$voice=~s/%7c/_/i; $voice=~s/%7c/_/i;
if(defined($option{'voice_no'}) && defined($option{'bank'}))
{
$voice=$BANK."__".$voice_no."__".$voice;
}
elsif(defined($option{'bank'}))
{
$voice=$BANK."__".$voice;
}
elsif(defined($option{'voice_no'}))
{
$voice=$voice_no."__".$voice;
}
if($deeaxe_voice) if($deeaxe_voice)
{ {
print $deeaxe_voice " ] .\n"; print $deeaxe_voice " ] .\n";
close($deeaxe_voice); close($deeaxe_voice);
} }
my($path)=$LV2_INSTALL_PATH."/".$_LV2_BUNDLE_NAME."-".$BANK."_".$voice.".lv2"; my($path)=$LV2_INSTALL_PATH."/".$_LV2_BUNDLE_NAME."-".$voice.".lv2";
if(!-d $LV2_INSTALL_PATH) if(!-d $LV2_INSTALL_PATH)
{ {
@ -80,11 +114,11 @@ while($SYSEX=shift(@ARGV))
mkdir($path) || die("Cannot create dir \'$path\':$!\n"); mkdir($path) || die("Cannot create dir \'$path\':$!\n");
} }
print "Writing ".$path."/".$BANK."_".$voice.".ttl\n"; print "Writing ".$path."/".$voice.".ttl\n";
write_manifest($path,$voice); write_manifest($path,$voice);
open($deeaxe_voice,">".$path."/".$BANK."_".$voice.".ttl") || die ("Cannot open \'".$path."/".$BANK."_".$voice.".ttl\': $!"); open($deeaxe_voice,">".$path."/".$voice.".ttl") || die ("Cannot open \'".$path."/".$voice.".ttl\': $!");
write_preset_header($voice,$voice_name); write_preset_header($voice,$voice_name);
next; next;
} }
@ -117,11 +151,11 @@ sub write_preset_header
print $deeaxe_voice "\@prefix state: <http://lv2plug.in/ns/ext/state#> .\n"; print $deeaxe_voice "\@prefix state: <http://lv2plug.in/ns/ext/state#> .\n";
print $deeaxe_voice "\@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n"; print $deeaxe_voice "\@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n";
print $deeaxe_voice "\n"; print $deeaxe_voice "\n";
#print $deeaxe_voice "<".$LV2_URI."#".$BANK."_".$voice.">\n"; #print $deeaxe_voice "<".$LV2_URI."#".$voice.">\n";
print $deeaxe_voice "<>\n"; print $deeaxe_voice "<>\n";
print $deeaxe_voice " a pset:Preset ;\n"; print $deeaxe_voice " a pset:Preset ;\n";
print $deeaxe_voice " lv2:appliesTo <".$LV2_URI."> ;\n"; print $deeaxe_voice " lv2:appliesTo <".$LV2_URI."> ;\n";
#print $deeaxe_voice " rdfs:label \"".$BANK."-".$voice_name."\" ;\n"; #print $deeaxe_voice " rdfs:label \"".$voice_name."\" ;\n";
print $deeaxe_voice " lv2:port [\n"; print $deeaxe_voice " lv2:port [\n";
print_lv2_port("cutoff","1.0"); print_lv2_port("cutoff","1.0");
print $deeaxe_voice " ] , [\n"; print $deeaxe_voice " ] , [\n";
@ -182,13 +216,13 @@ sub write_manifest
print MANIFEST "\@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n"; print MANIFEST "\@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n";
print MANIFEST "\n"; print MANIFEST "\n";
#print MANIFEST "<".$LV2_URI."#".$BANK."_".$voice.">\n"; #print MANIFEST "<".$LV2_URI."#".$voice.">\n";
print MANIFEST "<".$BANK."_".$voice.".ttl>\n"; print MANIFEST "<".$voice.".ttl>\n";
print MANIFEST " lv2:appliesTo <".$LV2_URI."> ;\n"; print MANIFEST " lv2:appliesTo <".$LV2_URI."> ;\n";
#print MANIFEST " a pset:Bank $BANK ;\n"; #print MANIFEST " a pset:Bank $BANK ;\n";
print MANIFEST " a pset:Preset ;\n"; print MANIFEST " a pset:Preset ;\n";
print MANIFEST " rdfs:label \"".$BANK."-".$voice."\" ;\n"; print MANIFEST " rdfs:label \"".$voice."\" ;\n";
print MANIFEST " rdfs:seeAlso <".$BANK."_".$voice.".ttl> .\n"; print MANIFEST " rdfs:seeAlso <".$voice.".ttl> .\n";
close(MANIFEST); close(MANIFEST);
} }

@ -2,6 +2,9 @@ docker pull moddevices/mod-plugin-builder
docker run -ti --name mpb -p 9000:9000 -v ~/src/mod/local-mod-folder:/tmp/local-mod-folder moddevices/mod-plugin-builder docker run -ti --name mpb -p 9000:9000 -v ~/src/mod/local-mod-folder:/tmp/local-mod-folder moddevices/mod-plugin-builder
docker start -i mpb docker start -i mpb
Create archive:
cd ~/mod-workdir/plugins/
tar cvzf /tmp/local-mod-folder/dexed.lv2.tar.gz dexed.lv2
Install: Install:
curl http://web1.moddevices.com/shared/mod-loopswitch4.lv2.tar.gz | base64 | curl -F 'package=@-' http://192.168.51.1/sdk/install curl http://web1.moddevices.com/shared/mod-loopswitch4.lv2.tar.gz | base64 | curl -F 'package=@-' http://192.168.51.1/sdk/install

@ -68,7 +68,7 @@ endif
all: $(BUNDLE) Makefile all: $(BUNDLE) Makefile
clean: Makefile clean: Makefile
rm -f *.o *~ *.bak *.gch dexed_ttl.h *.so *.gch msfa/*.gch rm -f *.o *~ *.bak *.gch *.so *.gch msfa/*.gch
rm -rf $(BUNDLE) rm -rf $(BUNDLE)
install: $(BUNDLE) install: $(BUNDLE)

@ -5,7 +5,7 @@
###################################### ######################################
DEXED_DEPENDENCIES = lvtk DEXED_DEPENDENCIES = lvtk
DEXED_VERSION = e95b8626cd2a6a3175df5238ca4efb05e470e4ef DEXED_VERSION = 9700333fbe2b1388963b32672c6966cf21fd6232
DEXED_BUNDLES = dexed.lv2 DEXED_BUNDLES = dexed.lv2
DEXED_SITE = $(call github,dcoredump,dexed,$(DEXED_VERSION)) DEXED_SITE = $(call github,dcoredump,dexed,$(DEXED_VERSION))
DEXED_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) MOD=1 DEXED_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) MOD=1

Loading…
Cancel
Save