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

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 ModifiedJuce folder has the Juce source code files that need to be replaced in your Juce source tree in order for the Reaper API to work.

edit : The locations of the files to be replaced within the Juce source tree :

JUCE/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
JUCE/modules/juce_audio_processors/processors/juce_AudioProcessor.h


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.
__________________
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/

Last edited by Xenakios; 10-29-2017 at 08:33 AM.
Xenakios is online now   Reply With Quote
Old 02-23-2017, 02:42 PM   #2
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 271
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: Germany
Posts: 3,474
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
__________________
www.boa-sorte.de

Last edited by mschnell; 02-24-2017 at 01:26 PM.
mschnell is offline   Reply With Quote
Old 02-25-2017, 12:50 PM   #4
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 362
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: 6,742
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
__________________
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 02-25-2017, 01:59 PM   #6
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 362
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: 271
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: 6,742
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.
__________________
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/

Last edited by Xenakios; 03-23-2017 at 06:22 AM.
Xenakios is online now   Reply With Quote
Old 03-23-2017, 09:59 AM   #9
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 271
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: 271
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: 6,742
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...)
__________________
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/

Last edited by Xenakios; 04-30-2017 at 05:12 AM.
Xenakios is online now   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: 6,742
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.
__________________
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 04-30-2017, 01:56 PM   #13
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 3,474
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
__________________
www.boa-sorte.de
mschnell is offline   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: 6,742
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.
__________________
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 04-30-2017, 11:12 PM   #15
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 3,474
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
__________________
www.boa-sorte.de
mschnell is offline   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: 6,742
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.
__________________
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 05-01-2017, 09:40 AM   #17
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 3,474
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
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 06-25-2017, 09:49 AM   #18
deeb
Human being with feelings
 
Join Date: Feb 2017
Posts: 611
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: 6,742
Default

Updated the included modified Juce files and did some initial work to support VST3.
__________________
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/

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

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

Great! Thank you for sharing!
__________________
Web : http://kawa.works
ReaScripts : MIDI-Section || MIDI-CC-Section
Reapack Repository : Reapack Repository
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: 7
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: 6,742
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
__________________
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 09-24-2017, 01:24 AM   #24
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
Default

awesome
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is online now   Reply With Quote
Old 10-29-2017, 02:40 AM   #25
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
Default

is there a working binary of this somewhere? having a bit of trouble building it with the latest JUCE
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is online now   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: 1,646
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...
__________________
Groove is the subtle control of chaos -- feel free to donate to the open source control surface integration project -- geoffwaddington.ca
Geoff Waddington is offline   Reply With Quote
Old 10-29-2017, 04:22 AM   #27
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
Default

never mind I managed to compile it
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is online now   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: 6,742
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.
__________________
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/

Last edited by Xenakios; 10-29-2017 at 07:47 AM.
Xenakios is online now   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: 6,742
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.)
__________________
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 10-29-2017, 10:11 AM   #30
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
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 | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is online now   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: 6,742
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...)
__________________
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 10-29-2017, 10:31 AM   #32
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
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 | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is online now   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 09:43 AM.


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