You are here

Best format for writing instrument plugins for Qtractor?

Hello,

I've recently been evaluating the current state of Linux audio, and how I can best contribute to it. I came to the conclusion that what's needed most right now is a broader selection of reasonable quality plugins. Because of this, I decided to start a library of various high quality synth/sampler/effect components that form an easy-to-program plugin API. Eventually, I'd like to add a visual designer so that non-programmer types can wire together their own plugins, not unlike SynthEdit, SynthMaker or Reaktor for Windows users.

I would like to support Qtractor as the target DAW, but I would also like the plugins to work in Ardour and Rosegarden. I would like to ask more knowledgeable folks the following questions before I start writing any code:

1. What is the best format to write instrument plugins for Qtractor? I need one that has robust instrument-state saving support as part of the Qtractor project file, full MIDI input support, and supports various audio input and output configurations. DSSI seems to be no longer supported, and I'm unsure of the capabilities of LV2 and LADSPA. I would prefer not to use the Vestige API, as I don't want to continue perpetuating any Steinberg audio standards. I also don't care about supporting any platform other than Linux, Windows and Mac users already have their fair share of plugins.

2. I'm leaning towards using GTK as the default interface rather than QT, but TBH, I don't have much experience with either. I assume that using GTK plugins within Qtractor won't cause any problems, but is there anything else I should consider before I settle on GTK? I do have a fair bit of experience with Windows forms applications, and I even own an open source Winforms/C# project, so I'm sure I could pick up either fairly quickly, I just don't want to pick the wrong one and regret it later ;)

Forums: 
rncbc's picture

in short

  1. there's only future on lv2.
  2. it's perfectly alright to use gtk+ for the gui, but...
  3. stay away from gtkmm, use pure gtk+ as much as you can

also,

consider hanging out at the #lv2 channel on irc.freenode.net; drobilla (aka. Dave Robillard) is the guru in charge of most if not all things related inside out of lv2 :)

merry x-mas
cheers

Thank you very much for sharing your wisdom, and a merry Christmas to you :)

I'm back :)

I've been studying up on LV2 development, however, I'm struggling to get the official example plugins to compile; I'm not sure if I'm using the incorrect version of lv2core(it doesn't specify), or if I need some sort of odd compiler flags... but that's not what I came here to ask you...

What I did come here to ask is: Is there a particular version of lv2core, lv2-midi and lv2-ui that I should be targeting if my ultimate goal is perfect compatibility with Qtractor?

I'm only looking to display a GUI, consume audio and midi coming in from Qtractor, and to be able to output audio again, I don't need any other advanced features of the LV2 API.

Thanks again

rncbc's picture

yes, you can go with the most recent, i think dated of last november, which are all found on http://lv2plug.in,

btw, quite recently, falktx come up with this testing lv2 plugin with a qt4 gui--you can try it out. imnsho, i think it's the most simplest to grok and compile. and it's plain and modern qt4 gui :)
http://kxstudio.sourceforge.net/tmp/stereo-audio-gain.tar.gz

0. unwrapp:

tar -zxf stereo-audio-gain.tar.gz
cd stereo-audio-gain

1. build:

qmake audiogain-lv2.pro
make

2. install:

cp -a audiogain.lv2 ~/.lv2/

nb. only works with latest qtractor 0.5.3.

study the code, which is dead easy to read (in my standards:)--adding a midi event input port and processing is here left to you as an exercise ;)

also, always remember to join #lv2 channel on irc.freenode.net. i'm not seasoned on lv2 plugin development, specially regarding that turtle stuff (.ttl) that every lv2 plugin must manifest (pun intended:)

cheers

After evaluating LV2 and discussing it with Dave, I actually wound up deciding to go with DSSI for now, with a Qt/C++ front end, and the audio DSP parts written in C.

I registered the following sourceforge page:

http://sourceforge.net/p/libmodsynth/

...and I dumped my pre-alpha prototype there(which is a gutted out version of the DSSI example synthesizer with components of my LibModSynth library)... The prototype itself isn't much to look at(or listen to) just yet, but it is a functional polyphonic synthesizer, based on my library of oscillators, filters, etc... Once I finish creating proper pre-canned GUI bits, some documentation, and a few more modules to make the library truly useful, I think it will be pretty easy and fast for most people to program a decent synth by adding maybe 50 to 100 lines of code to my template.

At my current rate of progress, I'm expecting to have an alpha release out within a few weeks, and possibly a 1.0 release within a few months. At that time, I would like you to do some basic testing to ensure 100% compatibility with Qtractor, sort of an official "certified to be compatible with Qtractor" thing. Of course, I am willing to pay you for your time :)

Thanks again,
Jeff

Hey Jeff!
Tried it out today. Some feedback.

1. DSSI vs LV2 from a user standpoint.
I see you have decided to go for DSSI for some technical reasons I am not aware of and probably won't understand not being a programmer, but from a user standpoint, DSSI has no presets which is a pity. Not being a good synth tweaker, I would prefer to look at several presets when checking out a synth to just understand what kind of sound it is capable of producing.

