COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Cockos and Friends Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 05-16-2007, 12:23 PM   #1
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default IPlug C++ code framework for VST and AU audio plugins and GUIs

Here is a code framework for developing audio plugins and GUIs, which includes:

- A platform independent IPlug class that handles all communication with the audio host.

- A platform independent IGraphics class that handles managing the controls on the GUI.

- A set of platform independent IControl classes that handle moving and rotating images, vector graphics, mouse input, etc. Classes like "static bitmap", "switch", "fader", "rotating knob", etc. These classes can be easily extended.

- Windows and OSX graphics implementation classes, which handle window management, and use LICE (Cockos graphics lib) to draw GUIs.

- VST and AU implementation classes, which handle communication between the audio host and the plugin.

The idea is that you can derive a new plugin class from IPlug, and with a small number of readable lines of code, you can assemble the plugin and GUI without caring what the OS, plugin format, or graphics implementation is.

The framework and the code for the sample plugin can be found in the latest WDL package. This code should compile into a Windows VST, an OSX Audio Unit, or an OSX VST with no changes.

Here is an example of the source code (from the package) for the constructor of the example plugin.

To compile VSTs, you will need the VST SDK from Steinberg. You only need two files out of the SDK: aeffect.h and aeffectx.h. To compile AUs, you will need the Core Audio SDK from Apple (this comes with XCode).

The IPlug example project in WDL links in the Cockos LICE graphics library statically, but if you are making one-off plugins you may find it easier to simply add the necessary LICE source files to your plugin project.


.


.

Caveats.
This is code I use, so it's designed for users who are comfortable using C++. It doesn't offer any sort of GUI assembling graphical interface, everything is done in the user's code. Although it supports all the plugin/GUI functionality I happen to use, it may not support the functionality you want, for example it doesn't support common Windows controls like dropdowns and checkboxes. However, it should be straightforward to extend the framework to add features.

Last edited by schwa; 11-02-2009 at 07:04 AM.
schwa is offline   Reply With Quote
Old 05-16-2007, 01:30 PM   #2
esorcc
Human being with feelings
 
Join Date: Feb 2007
Posts: 15
Default That's exactly what I've been waiting for

I've been wanting to dive in to writing VST's. I'd not seen much C++ development for VST's. Having a base class to inherit from will significantly cut my development time.

Is this base class efficient?
esorcc is offline   Reply With Quote
Old 05-16-2007, 01:37 PM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

It's efficient.
schwa is offline   Reply With Quote
Old 05-18-2007, 10:15 AM   #4
caleb
Human being with feelings
 
caleb's Avatar
 
Join Date: Feb 2007
Posts: 635
Default

Talk to me Schwa.

Is this the cross-platform VST/GUI development platform that we've been waiting for that doesn't have large license costs for commercial endeavors like Juce does?

For example - can we take this and develop Linux VST plug-ins?

I'm actually interested (finally) in developing an audio plug-in and know shit really - I promise that what I want to make is quite simple in comparison to what others do. It's a flexible tone generator more than anything else.

I would also be interested in developing midi plugins.

Please help me.

Regards
Caleb
__________________
Happiness is the hidden behind the obvious.
caleb is offline   Reply With Quote
Old 05-18-2007, 10:44 AM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Well, it's technically cross platform -- it's designed that way. But ATM it will only work on windows. There are 3 main pieces:

- Framework code -- talking to audio host, managing params and controls, and all the specific code you would write for a given plugin, that's all cross platform and should work more or less out of the box anywhere. But without a GUI.

- Opening and managing the GUI window. This is designed to be able to drop in managers for different platforms but ATM there's only a windows implementation there. The existing windows impl is bare bones simple, it just throws a window up and routes messages back to the framework code. Somebody could write a window manager class to talk to whatever linux window manager pretty easily.

- Drawing the graphics. The two implementation classes in there are gdi+ which is windows-only and cockos LICE which is windows-only for now but planned to be cross-platform.

So for now, just Windows, but the important part is you could write your plugin code and when there are other windows manager and graphics implementation classes, your code will not need to change.

