simplistic linux/vst3 plugin example/framework

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: simplistic linux/vst3 plugin example/framework

Post by tramp »

skei wrote:be warned, it is "in progress" :-)
:) development is progress, isn't it?

I can't find your X event loop in the source, could you give me a pointer were it is?
On the road again.
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

tramp wrote:This is a example of Xputty:
Image
looks really nice!
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

tramp wrote:
skei wrote:be warned, it is "in progress" :-)
:) development is progress, isn't it?
hehe, yeah..
tramp wrote:I can't find your X event loop in the source, could you give me a pointer were it is?
there's actually two..

the eventLoop() method, for standalone executables (a 'regular' event loop)
https://github.com/skei/kode9/blob/mast ... dow.h#L848

and an event thread for use in plugins, etc..
https://github.com/skei/kode9/blob/mast ... ow.h#L1291

they both call the eventhandler whenever there's an event available:
https://github.com/skei/kode9/blob/mast ... dow.h#L911

- tor-helge
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

tramp wrote:Most likely is that the host didn't shot down the interface, but only hide it. Then, on the next run, your UI started with undefined behave because events get lost in the mean time.
i just tried to print out the void* parent argument to on_openEditor (the xid for the parent window you should reparent your editor to)..
in reaper, i get quite wildly different numbers: 0x68002cd, 0x6800476, 0x680068c, 0x6800755, ..
in bitwig, i always get a sequence like this: 0x7600000, 0x7600001, 0x7600002, 0x7600003, ..

the fact that they differ each time i close, and then reopen the editor, indicates that the host is not just hiding it, but actually destroying it, and recreating it again.. isn't it? i shut down everything when i close the window, including the display connection..

- tor-helge
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: simplistic linux/vst3 plugin example/framework

Post by tramp »

skei wrote:the fact that they differ each time i close, and then reopen the editor, indicates that the host is not just hiding it, but actually destroying it, and recreating it again.. isn't it?
Yes, so it must be something different then that.

Unfortunately I'll be offline for a week now, because of my work. :(
On the road again.
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

just uploaded a "major redo".. better (and cleaner) separation between the various parts, especially xcb and cairo.. and found (and fixed) a few bugs in the process.. also, i added back some initial code for ladspa, dssi and lv2.. now i need to finalize the changes, and make things work properly again..
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

another update in case anybody is interested..
i got the cairo stuff working now.. i think..
found some mailing list posts about this, which suggested adding these lines before shutting down the editor

Code: Select all

cairo_device_t* device = cairo_device_reference(cairo_surface_get_device(MCairoSurface));
cairo_device_finish(device);
cairo_device_destroy(device);
and that seemed to fix my problems!! hooray!
now i can open and close the editor as much as i want :-)
time to do a bunch of testing to be sure, and then clean up the code..

btw, the 'simplistic' part of the thread title isn't really correct anymore, and 'vst3' can be replaced with 'ladspa, dssi, lv2, vst2, vst3, and standalone executable' ..

source code: https://github.com/skei/kode9

- tor-helge
User avatar
SpotlightKid
Established Member
Posts: 250
Joined: Sun Jul 02, 2017 1:24 pm
Has thanked: 48 times
Been thanked: 54 times

Re: simplistic linux/vst3 plugin example/framework

Post by SpotlightKid »

Would it be possible to include one or two example plugins in your repository?
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

SpotlightKid wrote:Would it be possible to include one or two example plugins in your repository?
yes, that's the plan..
but i'd like make the framework itself, or at least the 'lower level' parts, as stable as i can first..
and then reintroduce the example plugins from previous version of the framework, one by one..
soon.. soon..

but in the meanwhile, you can have a peak at one of the tests i use while developing.. :-)
https://github.com/skei/kode9/blob/mast ... /plugin1.h
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: simplistic linux/vst3 plugin example/framework

Post by tramp »

skei wrote:another update in case anybody is interested..
i got the cairo stuff working now.. i think..
found some mailing list posts about this, which suggested adding these lines before shutting down the editor

Code: Select all

cairo_device_t* device = cairo_device_reference(cairo_surface_get_device(MCairoSurface));
cairo_device_finish(device);
cairo_device_destroy(device);
and that seemed to fix my problems!! hooray!
now i can open and close the editor as much as i want :-)
time to do a bunch of testing to be sure, and then clean up the code..

btw, the 'simplistic' part of the thread title isn't really correct anymore, and 'vst3' can be replaced with 'ladspa, dssi, lv2, vst2, vst3, and standalone executable' ..

source code: https://github.com/skei/kode9

- tor-helge
Ah, okay, that is indeed not necessary when you use the plain xlib back-end.
On the road again.
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

tramp wrote:Ah, okay, that is indeed not necessary when you use the plain xlib back-end.
yeah, i was surprised myself.. in older versions of the gui stuff, i never needed to do anything similar to this.. but i tried things almost in "desperation".. and then, bam, it worked! :-D

the gui stuff was the last thing that needed major changes, and the framework is now almost up to the standard it was before "the great rewrite".. i just pasted back a bunch of old code (example plugins, audio stuff, widgets, etc), and is now in the middle of tweaking and reshaping all that to fit the newer version of the framework.. will take a little bit of time, but i'm almost at the point where i can focus on actually making plugins, instead of the underlying framework..
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: simplistic linux/vst3 plugin example/framework

Post by skei »

things have progressed a LOT, so the thread title is not correct anymore.. the code examples have expanded and grown, and is now more or less on the same level as my previous plugin framework, plus the new stuff.. it's almost ready to be announced as "usable", but there's a few small things i want to finish properly before i do..

but..

i'm having some major surgery in a few days (removing internal organs, etc), and i expect to be away from the computer for a month or two, while i'm healing.. so i will probably not be able to continue working on the framework until the start of next year or something.. but we'll see.. until then, you can have a look at the current state of the framework here:

https://github.com/skei/kode9

and, here's a screenshot of a plugin i'm working on:

Image

i'll make a new post/thread as soon as i'm back again, and have something new to tell you :-)

- tor-helge
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: simplistic linux/vst3 plugin example/framework

Post by tramp »

skei wrote:i'm having some major surgery in a few days (removing internal organs, etc), and i expect to be away from the computer for a month or two, while i'm healing.. so i will probably not be able to continue working on the framework until the start of next year or something.. but we'll see..
All the best. Hope things went out nicely for you.

BTW. Your Slicer looks nice.
On the road again.
Post Reply