I would recommend looking at a plugin framework like Distrho which takes care of all sorts of stuff for you, like for example being able to compile the same sound engine as LV2, VST, CLAP, or whatever.
I’m more than happy to chat about how to get it all working and what I’ve run into trying to get it all together, but I’m far easier to get in #ardour or #lad on IRC
Sadly it has been a long time since I have used WAF, but my memory is it wasn’t a huge bear, it did have some quirks but it wasn’t nearly as bad as scons that it replaced in that department. All that being said, for something as simple as that plugin, I would bet you could rebuild a build system for it with standard make files relatively quickly.
WAF and other similar build systems really come into their own when dealing with very complicated builds like Ardour.
Yet, for the whole thing you need a LV2 bundle a plugin-name.lv2 folder that contains the plugin binary, a manifest file and a plugin-description (both .ttl files).
–
If you are new to plugin dev and tempted to use some LLM assistance, I’d highly recommend to use FAUST. It has a huge library of DSP (filters, synths, reverbs…) and Dr. Julius Orion “Faust” Smith III poured all his knowledge into Claude lately. By indirection you can be certain that FAUST generated code is realtime safe, and you can directly generated LV2, VST3 etc from it. There is also an online IDE to do so: https://faustide.grame.fr/
It is even be a good idea if you don’t want AI assistance. Learning FAUST from scratch can be a bit mind bending, but there is a good online community too.
Gonna second this. I have some programming experience, but no DSP knowledge from an implementation standpoint, and yes FAUST is exactly my plan for if I go this route at all with LLMs.
But is seems it generates a conflict with ReasonableSynth, through my files ak-synth-1.ttl and manifest.ttl : impossible to find ReasonableSynth if I put these two files in the folder /usr/lib/lv2/ak-synth-1.lv2/
And look the picture of its MIDI outputs : it is an input on the place of an output.
And it’s no sound for the moment. Is it please some advice for me?
But now I have a new problem when I insert my plugin: lilv_plugin_instantiate(): error: No plugin <file:///usr/lib/lv2/ak-synth-1.lv2/ak-synth-1> in <file:///usr/lib/lv2/ak-synth-1.lv2/ak-synth-1.so>
I looked the code but have no idea what to do, can I have a new advice?
After actually having tested this myself it seems like you can’t have just a name in the RSY_URI and the other instances.
If you prefix it with urn: you should be able to run it. I.e. #define RSY_URI "urn:ak-synth-1" and <urn:ak-synth-1> in ak-synth-1.ttl , manifest.ttl and lv2.c
That works; I have a slider in the synth window, but how can I please access to my new parameter param1?
If I understand correctly, I have to change, in lv2.c, the switch ((PortIndex)port) part, but how can I do that? And how to access this value in rsynth.c? Can I have some advice?
And did I choose the right method?
music@k0:~/step-1/01$ cat ak-synth-1.ttl
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
<http://ardour.org/credits.html>
a foaf:Person ;
foaf:name "Ardour Community" ;
foaf:homepage <http://ardour.org/> .
<urn:ak-synth-1>
a lv2:Plugin, lv2:InstrumentPlugin, doap:Project;
doap:license <http://usefulinc.com/doap/licenses/gpl> ;
doap:maintainer <http://ardour.org/credits.html> ;
doap:name "ak synth 1";
lv2:optionalFeature lv2:hardRTCapable ;
lv2:requiredFeature urid:map ;
rdfs:comment """A simple synthesizer with no controls at all but a reasonable sound instead. Note that this synth does not respond to any Control or Program Messages. Its main purpose is to act as sensible default on new installations until other plugins are installed.""" ;
lv2:port
[
a atom:AtomPort ,
lv2:InputPort ;
atom:bufferType atom:Sequence ;
atom:supports <http://lv2plug.in/ns/ext/midi#MidiEvent> ;
lv2:index 0 ;
lv2:symbol "MidiIn" ;
lv2:name "MIDI Input" ;
],
[
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 1 ;
lv2:symbol "outL" ;
lv2:name "Left output" ;
lv2:designation pg:left ;
],
[
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 2 ;
lv2:symbol "outR" ;
lv2:name "Right Output" ;
lv2:designation pg:right ;
],
[
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "param1" ;
lv2:name "Parametre 1" ;
lv2:default 440.0 ;
lv2:minimum 20.0 ;
lv2:maximum 20000.0 ;
]
.
music@k0:~/step-1/01$ gcc --shared -o ak-synth-1.so -fPIC `pkg-config --cflags lv2` rsynth.c lv2.c