Old 06-23-2016, 03:48 PM   #1
leighhunt
Human being with feelings
 
Join Date: Jun 2016
Location: London, UK
Posts: 51
Default Reaper API within custom VST plugin

Greetings all,
First post from a recent potential convert from Ableton Live / Maxmsp world here.
I have a reasonable amount of 'hobbyist' interest in programming, my best effort being a midi in/out external for max4live that opened up the midi possibilities in M4L...I have quite a lot of programming fun, but I am by no means an expert.
Languages I have worked with mostly are C (building max gui externals in C to control my computers and apps via a touchscreen), python for Ableton Live Scripts, and a bit of ObjectiveC for fun custom midi/osc control apps (at least until my developer program subs ran out and I couldn't justify the extra expense for a hobby due to offspring arriving 18 months ago!).

I'm particularly interested in modulation matrices...... I kind of like live improvising in a soundscapey sort of way... which leads me to my question......


I notice with interest that the Playtime vst exists in Reaper world, and presume from this vst, that the reaper api can be pretty much exposed within a vst plugin.
One consideration I ask for advice on, is whether anyone has knowledge of the limitations of control using the api within a vst. What I am hoping to achieve is 64 or more potentially continuous streams of values to parameters in Reaper. Sample rate update would not be necessary, but stable 50ms update rate would be a worst case scenario for it to be worthwhile for my needs.

I have enough knowledge to build vst plugins using iplug, but my initial prodding of code and downloading of various open source bits and bobs leaves me completely unable to work out how to do this.
I can add reaper_plugin_functions.h (both downloaded and created from latest Reaper version using developer script) and reaper_plugin.h to an existing project, and include them in my main code, and successfully build, but as of yet cannot work out the method to make calls to functions.
I have scoured to forum, and internet for any pointers regarding this, but so far have come up against a brick wall.

If there is anyone on here with an insight as to how I might achieve this then I would love to hear from you.

It might just be a syntax thing that leaves me stumped, but then again it might be a few glaring omissions in my self taught programming knowledge, particularly with regard to C++.

Should you have the full knowledge but don't want to be giving away your expertise then feel free to drop me a message and we might have a chat.

Many thanks in advance
And well done if you made it to the end of this convoluted post!
Leigh

Last edited by leighhunt; 06-23-2016 at 04:57 PM.
leighhunt is offline   Reply With Quote
Old 06-24-2016, 01:08 AM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

Quote:
Originally Posted by leighhunt View Post
presume from this vst, that the reaper api can be pretty much exposed within a vst plugin.
I did not try this, as I found that for my needs I could get along with multiple Reaper extensions that already are provided (such as SWS) and som JSFX script programming.

AFAIK a "Reaper Aware" VST (like the rather small "MidiToReaControlPath" that I do use) is a DLL that features as well the VST API as the Reaper Extension API.

-Michael
mschnell is online now   Reply With Quote
Old 06-24-2016, 02:11 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

You need to load the Reaper API functions using a vendor specific call with the audioMasterCallback. Just including the Reaper SDK header files isn't going to work. With IPlug that will require you to change the IPlug source code. I can't give you the specifics on how to do that with IPlug since I've only done that with Juce. But maybe someone familiar with IPlug can give you the specifics.
__________________
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-24-2016, 04:05 AM   #4
leighhunt
Human being with feelings
 
Join Date: Jun 2016
Location: London, UK
Posts: 51
Default

Quote:
Originally Posted by mschnell View Post
I did not try this, as I found that for my needs I could get along with multiple Reaper extensions that already are provided (such as SWS) and som JSFX script programming.

AFAIK a "Reaper Aware" VST (like the rather small "MidiToReaControlPath" that I do use) is a DLL that features as well the VST API as the Reaper Extension API.

-Michael
Hi Michael,
Thanks for your reply. I hadn't noticed the existence of that plugin. That certainly seems to confirm my assumptions re Playtime.
Regards,
Leigh
leighhunt is offline   Reply With Quote
Old 06-24-2016, 04:12 AM   #5
leighhunt
Human being with feelings
 
Join Date: Jun 2016
Location: London, UK
Posts: 51
Default

Quote:
Originally Posted by Xenakios View Post
You need to load the Reaper API functions using a vendor specific call with the audioMasterCallback. Just including the Reaper SDK header files isn't going to work. With IPlug that will require you to change the IPlug source code. I can't give you the specifics on how to do that with IPlug since I've only done that with Juce. But maybe someone familiar with IPlug can give you the specifics.
Hi Xenakios,
Many thanks for your reply. I've already read a lot of your posts and bits and bobs on the internet!
How you explain is kind of how I imagined it to be.

I'm veering away from Juce, with it's potential licensing situation, for now.
Hopefully someone familiar with iplug, or indeed any other mac based plugin building sources, might be able to chip in with some pointers as to how it is achieved.

Just out of interest, using Juce, have any of your projects tested the stability of quite busy communication/calls to the Reaper api (I am potential looking at a lot of data streams).

.....I have a vague feeling that our paths might well cross now and then on here..

Kind regards,
Leigh
leighhunt is offline   Reply With Quote
Old 06-24-2016, 04:45 AM   #6
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

Quote:
Originally Posted by leighhunt View Post
I'm veering away from Juce, with it's potential licensing situation, for now.
Hopefully someone familiar with iplug,...
I once considered to do VST plugins in C and in future this might be interesting for me again, so I'll continue lurking here...

At that time I did read some Juce articles but did not go so far as trying to compile anything. But I never heard of iplug. Is this viable for PC, as well ?

BTW.: Did you know that there is a system (supported by a member of this forum) that allows for JSFX scripts to be compiled to VST plugins ? (I did not try it yet.)

-Michael
mschnell is online now   Reply With Quote
Old 06-24-2016, 05:05 AM   #7
leighhunt
Human being with feelings
 
Join Date: Jun 2016
Location: London, UK
Posts: 51
Default

Quote:
Originally Posted by mschnell View Post
I once considered to do VST plugins in C and in future this might be interesting for me again, so I'll continue lurking here...

At that time I did read some Juce articles but did not go so far as trying to compile anything. But I never heard of iplug. Is this viable for PC, as well ?
I'm sorry Michael but my knowledge is all mac based, and the only thing I ever use Parallels on a mac is for the numerous live mixing desk offline editors that are mac only (namely, Avid, Digico, Soundcraft).

Quote:
Originally Posted by mschnell View Post
BTW.: Did you know that there is a system (supported by a member of this forum) that allows for JSFX scripts to be compiled to VST plugins ? (I did not try it yet.) -Michael
Hmm, of this I knew nothing. I will don my reading glasses and go searching. Ideally though, I would prefer to stay in the language area of C and its derivatives, my javascripting is a bit rusty!
But thanks for the heads up on that!.

I shall post to this thread if and when I come up with solutions, in the interests of sharing et al..... especially poignant given what the majority of my country have flipping voted for yesterday :-(

Kind regards,
Leigh
leighhunt is offline   Reply With Quote
Old 06-24-2016, 08:47 AM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by leighhunt View Post
Hi Xenakios,
I'm veering away from Juce, with it's potential licensing situation, for now.
Hopefully someone familiar with iplug, or indeed any other mac based plugin building sources, might be able to chip in with some pointers as to how it is achieved.

Just out of interest, using Juce, have any of your projects tested the stability of quite busy communication/calls to the Reaper api (I am potential looking at a lot of data streams).
Juce doesn't make using the Reaper API more easier or more hard. One just needs to know where to add the Reaper API initialization stuff. I suspect it will be very similar with IPlug.

The API calls from within VST plugins are the same as from dedicated Reaper extension plugins. So any potential problems regarding performance, thread safety etc will be the same. You will just need to test how it works out. A thing to make note of is that most of the Reaper API is not thread safe and the function calls have to be made only from the main/GUI thread.
__________________
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-24-2016, 08:48 AM   #9
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by leighhunt View Post
my javascripting is a bit rusty!
JSFX are not JavaScript. JS in Reaper is short for JesuSonic, which is a derivative of Cockos's EEL language.
__________________
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-25-2016, 02:06 PM   #10
Zentropy
Human being with feelings
 
Join Date: Jun 2016
Posts: 7
Default

Quote:
Originally Posted by Xenakios View Post
Juce doesn't make using the Reaper API more easier or more hard. One just needs to know where to add the Reaper API initialization stuff. I suspect it will be very similar with IPlug.
Hey cool, a name I recognize from the JUCE forum! Do any of your Github repos have the modified JUCE/Reaper integration code in them? I was preparing to head down that road myself this weekend, but already-finished code from a trustworthy source would be primo
Zentropy is offline   Reply With Quote
Old 06-26-2016, 10:46 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 Zentropy View Post
Do any of your Github repos have the modified JUCE/Reaper integration code in them?
Not for VST plugins, as I haven't publicly released any JUCE based ones so far.

For pure Reaper extension plugins it's much simpler, no changes to JUCE itself are needed.
__________________
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-26-2016, 04:47 PM   #12
Zentropy
Human being with feelings
 
Join Date: Jun 2016
Posts: 7
Default

Aw bummer, I was looking for VST in particular. I've integrated Studio One's extensions and am going to start on these soon. Thanks anyway!
Zentropy is offline   Reply With Quote
Old 06-26-2016, 05:26 PM   #13
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Zentropy View Post
Aw bummer, I was looking for VST in particular. I've integrated Studio One's extensions and am going to start on these soon. Thanks anyway!
If you have managed to do that already, it's probably going to be pretty easy to do the Reaper extensions stuff too. (You will need to implement access to the audioMasterCallback though...)

There's some documentation about it here (the "host functions" section will be of special interest) :

http://www.reaper.fm/sdk/vst/vst_ext.php

I am not particularly trying to hide what I've done with the JUCE source code, the changes are pretty trivial, but I am not sure the way I've done it currently is the best approach. I don't want to release it into the wild just yet, so that people don't start copy pasting a possibly suboptimal solution. The best approach would probably be to request the needed changes for IPlug and JUCE as part of the official source codes..
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 06-26-2016 at 05:31 PM.
Xenakios is offline   Reply With Quote
Old 06-27-2016, 12:52 AM   #14
Zentropy
Human being with feelings
 
Join Date: Jun 2016
Posts: 7
Default

Yeah I know how you feel...I have so much Juce related stuff I've written that "works" and is for sure massively suboptimal. I agree on official support but I'm pretty sure it won't happen anytime soon unless Jules sees someone else's implementation first. Maybe after I've got it working you and I can compare a bit and send one their way
Zentropy 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 04:43 PM.


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