[LAD] LV2 Pitch bend control port (and function)

Phil CM philcm at gnu.org
Thu Oct 2 18:02:29 UTC 2014

On 02/10/2014 16:42, Harry van Haaren wrote:
> Hi,
> When replying, please be careful to reply to the list, as well as the
> person: otherwise 1/2 a conversation gets lost ;) I've included
> linux-audio-dev at lists.linuxaudio.org  again.
> On Thu, Oct 2, 2014 at 4:13 PM, Phil CM <philcm at gnu.org> wrote:
>> On 02/10/2014 14:13, Harry van Haaren wrote:
>>> On Thu, Oct 2, 2014 at 1:14 PM, Phil CM <philcm at gnu.org> wrote:
>>>> I need a synth with a pitch control. A synth that can be controlled to
>>>> produce all tones between one note and another, say from a2 to c3 in an
>>>> anti-aliased way, like what you would get in pd by altering the pitch of
>>>> a
>>>> sine wave.
>>> Hi Phil,
>>> To start, welcome to LV2 programming: audio plugins are fun and complex
>>> area!
>> Thanks :)
>>> If you haven't already, I suggest you checkout the "plugins" directory
>>> in the lv2 repository. It provides the best example code you'll find,
>>> and accompanying http://lv2plug.in/book/  provides detailed
>>> explainations and best-practices.
>> This is my bedside reading for the next days to come ; Too bad the examples
>> do not include a simple synth :(
> That's what I thought too, so I wrote a sin-generator a few years ago:
> it apparently hasn't been included in the lv2 source yet. I'll CC
> David Robillard, and see if that's an option :)
> https://github.com/harryhaaren/lv2/tree/master/plugins/eg-sinsynth.lv2
> I remember now that it doesn't accept MIDI input yet: which means it
> doesn't handle notes, or pitch bend. These can be added quite
> trivially, and is something that I'd be willing to collaborate on?
> You'd learn how to "manually" use MIDI, and we'd have a better
> resource.
Then how do you make it sound? I'm curious.
Your proposition is precious, Harry. Thank you very much for your help.
> Please note that the GUI code is NOT something to learn from: its not
> advised to use GTK for plugin UI's.
> That said, the code is pretty short, and does actually work: perhaps
> learn from it, and then use a more lightweight UI framework ( NTK
> being my / OpenAV's favorite: http://non.tuxfamily.org/wiki/NTK )
Funny, I was just reading your blog post 
about it :)

But I cannot get it to build because of a gtkmm error:

Waf: Entering directory `/home/px/.kituu/bin/src/lv2/build'
[37/44] cxx: plugins/eg-sinsynth.lv2/widget.cpp -> 
[38/44] cxx: plugins/eg-sinsynth.lv2/sinsynth_gui.cpp -> 
[42/44] cshlib: build/plugins/eg-amp.lv2/amp.c.3.o -> 
[43/44] subst: lv2.pc.in -> build/lv2.pc
In file included from ../plugins/eg-sinsynth.lv2/widget.cpp:4:0:
../plugins/eg-sinsynth.lv2/widget.h:9:31: fatal error: 
gtkmm/drawingarea.h: No such file or directory
  #include <gtkmm/drawingarea.h>
compilation terminated.
../plugins/eg-sinsynth.lv2/sinsynth_gui.cpp:9:19: fatal error: gtkmm.h: 
No such file or directory
  #include <gtkmm.h>
compilation terminated.
Waf: Leaving directory `/home/px/.kituu/bin/src/lv2/build'
Build failed
  -> task in 'sinsynth_gui' failed (exit status 1):
         {task 3066761580L: cxx widget.cpp -> widget.cpp.4.o}
['/usr/bin/g++', '-I/home/px/.kituu/bin/src/lv2', '-DNDEBUG', 
'-fshow-column', '-I/home/px/.kituu/bin/src/lv2/build', 
'-I/home/px/.kituu/bin/src/lv2', '-I/home/px/.kituu/bin/src/lv2/build', 
'../plugins/eg-sinsynth.lv2/widget.cpp', '-c', '-o', 
  -> task in 'sinsynth_gui' failed (exit status 1):
         {task 3066761772L: cxx sinsynth_gui.cpp -> sinsynth_gui.cpp.4.o}
['/usr/bin/g++', '-I/home/px/.kituu/bin/src/lv2', '-DNDEBUG', 
'-fshow-column', '-I/home/px/.kituu/bin/src/lv2/build', 
'-I/home/px/.kituu/bin/src/lv2', '-I/home/px/.kituu/bin/src/lv2/build', 
'../plugins/eg-sinsynth.lv2/sinsynth_gui.cpp', '-c', '-o', 

Although I do have both

libgtkmm-2.4-dev: /usr/include/gtkmm-2.4/gtkmm.h
libgtkmm-3.0-dev: /usr/include/gtkmm-3.0/gtkmm.h

installed... I too find NTK really nice and lightweight, BTW. I know it 
because it's used by Fabla, Sorcer, NSM etc. A simple sine-generating 
synth plugin with a NTK GUI would be a cool place to start, I must say.

About this pitch-bend thing, I discovered So-404 and it does exactly 
what I want in a way I had not though about :

"If two notes are played together the pitch will slide according to the 
portamento time" I guess that's exactly what I want. Plus an attack time 
setting ;)

>> OK, so I'm going to get back once I managed to make a basic synth to get to
>> this pitch bending special case.
> Sure, good plan.
>>> I do strongly advise to checkout the plugins: they are a brilliant
>>> reference to make LV2 plugins.
>> Again, it's really a shame that there is no sound synthesis plugin
>> demonstrated... I'm going to study them all anyway.
>>> Ok, that's quite a lot of info already I think!
>>> LV2 specific development:
>>> #lv2 on irc.freenode.net  (I'm "HarryHaaren", say Hi if/when you're on)
>>> Mailing list (low-traffic):
>>> http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in
>>> Cheers, -Harry
>> Thanks a bunch, Harry
> You're welcome. I like LV2, its the way forward: if I can help out
> somewhat (apart from developing stuff myself) its also a pleasure, I
> know LV2 can be a touch daunting, and a helping hand does make it a
> lot easier there!
> Cheers, -Harry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20141002/90f086aa/attachment.html>

More information about the Linux-audio-dev mailing list