2. GUI.
I can only see standard Properties GUI in Qtractor, when I try to invoke the original GUI as I saw on the screenshot, I get nothing. Could be I am checking out too early ;)

3. Multiple notes issue.
When I hit three notes at a time, my system freezes for several seconds and lots of XRUNs are produced.

Hope this helps. I am very happy people are doing synths, I do wish you luck with working on your synth and I will be happy to help out with testing!

rncbc's picture

hey Luigi,

DSSI has no presets? that's incorrect i'm afraid, even on the user point of view :)

first, let me throw some ashes to the so called "preset" confusion ou there:

  1. host maintained presets - these are gathered, stored and provided by the host application, being qtractor the example at hand. a qtractor preset is a snapshot of a given plugin state, from host pov. qtractor supports these for all plugin types without exception and are stored internally in its configuration file. on special cases where state data is more that just control parameter values (eg. chunk blobs on vst, configurations on dssi, state extension on lv2) these might translate in an external file (.qtx suffix). these kind of presets are named on a plugin basis and accessed from the plugin properties dialog on qtractor (ie. generic gui). you just give it a name and press save. later you can retrieve that named preset for the same plugin, on any other or same plugin instance, track or session, by selecting its saved name from the drop-down list. of course, you the user, are responsible to create these kind of presets, as there are none on day zero.
  2. plugin supplied presets - these are special provided by each plugin it self. the user manages preset selection from the plugin's proper gui if any. it's on plugin vendor option whether it comes with a list of already made presets or none at all. these maybe presented in the form of external files or simply built-in. these latter case may also be called "factory presets" in analogy with the outboard hardware (sound module racks, physical keyboard synths, etc.). so it all depends on the specific plugin you're dealing with. only ladspa plugins cannot have these, just because it does not support native gui editors. all other plugin specs apply (dssi, vst or lv2) as long its own gui presents its own dedicated preset management (select/load/save) interface to the user.
  3. midi bank/program addressable presets - these are usually an operational extension to the above plugin supplied presets and to date is only supported under dssi and vst specs. iow. the plugin must have its own internal preset database where each entry is mapped to a midi bank and program number. that way presets can be selected via midi bank-select and program-change event messages as part of a session composition setup and/or performance. in qtractor, this interface is supported through the midi track instruments gizmo for proper setup.

in way of conclusion, if a dssi plugin (gui) doesn't show you any presets for pre-listening/selection than, i'm sure, it was the developer or vendor choice for not doing so. it's not dssi design fault. moreover, both dssi and vst specs support the third kind, (c.) midi instrument programs, which lv2 is still lacking, to date. there are some old and new proposals for an lv2 extension for that (lv2_programs?) still in the closet however...

hth.
cheers

Thanks for chiming in Rui, I'll provide some more clarification:

1. Presets: I do have presets included as an integral part of LibModSynth, but I call them "Programs", to comply with the official MIDI nomenclature :) See the upper left corner of the synth here:

http://libmodsynth.sourceforge.net/index.php?page=gallery

2. GUI: Qtractor < 0.5.1 won't show the GUI, I guess it's a bug that Rui has since fixed. I've provided pre-compiled binaries of Qtractor that you can use as long as your Qt and Jack dependencies are up-to-date:

http://sourceforge.net/projects/libmodsynth/files/3rd_party/

3. The xruns: If you're running a program/preset that has many unison voices, it may be more than your computer can handle. The best thing to do is open something like System Monitor and see if one of your cores is hitting close to 100% CPU usage. If it's not hitting anywhere close to 100%, and your latency settings aren't ridiculously low, then it could be a problem with my plugin or possibly jackd or some other part of the stack, at which point you should notify me so I can either fix it, or if it's not a bug in my project, I can at least point you in the right direction.

The initial version I released has no special compiler optimizations, as we speak I'm testing it with -o3 -msse -msse2 and -msse3, which will then limit my users to using computers no older than late era Pentium 4s and later Athlon 64s. However, the compiler optimizations should greatly improve the number of voices you can run.

Also, Rui's website is probably not the best place to ask for help with my project, I don't read it everyday ;) The only reason I saw it is because I was checking for new releases of Qtractor. The 2 best places to ask for help are here:

http://sourceforge.net/projects/libmodsynth/

or on linuxmusicians.com:

http://linuxmusicians.com/viewtopic.php?f=1&t=7713&sid=65d6098ba03c16784...

I do appreciate any bug reports though, I also currently have several small bug-fixes already committed to GIT that will be released any day now. Of course, if you follow the progression of my project, it's to be expected that there are probably still bugs:

18Dec: Profess that I have no idea what I'm doing, ask Rui's help
13Jan: Change course, begin making progress
2Feb: Several thousand harmonius lines of code later, make 1.0 stable release announcement on linuxmusicians.com

That is, by any reasonable standard, an insanely short amount of time for one developer to write a useful and stable piece software in languages I've never used before on an unfamiliar platform ;)

Thanks,
Jeff

Add new comment