-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for REAPER's cockos.reaper_extension? #110
Comments
So I was looking at this for surge also. I haven't written the code yet but let me jot notes here (especially if you are interested in taking a shot at it). the answer is "yes" but we just need to plumb it through. The extension is something you can just get with The way to do this, I think (and how I would do it) is in
so this will give you, if you implement the extensions, the ability to do So the only thing left then is to set that lambda to something in the startup path. In
soo to that you should be able to do something like set the extensionGet to anyway that's shorthand. If you think you want to take a swing at it would be happy to review, and if not, can def get to it after thanksgiving or earlier if its pressing. |
Thanks for the quick and thorough reply. |
Yeah we’ve kinda used surge to highlight the things which are possible so I kinda want to do something. The only thing is I don’t know reaper well enough to know what a cool feature would be with this api!! All ears for ideas |
Admittedly I don't come up spontaneously with something too. |
Yeah, this seems like a cool thing to have! And it makes sense that the same approach could be used for other DAWs with host-specific APIs. I think Paul's sketch of the implementation seems about right. I think it would also be nice to have an example plugin in this repo that does something simple: I'm thinking a drop-down menu that changes the colour of the track the plugin is on? I should have time for some hacking on this over the Thanksgiving holiday. |
@jatinchowdhury18 did you have the chance to make any progress on this? I'm totally new to CLAP but I would certainly digg into it if the interoperability with Reaper API and its host methods was confirmed. |
@giohappy I did not... but I spent 5-10 minutes on it just now. I've pushed my work to a branch in case you (or anyone else) wants to take a look: main...jatinchowdhury18:clap-juce-extensions:reaper-ext We can query Reaper for the extension, and Reaper gives us back something that is not |
Another few minutes of hacking today... muting a track through the Reaper API works! Screen.Recording.2023-10-11.at.9.41.56.AM.mov |
@jatinchowdhury18 great! Thanks for sharing it, I will test it ASAP. |
@jatinchowdhury18 I was able to run it. Thanks! I'm not an expert in C++. Is there any difference between this (your code): MediaTrack *(*getTrackFunc)(ReaProject *, int);
*((void **)&getTrackFunc) = reaperPluginExtension->GetFunc("GetTrack");
auto *track0 = (*getTrackFunc)(nullptr, 0); and this (what I would have done)?: void *(*getTrackFunc)(ReaProject *, int);
getTrackFunc = reinterpret_cast<void *(*)(ReaProject *, int)>(reaperPluginExtension->GetFunc("GetTrack"));
auto *track0 = reinterpret_cast<MediaTrack *>((*getTrackFunc)(nullptr, 0)); And are you going to open a PR to have |
No problem! Those code snippets look equivalent to me. I was using this example from the Reaper SDK as a reference. You might be able to simply your version a little bit if you define the function pointer return type, since then you shouldn't need the second MediaTrack *(*getTrackFunc)(ReaProject *, int);
getTrackFunc = reinterpret_cast<MediaTrack *(*)(ReaProject *, int)>(reaperPluginExtension->GetFunc("GetTrack"));
auto *track0 = (*getTrackFunc)(nullptr, 0); There's probably some ways to clean it up further with I do plan to open a PR for the extension-related changes, but there's a couple things I'd like to do first:
|
Having some fun with track colours: #136 should be ready soon which will make |
Hi,
Cockos has just added support for CLAP plugins being able to access the REAPER API in their pre-release versions ( link to changelog) .
Curious (as I'm still a beginner with the clap-juce-extensions), can we use/access this out of the box with the current version or would it need a code modification?
And if the latter, would it be something considerable for the future?
Thanks.
The text was updated successfully, but these errors were encountered: