What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

SDL for VST Instrument Plugin GUI

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

Vstplay
KVRer
 
4 posts since 11 Jun, 2014

Postby Vstplay; Wed Jun 11, 2014 6:57 pm SDL for VST Instrument Plugin GUI

I am a newbie planning on writing a VST Instrument in C++. Have good ground in C++ and was wondering if SDL is ok for making the nice looking GUI from scratch.

Also I appreciate your suggestions on what image format (jpg, png etc) do I choose to use in the plugin be it the control knobs sliders etc?

Suggestions please
helium
KVRist
 
323 posts since 13 Nov, 2002, from Germany, Darmstadt

Postby helium; Wed Jun 11, 2014 11:22 pm Re: SDL for VST Instrument Plugin GUI

Why would you ask that in the Instruments forum instead of in the DSP and Plug-in Development forum?
Last edited by helium on Thu Jun 12, 2014 12:50 am, edited 1 time in total.
Why is 6 afraid of 7

Because 7 8 9.
Lotuzia
KVRAF
 
7295 posts since 19 Feb, 2004, from Paris

Postby Lotuzia; Wed Jun 11, 2014 11:25 pm Re: SDL for VST Instrument Plugin GUI

helium wrote:Why would you ask that in the Instruments forum instead of in the DSP and Plug-in Development forum?

This
http://www.lelotusbleu.fr Soundbanks for Vsti

77 Exclusive Soundbanks for 23 synths, 8 Sound Designers, Hours of audio Demos. The Sound you miss might be there [Xils-Lab Team]
bob bobwood
KVRian
 
1404 posts since 24 Apr, 2010, from Nottingham

Postby bob bobwood; Wed Jun 11, 2014 11:58 pm Re: SDL for VST Instrument Plugin GUI

Welcome Vstplay to KVR, I hope you have a great time here.
Posting in the wrong place is an easy mistake to make when you're new to a site but you aren't that far wide of the mark, so you'll probably get some useful replies here anyway [EDIT; it was in instruments].

What the previous posters are saying is you may get a faster, more informed answer in the more relevant forum here; [EDIT; link removed as you have been repositioned here already]
A-Z of Plugins, etc updated September 7th 2014
mystran
KVRAF
 
4129 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Thu Jun 12, 2014 3:05 am Re: SDL for VST Instrument Plugin GUI

Vstplay wrote:I am a newbie planning on writing a VST Instrument in C++. Have good ground in C++ and was wondering if SDL is ok for making the nice looking GUI from scratch.


Trying to use SDL is probably going to create a lot more problems that it actually solves. You can't really have a custom message loop in any plugin and SDL in general isn't exactly geared towards GUI applications anyway as it's focus is on games, where you typically do things a bit differently. If you're going to be doing everything yourself, it's probably better idea to just wrap around the system directly.. or alternative you might want to consider one of the toolkits specifically designed for plugin purposes (wdl-ol, juce, etc).

Also I appreciate your suggestions on what image format (jpg, png etc) do I choose to use in the plugin be it the control knobs sliders etc?


PNG work well. Jpeg uses lossy compression that is mostly tuned to photographs (where the compression tends to be a bit less visible than with computer rendered graphics) and doesn't support alpha channels (which you might want).
Image <- plugins | forum
wrl
KVRer
 
9 posts since 12 Aug, 2011

Postby wrl; Thu Jun 12, 2014 4:21 am Re: SDL for VST Instrument Plugin GUI

I investigated SDL for use as an openGL platform layer for a plugin UI. The two main issues i found with it were use of global state (so you'd have to compile that statically, and even then I'm not 100% sure you wouldn't run into issues loading multiple instance of the plugin) and lack of support for opening parented windows. I ended up writing all my own platform code.

Still not sure about the first issue, but you could probably hack around the second with a combination of SDL_GetWindowWMInfo() and various OS primitives for re-parenting windows (SetParent() on win32, some mess on OSX I'm sure).

From a cursory glance at the event handling primitives, I don't think you'll run into a ton of trouble there. You'll likely just want to set up an OS level timer (SetTimer() on win32, NSTimer stuff on OSX) to whatever framerate you want, then call SDL_PollEvents() and your draw function whenever the timer fires.

So, I think you could make it work, but it'll take a little manual labor to get things hooked up and playing nice with the VST SDK. If you have some success, report back, I'm curious.
JCJR
KVRian
 
912 posts since 17 Apr, 2005

Postby JCJR; Thu Jun 12, 2014 8:48 am Re: SDL for VST Instrument Plugin GUI

As mystran mentioned, png offers advantages with the alpha channel, for variable transparency overlay of gui elements.

For instance if you wish to make a pretty gui made up of lots of images tiled and stacked, it can be difficult to make a real smooth looking gui without transparency. It can look pretty good with simple masking and overlap, but the borders between image elements can appear pixellated and jaggy, unless you photoshop fine tune all the source images, to precisely fit together. Taking care that each element will not look jaggy when overlayed atop background elements. This can be a challenge if the overlayed images can move in response to user clicks or window resize. Requiring that the foreground elements need to "look like they match up" at many locations, not just a set location hand polished in photoshop.

That can invite extra work, if you decide to change one element, then if the element doesn't sit well with its neighbors, perhaps you end up having to edit the neighboring images as well.

Simple example, a slider control with a background track and a foreground slider thumb. Slider track is drawn atop background picture of the control panel, and slider thumb is drawn over both.

If the track image and slider image are given alpha channel drop shadows or "halos" around the opaque core of each image-- A pixel or three of partial transparency surrounding the control, which fades to full transparency. Full transparency surrounding the outside of each foreground or mid-ground image.

When these elements are drawn over background images, the transparent fades around each core image will smooth the transition between edges and help prevent edges of moving control elements from appearing pixellated and jaggy atop the background.

This can make a foreground control look "good" over a wider variety of backgrounds. So if you decide to move all the controls around or edit the background images, then maybe you will get lucky and not have to edit all the foreground images to fit the new background, or vice versa. :)
Vstplay
KVRer
 
4 posts since 11 Jun, 2014

Postby Vstplay; Thu Jun 12, 2014 5:21 pm Re: SDL for VST Instrument Plugin GUI

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.

Awesome guys, such a wonderful discussion.

I actually just caught up into coding SDL, plugins that AGML makes where strings vibration effects are included and lot of dynamic image loading. They are really sexy, what platform do I choose to begin with ?

I do like to make the elements in my instrument move. I actually hit upon the first google link to VST and SDL and working through that
https://learnvst.wordpress.com/tag/sdl/ (https://learnvst.wordpress.com/tag/sdl/)

I have enough coding experience to get started, I am absolutely fine hard coding every single piece of GUI myself, but the question of what do I even begin with?

GLUT ruled out - not much development
SDL - looks promising
OpenGL - a bit of a pain for the low levelness.

It's all about loading images and making the GUI elements load dynamically.

I will repost this in the DSP and Plugin development forum.... See you there :)
Vstplay
KVRer
 
4 posts since 11 Jun, 2014

Postby Vstplay; Thu Jun 12, 2014 5:30 pm Re: SDL for VST Instrument Plugin GUI

Here's the forked thread of this discussion
viewtopic.php?f=33&t=413665

Moderator: Moderators (Main)

Return to DSP and Plug-in Development