The audio and midi processing end, and what and how communication happens with the audio host, is all straight VST, so whatever a VST can do, IPlug can do.
schwa is offline   Reply With Quote
Old 05-19-2007, 04:34 AM   #6
caleb
Human being with feelings
 
caleb's Avatar
 
Join Date: Feb 2007
Posts: 635
Default

If LICE is planning to be cross-platform, maybe that's a better choice for me at the moment.

I might struggle to start with this without pretty good examples and such. I've never even made a VST plug-in full stop.

Plus there's the small issue that I'm not really a C++ programmer.

Yeah - the obstacles just keep getting bigger.

Regards
Caleb
__________________
Happiness is the hidden behind the obvious.
caleb is offline   Reply With Quote
Old 06-07-2007, 06:17 AM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Updated with project files for VC++ 2005. I had to rebuild a PC anyway so I thought I'd try out the free VC++ 2005 Express, which works just fine, I recommend it for anyone who wants to do C++ work without the installing whole Visual Studio universe.

Earlier I said that the free VC++ didn't have a resource compiler, but that's wrong, all it's missing is a resource editor, which for this application you would never use anyway. You need to hand-write a resource.h and <projectname>.rc file, but it's very straightforward (faster than adding resources using the resource editor), and the compiler will embed the images properly for you (you can look at the example project to see how it's done).
schwa is offline   Reply With Quote
Old 06-07-2007, 07:41 AM   #8
Andrew Cockburn
Human being with feelings
 
Andrew Cockburn's Avatar
 
Join Date: Jun 2007
Location: CT, USA
Posts: 96
Default

Hey Schwa,

This looks cool - I tried VST programming a few months ago but gave up when I ran out of steam with all the boring GUI programing - I'll definately have a look at this and have a play - thanks!
Andrew Cockburn is offline   Reply With Quote
Old 06-28-2007, 10:20 PM   #9
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

I removed the gdi+ graphics implementation class from IPlug. Cockos' Lice graphic library now supports vector drawing (as well as lots of other cool stuff, check it out). So Lice can now do most of what gdi+ can do, but way faster.
schwa is offline   Reply With Quote
Old 06-29-2007, 01:26 PM   #10
aquila
Human being with feelings
 
Join Date: Jun 2007
Posts: 4
Default LICE_Line identifier not found

Hi,
I try to compile the Iplug with the latest version of WDL (2070627) and I have the following error : LICE_Line identifier not found.
I open the lice.h and there is :
/*
Stuff planned:


...
void LICE_Line(LICE_IBitmap *dest, float x1, float y1, float x2, float y2, LICE_pixel color, float alpha=1.0, bool aa=true);
void LICE_Rectangle(LICE_IBitmap *dest, float x1, float y1, float x2, float y2, LICE_pixel color, float alpha=1.0, bool aa=true);
....
*/
SO the method is not implemented in my version of WDL. When do plan to update the WDL to compile Iplug or do I have the right version ?

regards
Philippe
aquila is offline   Reply With Quote
Old 06-29-2007, 05:18 PM   #11
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Oops! That's coming to WDL soon I think. For the moment you can comment out the single call to LICE_Line at (or near) IGraphicsLice.cpp line 142 and everything else should work fine (except vector drawing, of course), until a new WDL comes out.
schwa is offline   Reply With Quote
Old 06-30-2007, 12:46 AM   #12
aquila
Human being with feelings
 
Join Date: Jun 2007
Posts: 4
Default Error 1 fatal error LNK1181: cannot open input file '.\Debug\IGraphicsGL.obj' IPlug

There is another problem. The file IGraphicsGL.cpp and .h is not present. But there is IGraphicsGdip.cpp and .h
Does the new files replace the old one.
If I try to replace, I have a lot of error in like IGraphicsGdip.h:
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\nomad\dev\juce\wdl\iplug\igraphicsgl.h 27
or
Error 2 error C2143: syntax error : missing ',' before '&' c:\nomad\dev\juce\wdl\iplug\igraphicsgl.h 27

Have you an idea ?

regards
Philippe
aquila is offline   Reply With Quote
Old 06-30-2007, 05:24 AM   #13
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Sorry about that, I left the old vcproj file in the zip after I removed the stale files, so it's looking for stuff it can't find. I updated the zips, it should work without complaining now.
schwa is offline   Reply With Quote
Old 07-01-2007, 02:08 AM   #14
aquila
Human being with feelings
 
Join Date: Jun 2007
Posts: 4
Default main.ico missing in test lice folder

Hi,
I test. Iplug compile now. But for the IplugExample the project need lice.lib and the lice project doesn't compile because the main.ico is missing in the test folder. I add a dummy icone and everything is ok.

regards
Philippe
aquila is offline   Reply With Quote
Old 07-04-2007, 05:34 AM   #15
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Justin dropped by in the dark of night to fix a windows-level problem that occurred when multiple instances of the same plugin were loaded and unloaded. Thanks Justin.

... also there were a couple of changes in this update that will require tweaking existing projects: OnParamChange now supplies the index of the param that changed, the vector drawing controls now take a channel blending object, the relative library paths got flatted by one level, and possibly other minor things I can't recall at the moment.

Last edited by schwa; 07-04-2007 at 05:38 AM.
schwa is offline   Reply With Quote
Old 08-30-2007, 07:49 AM   #16
spaz
Human being with feelings
 
Join Date: Aug 2007
Location: Not too far from SeaTac Airport
Posts: 29
Default

Should work on:

1. OSX?
2. Any VST Host?

Last edited by spaz; 08-30-2007 at 07:51 AM. Reason: i hit enter or something!!
spaz is offline   Reply With Quote
Old 05-06-2008, 11:44 AM   #17
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Updated the source code (link in first post). VST and now AU support have been battle-tested in many hosts. Added OSX VST support.
schwa is offline   Reply With Quote
Old 05-13-2008, 12:01 PM   #18
TheAudiophileDutchman
Human being with feelings
 
TheAudiophileDutchman's Avatar
 
Join Date: May 2008
Location: Made in Holland
Posts: 7
Default How to compile lice.lib with VC++ 2008 Express

Great stuff!!

Would like to testdrive with VC++ 2008 Express, by using:

Quote:
Originally Posted by schwa View Post
Here's a VC++ 2008 project file for the example project. If you post yours I can take a look at it, too.
https://stash.reaper.fm/oldsb/18548/IPlugExample.vcproj

The TRACER_BUILD needs both the lib and the dll compiled with it on (I use a separate build config for this). But it's clear this won't help you, because you need to get the one PC to read the dll at all.
but the linker yields an error because it cannot open "lice.lib". See also:
http://www.cockos.com/forum/showthre...520#post184520

Any suggestions?
TheAudiophileDutchman is offline   Reply With Quote
Old 10-09-2007, 01:04 PM   #19
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default IPlug 2.0

A major update (in the first post) that includes tons of updates including vastly more efficient drawing logic, presets, battle tested host compatibility, and a million other things. Also I replaced STL with Cockos WDL, which makes for much smaller and somewhat faster code.

Removing STL caused a lot of interface changes, so this update is NOT compatible with previous IPlugs. And what's more, I'll be away for a few days and unable to respond to any problems! So if you are an actual current IPlug user, please copy your current build to a safe place instead of just clobbering it with this one.

Also, I'm using VC++ 9 Express which is newish, so I didn't bother posting project files because I know they are not backwards compatible.

Also if you are an actual current IPlug user, please say hello to the unicorns and leprechauns and other mythical creatures you must live among...
schwa is offline   Reply With Quote
Old 10-19-2007, 07:00 AM   #20
wct
Human being with feelings
 
Join Date: Sep 2007
Posts: 3
Default

Hi there! I checked out the last release of IPlug and was impressed with what I saw, but haven't had time to do much with it recently. For what it's worth I was able to build the last release on Visual Studio 2005 by editing the project file and changing the version "9.00" to "8.00". But I'm on a new computer now and just installed Visual Studio Express 2008, so time to give it another whirl.

The main issue I had last time was that I had to guess the include and library paths for VST and LICE. Has this been standardised somehow (maybe an env variable?)

I also tweaked the iplug creation to allow use as a generator module. I'd be happy to contribute back code but I need to get up to speed with this release first.

Thanks for your great work!
wct is offline   Reply With Quote
Old 11-08-2007, 08:46 AM   #21
wct
Human being with feelings
 
Join Date: Sep 2007
Posts: 3
Default Multi-param controls?

I want to add a control that maps to two parameters (in this case an X/Y pad control). When I looked controls appeared to be limited to 1 param. If I change this would I be better off subclassing in my own library, or modifying IPlug and submitting the changes back?
wct is offline   Reply With Quote
Old 11-08-2007, 09:48 AM   #22
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Quote:
Originally Posted by wct View Post
I want to add a control that maps to two parameters (in this case an X/Y pad control). When I looked controls appeared to be limited to 1 param. If I change this would I be better off subclassing in my own library, or modifying IPlug and submitting the changes back?
When I've done this, I've subclassed IControl and overridden SetDirty to send both parameters back to the host, which is a painless way to do something like an X/Y pad.

Often though if you have a complex control, some parameters may be constrained by others, for example if you have controls to move 2 points along a line but the points may not pass one another. In this case it's not really safe to allow the control values to be VST parameters at all, because with the GUI closed (or using automation) the user could set the parameters to illegal combinations. In cases like this, I've subclassed IControl and had the new control hold a pointer to the plugin instance class. That way, the graphics handler still knows how to pass mouse actions to the control, but the control and the plugin can communicate directly without having to go back through the parameter handling code.

(BTW I just updated the IPlug src in the first post.)
schwa is offline   Reply With Quote
Old 11-09-2007, 04:39 AM   #23
wct
Human being with feelings
 
Join Date: Sep 2007
Posts: 3
Default

Cool, I'll try that and see how I go.
wct is offline   Reply With Quote
Old 01-15-2008, 08:17 PM   #24
COCPORN
Human being with feelings
 
Join Date: Jan 2008
Location: Oslo
Posts: 101
Default Quick question

Thanks for this library! It was simple to get working, and I'm working on a VST plugin (receiving and processing both MIDI and audio) as we speak, complete with GUI and all. I'm very happy having gotten this far working less than 24h.

A quick question: I'm using the IKnobMultiControl to display a nice little knob I made with KnobMan, and it works very well. But for simple 2 bitmap thingies like a "MIDI activity"-indicator not connected to a parameter, what would you use?

Thanks again!
COCPORN is offline   Reply With Quote
Old 01-15-2008, 08:23 PM   #25
COCPORN
Human being with feelings
 
Join Date: Jan 2008
Location: Oslo
Posts: 101
Default

Quote:
Originally Posted by COCPORN View Post
...snip question which has the answer in the example code...
*blush*

Sorry about that, I see you're using the IBitmapControl in the example. Thanks again.
COCPORN is offline   Reply With Quote
Old 01-15-2008, 08:36 PM   #26
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

I'm glad somebody's getting use out of this.

BTW, there's a major iplug update coming with OSX and AU support. I'd guess a couple of weeks away, after I clear some other work out.
schwa is offline   Reply With Quote
Old 01-15-2008, 08:59 PM   #27
COCPORN
Human being with feelings
 
Join Date: Jan 2008
Location: Oslo
Posts: 101
Default

Quote:
Originally Posted by schwa View Post
I'm glad somebody's getting use out of this.

BTW, there's a major iplug update coming with OSX and AU support. I'd guess a couple of weeks away, after I clear some other work out.
Excellent. I've already managed to add the MIDI-activity button since my last post. This is a very nice library indeed. Looking forward to OSX support too! That'll be great.
COCPORN is offline   Reply With Quote
Old 01-16-2008, 11:41 AM   #28
COCPORN
Human being with feelings
 
Join Date: Jan 2008
Location: Oslo
Posts: 101
Default Another small(?) problem

I tried moving my plugin to my computer designated for audio work, but Live 7 doesn't even find the plugin on a rescan. That is, I'm sure it rescans the directory, but for some reason it doesn't list my baby.

Anyone familiar with troubleshooting this kind of situation? Are there any specialized hosts suitable for debugging this (and other) kinds of problems?

(I've MD5 checked files on both computers, it works perfectly on my development machine. I've also installed the vcredist 2008 on the second computer, as I'm using Visual Studio 2008 for development. I've also tried making an installation project to detect dependencies, but this doesn't seem to do any good either; it just adds comdlg32.dll to the install directory.)

Any help greatly appreciated.
COCPORN is offline   Reply With Quote
Old 03-27-2008, 11:35 AM   #29
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

Updated ... now you can compile the same code into a Windows VST and an OSX Audio Unit.
schwa is offline   Reply With Quote
Old 03-29-2008, 08:43 PM   #30
NAS
Human being with feelings
 
NAS's Avatar
 
Join Date: Dec 2007
Location: In church, burning it down
Posts: 1,345
Default

Hohohohohoho very cool update

NAS
__________________
Not Gods or Saints but HUMAN be
NAS is offline   Reply With Quote
Old 10-15-2008, 01:52 AM   #31
snebenan
Human being with feelings
 
Join Date: Jan 2008
Location: Sweden
Posts: 97
Default

Hi,
Since I ran into the limitation of max 16 sliders in JS I'm looking towards other solutions for creating a good vst controller for my evolver and blofeld.

wdl looks like it could solve my graphics needs but I could not find anything about midi. am I just blind or is it solved in some other way?

//Peter
snebenan is offline   Reply With Quote
Old 11-17-2008, 08:31 PM   #32
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 6,523
Default

Quote:
Originally Posted by snebenan View Post
Hi,
Since I ran into the limitation of max 16 sliders in JS I'm looking towards other solutions for creating a good vst controller for my evolver and blofeld.

wdl looks like it could solve my graphics needs but I could not find anything about midi. am I just blind or is it solved in some other way?

//Peter
Since you mention JS, I am assuming you want to make something that works integrated inside Reaper? Then the Reaper Extension plugins are probably what you want to look into...From them you can have access to the MIDI ports as well as the plugins loaded on Reaper's tracks.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 12-29-2008, 06:15 AM   #33
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,156
Default

I just put the image folder for the iplug example in the WDL dist, thanks for letting us know it was left out. It's in the build that's linked in the first post of this thread.

Regarding the manual editing of controls -- the control does need a redraw call, but this should be handled already in IControl::SetValueFromUserInput. It does seem to wok properly here, are you on Win or OSX?
schwa is offline   Reply With Quote
Old 12-29-2008, 09:22 AM   #34
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 664
Default

Quote:
Originally Posted by schwa View Post
I just put the image folder for the iplug example in the WDL dist, thanks for letting us know it was left out. It's in the build that's linked in the first post of this thread.
Yeah, I found those as well.

Quote:
Regarding the manual editing of controls -- the control does need a redraw call, but this should be handled already in IControl::SetValueFromUserInput. It does seem to wok properly here, are you on Win or OSX?
Windows, but are we talking about the same thing? I don't mean the right-click edit field but having a normal control and a caption field associated to the same parameter, when one changes one via right-click the other isn't redrawn/updated.
l0calh05t is offline   Reply With Quote
Old 09-07-2011, 10:27 AM   #35
izmirlig
Human being with feelings
 
Join Date: Sep 2011
Posts: 1
Default Interested as well

@schwa
with regards to IPLUG-- I am a statistician who does music as a very very serious hobby. When I got my fireware audio interface several years ago I decided to play around and learn the RIFF/WAV format. I wrote a small program to read and copy the format block to a second file and then 'speed up' the file by an integer factor, F, supplied by the user (2, 4, etc). Inside the program, the WAV file format block was analyzed for sample rate, bytes per sample etc. The final data block split the bytes per sample into F pieces and averaged them. It works! I am aware that there are plenty of simple ways to do this but it amused me to no end doing it myself in C.

Several years later, I dusted off this old program and decided to play around some more--maybe try filtering using Fourier transform--once again--nothing new or earth shattering here--I have plenty of plugins that probably can do that in my Cubase LE Elements 6. I'm just in it for fun.

What I was wondering is maybe I could use your IPLUG to turn my experiments in to VST plugins. I am not facile with object oriented programming in C++ but I have had experience with classes in Java and in R. So would the learning curve be too steep? In any case, I'll download IPLUG and take a look at the samples. I was interested in starting a dialogue with you. If this gets anywhere--I'll write back with a [shorter] update on my progress.
izmirlig is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.