Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 02-23-2017, 12:56 PM   #1
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default JUCE VST plugin example that uses the Reaper API

edit 7th August 2018 : Use new facility in JUCE that finally allows getting access to the VST2 host callback from the plugin. The modified JUCE source files are no longer needed and were removed from the example plugin repo. Unfortunately equivalent facility was not yet added for VST3, so VST3 support has been removed for now.

edit 30th June 2018 : Updated for JUCE 5.3.2 (develop branch as always), taking into account the rather extensive changes Roli had to make to accommodate Steinberg preparing to drop VST2 completely. Note that now the VST2 and VST3 SDKs included within the JUCE repo itself must likely be used for the project to build successfully. The latest JUCE/Projucer should automatically take that change into account, but if they don't, you can try changing the global path for the VST3 SDK manually in the Projucer.

edit 10th April 2018 : Updated for JUCE 5.3.1
edit 18th December 2017 : Updated for VST SDK 3.6.8/latest JUCE changes.
edit 29th October 2017 : Updated for JUCE 5.2
edit 5th July 2017 : VST3 stuff added

Git repository at :

https://bitbucket.org/xenakios/reape...st_example/src

The plugin doesn't actually do anything that interesting but shows how to :

1) Use the Reaper API functions
2) Get access to the Reaper track or take on which the effect has been loaded. The plugin implements the following features :

-Changing volume of the track from the slider in the plugin
-Changing the name of the track or the take from the text field in the plugin
-Visualizes the media item positions on the track with a simple timeline graphic

You will likely need the latest Juce (from the Juce Github develop branch), Projucer built from the source and Visual Studio/XCode to get the plugin built. There are probably bugs, so you will likely want to watch for changes in the git repo.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 08-07-2018 at 05:48 AM.
Xenakios is offline   Reply With Quote
Old 02-23-2017, 02:42 PM   #2
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

This is very nice from you, Xenakios. I'm moving my projects to Reaper and using JUCE for some stuff right now, so this is insanely helpful. I'm diving into it next days.

Thanks so much!
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 02-24-2017, 11:15 AM   #3
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Thanks a lot for your work.

As a really functional example an open source workalike to MidiToReaControlPath would be fantastic. (But don't bother on my behalf, I suppose it will be a rather long time until I get to get started with such things).

Thanks again,
-Michael

Last edited by mschnell; 02-24-2017 at 01:26 PM.
mschnell is online now   Reply With Quote
Old 02-25-2017, 12:50 PM   #4
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 417
Default

This could be very cool, does it allow access to the C++ API, the ReaScript API or both?

...oh by the way, don't know if you read my reply here http://forum.cockos.com/showpost.php...94&postcount=9
If you still have that script I'd like to check it out.

Thanks!
NextLevel is offline   Reply With Quote
Old 02-25-2017, 01:02 PM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by NextLevel View Post
This could be very cool, does it allow access to the C++ API, the ReaScript API or both?

...oh by the way, don't know if you read my reply here http://forum.cockos.com/showpost.php...94&postcount=9
If you still have that script I'd like to check it out.

Thanks!
The C(++) API has almost everything the ReaScript API has. You might note in the ReaScript html documentation it lists C versions of the API functions too. The notable thing missing is support for the gfx window stuff.

Here's the parameter changing Lua script, as I found it from my hard drive now. I didn't test it or anything :

http://pastebin.com/nAqVaa5t
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-25-2017, 01:59 PM   #6
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 417
Default

Hey thank you for posting that script.
NextLevel is offline   Reply With Quote
Old 03-22-2017, 09:45 PM   #7
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

Hi, Xenakios. Tried to build the project today and got this error:

Error C2061 syntax error: identifier 'VSTCallbackHandler' reaper_api_vst c:\juce\modules\juce_audio_plugin_client\VST\juce_ VST_Wrapper.cpp 1882

with JUCE 4.3.1
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 03-22-2017, 10:15 PM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by ceanganb View Post
Hi, Xenakios. Tried to build the project today and got this error:

Error C2061 syntax error: identifier 'VSTCallbackHandler' reaper_api_vst c:\juce\modules\juce_audio_plugin_client\VST\juce_ VST_Wrapper.cpp 1882

with JUCE 4.3.1
Yeah, I dunno...I can't build the plugin anymore on OS-X either, must be some change in JUCE somewhere that is conflicting with the plugin modified JUCE code. (I am not getting the same issue as you though.)

I need to take a look at this later. Issues like this were the reason why I wasn't so eager to release this in the first place. (It's messy to keep the official and modified JUCE code versions working together properly.)

edit : After cleaning up the mess I had done on the OS-X machine, I can get the plugin built. Maybe some issue has creeped in for the Windows side then...

edit2 : You are using JUCE from the "develop" branch from JUCE's git repo, right? The "master" branch most likely would not work.

edit3: I tried building on Windows now and not getting any problems. The problem for you likely is that you are not using JUCE from the "develop" branch.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 03-23-2017 at 06:22 AM.
Xenakios is offline   Reply With Quote
Old 03-23-2017, 09:59 AM   #9
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

