Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-14-2017, 06:35 AM   #1
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 402
Default Looking for hints concerning API (in Control Surface related part)

Hi,
I have joined the community not so long time ago, I am still learning how to use Reaper. But in parallel I try to understand what is needed to port my own project into Reaper, which new possibilities that opens, etc.
I slowly google and look at the source, but may be some experienced people can simplify my journey. Just a link (to docs or source) can be sufficient. I do not want take too much of someone's time.

1. IReaperControlSurface::Extended().
Is there any description for existing extensions? I mean 65538, 65548, 65550, etc. Is that in some recent versions of SDK?
I like "event driven" approach, so instead of parameters pooling I just can wait till Reaper informs me that the parameter is changed. That is already in the API, but only for a tiny subset of possible parameters (volume, pan, etc.). I hope there is some extension to required notifications for any (or just more) parameters (f.e. plug-in selected/GUI opened, parameter X from FX Y in the item Z of track T is modified, etc.).

2. All surface examples in SDK are for dedicated devices. So the approach to create separate IO is fine.
But there are many devices which use the same port for surface and keys/other "MIDI" controls.
2.a) what is the usual way to proceed in that case? Fe virtual internal MIDI loopers?
2.b) are there any "hooks" in the MIDI hardware input/output internal processing chains?
Ideally I would prefer to get control at the very beginning of input processing, to filter our surface related messages, transform some messages (think of Ableton Push scenario) or even inject new (f.e. to allow "MIDI Learn" from dedicated surface, injecting messages as coming from performance device). The same for output.
Instantiating explicit in FX on each track sounds like a bit ugly workaround for the purpose. So I am looking for "hidden" per hardware input "in FX" (+ hidden per hardware output "out FX").

3. Threading model. Is there is something which is thread specific? I mean surface in general can re-configure the project (add tracks, FXes, arm, try to change other parameters). Can it be that some operations has to be synchronized (f.e. performed from "Run()" method only) ?

PS. I have already clarified another important question. My original project is written in plain C and cross-compiled under Linux for Windows. So I have checked the possibility to do the same for Reaper. The comments in header files about that case are correct. I mean gcc (plain C) cross-compiling works fine, as long as MS ABI for virtual classes and calls is taken into account.
azslow3 is offline   Reply With Quote
Old 12-14-2017, 07:04 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,885
Default

I can't answer specifically but here's the source of Klinke's MCU plugin for Reaper (which also has a FX control mode), in case you haven't seen it yet:

https://bitbucket.org/Klinkenstecker...klinke_mcu/src
nofish is offline   Reply With Quote
Old 12-14-2017, 07:05 AM   #3
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 2,387
Default

Quote:
Originally Posted by azslow3 View Post
I like "event driven" approach, so instead of parameters pooling I just can wait till Reaper informs me that the parameter is changed. That is already in the API, but only for a tiny subset of possible parameters (volume, pan, etc.). I hope there is some extension to required notifications for any (or just more) parameters (f.e. plug-in selected/GUI opened, parameter X from FX Y in the item Z of track T is modified, etc.).
Yeah, I was originally a fan of the event driven approach, but after a long and arduous philosophical conversion on my part, I've come to realize that polling is actually superior for this task.

I'm not trying to tell you how to implement, just noting that after coding for control surfaces for 10 years now, I've come around to appreciating the subtle advantages of polling
__________________
Groove is the subtle control of chaos -- Control Surface Integrator -- You can donate here: geoffwaddington.ca -- Reaper forum thread: https://forum.cockos.com/showthread.php?t=183143
Geoff Waddington is offline   Reply With Quote
Old 12-14-2017, 10:24 AM   #4
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 402
Default

Quote:
Originally Posted by nofish View Post
I can't answer specifically but here's the source of Klinke's MCU plugin for Reaper (which also has a FX control mode), in case you haven't seen it yet:

https://bitbucket.org/Klinkenstecker...klinke_mcu/src
Thanks for the link!


Quote:
Originally Posted by Geoff Waddington View Post
Yeah, I was originally a fan of the event driven approach, but after a long and arduous philosophical conversion on my part, I've come to realize that polling is actually superior for this task.

I'm not trying to tell you how to implement, just noting that after coding for control surfaces for 10 years now, I've come around to appreciating the subtle advantages of polling
I have only 3.5 years coding surfaces (with forced polling approach)...

But after education period, then 10 years comparing (mostly my own) even driven medium size (O(1k) interconnected services with O(100k) parameters) systems with some known pool based system (including binding to them) and now 10 years fighting with another pool based system ( O(100k) computers ), I still think that when pooling make no sense, it should be avoided
azslow3 is offline   Reply With Quote
Old 12-22-2017, 12:23 PM   #5
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 402
Default

Found so far:

* (for 1.) newer reaper_plugin.h in SWS repository has CS (and other) extentions definition

* (for 2.) with audio "hook", it is possible to get access to RT MIDI (API calls still exist, defined in original SDK but no longer generated by Reaper... are they going to be obsolete soon?).

But all my attempts to modify the stream has failed so far. I am first get called with "Post" then with "!Post" (for me, the opposite order could be more logical). While the second "pass" ("!Post") see the modification from the first one, original signal is delivered to the track.

That means so far it IS NOT POSSIBLE to normally configure boards with knobs/buttons as control surfaces. I hope I have not found something or that can be fixed. I repeat, that rules out a big range of devices, from MPK up to Push.
azslow3 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 03:18 PM.


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