Sorry, I really missed the part of

"You will likely need the latest Juce (from the Juce Github develop branch)"

I was really on master branch. Thanks.
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 04-30-2017, 01:30 AM   #10
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

Hi, Xenakios. Have you changed anything on your JUCE modded files for JUCE 5?

Thanks.
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 04-30-2017, 05:03 AM   #11
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by ceanganb View Post
Hi, Xenakios. Have you changed anything on your JUCE modded files for JUCE 5?

Thanks.
I just updated the Git repo a bit, no drastic changes due to Juce 5. (It may be the code is now incompatible with Juce 4, but if that is a problem, in that case can go back in the Git history...)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 04-30-2017 at 05:12 AM.
Xenakios is offline   Reply With Quote
Old 04-30-2017, 05:16 AM   #12
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

By the way, now that Juce 5 has the option for a free of charge license for closed source products(*), I will have to come up with some suitable license for the example code that allows both GPL and proprietary use, I don't wish to prevent either. I wonder if just making it public domain would work...?

(*) If you are going to use that licensing option, be careful to understand how it works. Your product will have to show the Juce splash logo at start up and allow sending data to Google Analytics. If you can't allow those things, you have to use either the GPL license and open source your code as GPL too or buy into a commercial Juce license.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-30-2017, 01:56 PM   #13
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by Xenakios View Post
By license for the example code that allows both GPL and proprietary use, I don't wish to prevent either.
LGPL ?

-Michael
mschnell is online now   Reply With Quote
Old 04-30-2017, 02:25 PM   #14
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mschnell View Post
LGPL ?

-Michael
That would be quite unsuitable in this case. It would essentially require closed source developers to use the code from a separate DLL which is a notoriously messy thing to do from a VST or similar plugin. (This is why people often frown on using libsndfile for audio file IO in plugins.)

For now, I just added a "license" into the source file that gives permission to use the code and reminds JUCE and the Reaper SDK have their own licenses.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-30-2017, 11:12 PM   #15
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

I understand that the header files for the Linux Kernel and library API are released with LGPL and can freely be used in closed source projects to manage their access to the GPLed infrastructure software. Otherwise there could not be any non-GPLed Linux executables.

SO AFAIK, LGPL is done exactly for that purpose.

-Michael
mschnell is online now   Reply With Quote
Old 05-01-2017, 04:38 AM   #16
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mschnell View Post
I understand that the header files
The code in the plugin example isn't just header files though.

In any case, I would expect people to just look at my code for inspiration and do their own code more or less from scratch. The plugin doesn't even do anything interesting or useful.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 05-01-2017, 09:40 AM   #17
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by Xenakios View Post
The code in the plugin example isn't just header files though.
The header files were just an example of LGPLed code.
AFAIL, LGLP is not explicitly restricted to header (or any other type of) files.
Quote:
Originally Posted by Xenakios View Post
In any case, I would expect people to just look at my code for inspiration and do their own code more or less from scratch. The plugin doesn't even do anything interesting or useful.
Seems no problem to me...
-Michael
mschnell is online now   Reply With Quote
Old 06-25-2017, 09:49 AM   #18
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

thank you! i tried this today just to see how it goes.
deeb is offline   Reply With Quote
Old 07-04-2017, 03:14 PM   #19
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Updated the included modified Juce files and did some initial work to support VST3.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 07-04-2017 at 03:25 PM.
Xenakios is offline   Reply With Quote
Old 07-04-2017, 10:02 PM   #20
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Great ! Thanks !
I'm sure that I will be happy to use this some day soon ...
-Michael
mschnell is online now   Reply With Quote
Old 07-06-2017, 08:50 AM   #21
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 117
Default

Great! Thank you for sharing!
__________________
web | kawaScripts | donate | twitter |
kawa_ is offline   Reply With Quote
Old 08-09-2017, 01:28 PM   #22
InLight-Tone
Human being with feelings
 
InLight-Tone's Avatar
 
Join Date: Jul 2017
Posts: 26
Default

Thanks for this! Am I right in assuming that we can build .dll plugins for Reaper with this complete with Juce GUI's? (Forgive my present & future newb questions...)
InLight-Tone is offline   Reply With Quote
Old 08-09-2017, 01:32 PM   #23
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by InLight-Tone View Post
Thanks for this! Am I right in assuming that we can build .dll plugins for Reaper with this complete with Juce GUI's? (Forgive my present & future newb questions...)
This is for VST2 and VST3 plugins that need to use the Reaper API. Note that you don't need this thing at all if you don't need to use the Reaper API, the regular JUCE without modifications will work just fine to build VST plugins that run in Reaper.

If you want to do Reaper extension plugins (which are a different thing than VST plugins), you would be interested in looking at this :

https://forum.cockos.com/showthread.php?t=187677
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 09-24-2017, 01:24 AM   #24
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

awesome
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 10-29-2017, 02:40 AM   #25
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

is there a working binary of this somewhere? having a bit of trouble building it with the latest JUCE
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 10-29-2017, 04:09 AM   #26
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,183
Default

Quote:
Originally Posted by olilarkin View Post
is there a working binary of this somewhere? having a bit of trouble building it with the latest JUCE
Yeah, that's one of the things that keeps me from going to Juce, it seems to be a bit of a constantly moving target...
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
Geoff Waddington is offline   Reply With Quote
Old 10-29-2017, 04:22 AM   #27
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

never mind I managed to compile it
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 10-29-2017, 07:11 AM   #28
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Geoff Waddington View Post
Yeah, that's one of the things that keeps me from going to Juce, it seems to be a bit of a constantly moving target...
That's mostly a (minor) problem if you need to have a JUCE with some custom modifications included. Like what is happening with this Reaper extensions support thing...They rarely break sensible code that has been written against the original official repository.

I tried suggesting getting a way to use the VST2/3 host custom stuff with the official JUCE repo, but that unfortunately didn't get much interest at the JUCE forum. So I will just need to attempt to remember to keep my Reaper extensions examples up to date.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 10-29-2017 at 07:47 AM.
Xenakios is offline   Reply With Quote
Old 10-29-2017, 07:28 AM   #29
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Updated the modified Juce files and the Projucer project for Juce 5.2.0. (I tested building only with Visual Studio 2017 for now, I'll check with XCode 8.2 later today.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 10-29-2017, 10:11 AM   #30
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

you could copy the modules locally and commit them + your mods to your repo. although you would bloat your repo with the whole of juce :-(
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 10-29-2017, 10:29 AM   #31
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by olilarkin View Post
you could copy the modules locally and commit them + your mods to your repo. although you would bloat your repo with the whole of juce :-(
Yeah I've been considering just doing that. But then I'd need to keep those copies of JUCE updated on my local drives anyway. (Unless git has some neat way of linking repos or something...)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 10-29-2017, 10:31 AM   #32
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

i think including diff/.patch files for juce are better than including a whole .cpp/.h. then when roli modify code it's easy to see what it was you added
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 12-16-2017, 12:38 PM   #33
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

Hi, Xen. I'm getting this error while compiling in VS2017

1>PluginProcessor.cpp
1>PluginEditor.cpp
1>h:\0 - projects\xenakios-reaper_api_vst_example-3b4b11c12ade\source\PluginProcessor.h(11): fatal error C1083: Cannot open include file: 'pluginterfaces/base/funknown.h': No such file or directory (compiling source file ..\..\Source\PluginProcessor.cpp)
1>h:\0 - projects\xenakios-reaper_api_vst_example-3b4b11c12ade\source\PluginProcessor.h(11): fatal error C1083: Cannot open include file: 'pluginterfaces/base/funknown.h': No such file or directory (compiling source file ..\..\Source\PluginEditor.cpp)

Using JUCE 5.2 both master and develop, with VST SDK 3.6.8.
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 12-17-2017, 09:51 AM   #34
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

The project hasn't been tested/updated to work with the VST 3.6.8 SDK. I'll take a look at some point.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-18-2017, 11:03 AM   #35
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

It should be enough to open the Jucer file in Projucer, make the exporter point to the new VST3 SDK and re-export the project for Visual Studio.

edit : I updated the modified Juce files in the repo.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-19-2017, 03:19 PM   #36
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default

It's working with develop branch. Thanks.
__________________
Ceanganb
ceanganb is offline   Reply With Quote
Old 04-10-2018, 11:47 AM   #37
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Updated for JUCE 5.3.1.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-29-2018, 06:16 PM   #38
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by ToneCre8 View Post
When you do updates, are you doing them from the development branch
The develop branch of JUCE. I don't have particular problems using that...(They occasionally mess up some things but then one can just go back in the git repo or report the problem and it's likely going to be fixed in a few days.)

By the way, because of both Steinberg and ROLI changing things around, this project is probably out of date yet again even if trying to build against the develop branch of JUCE. I will try to see if some updates need to be done. But handling the stuff this way is getting quite tiresome, I may need to consider at some point just leaving the repo as it is without guarantees the project actually can be built. (In any case people should use the project only as inspiration for their own solution anyway. Ideally ROLI would add a way to use the Reaper extension API with the official JUCE version but I haven't been able to persuade them to do that.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-29-2018, 10:55 PM   #39
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Thanks a lot for keeping us informed on those issues !

But it seems once I (or whoever) might decide to start a project (e.g. doing a VST3 based JUCE enabled Reaper extension), they will need to ask for your help on then current questions.

-Michael
mschnell is online now   Reply With Quote
Old 06-30-2018, 01:45 AM   #40
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,183
Default

Quote:
Originally Posted by Xenakios View Post
By the way, because of both Steinberg and ROLI changing things around, this project is probably out of date yet again even if trying to build against the develop branch of JUCE. I will try to see if some updates need to be done. But handling the stuff this way is getting quite tiresome, I may need to consider at some point just leaving the repo as it is without guarantees the project actually can be built.
Yeah, that's why, in the end, decided against using JUCE on the CSI project, one too many moving targets
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
Geoff Waddington 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 02:48 AM.


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