View Single Post
Old 11-23-2017, 06:07 PM   #70
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

Quote:
Originally Posted by Piszpan View Post
Step #12 implemented - seems to work OK. I literally replaced the whole "oscsend(OSC_to_REAPER, reaper_action, 41743);" with "switch_midimix_mode();" (I mean: with nothing between the brackets), I hope I did it right.
That's it. Glad it works as wished as expected. Use it as an opportunity to learn from the code: you have added a function call that is also already used in other places. It can be seen from where the function is declared it takes no parameters (i.e. nothing in the brackets). Question to prompt learning: Why is the switch_midimix_mode() call also where it is in other places in the code?

Quote:
Originally Posted by Piszpan View Post
As of buttons, I need them to:
- work only in toggle mode
- be generically mappable like a knob
- show current parameter state via LED if possible - that would be cool
- two virtal layers (with the second available via the "solo" switch) would be even cooler.
Try going for toggle mode using Reaper OSC triggered actions as suggested below. LEDs are possible and so is the "missing" layer of 8 solo combined with recarm buttons but it requires code changes and extensions. So keep it simple and just repurpose the existing 24 buttons to start with. To toggle Reaper actions beyond those in .Reaper OSC one would need to add code to track successive button presses.


Quote:
Originally Posted by Piszpan View Post
Some time ago I tried to use Korg Nanokontrol's buttons to launch Reaper's actions. There were problems when these buttons were set to "momentary" - Reaper was then opening and closing windows very fast (they were literally flickering). After I changed them to "toggle", it worked OK, though the LED's were alternately swiching on and off, which was a bit misleading in case of just launching an action.
This was useful learning about calling actions in Reaper if you can recall what you did.... But it was for Midi (rather than OSC) and the LED's would have come on or off solely within the Nanokontrol hardware, because there was no intermediate software and Reaper does not send any Midi feedback.

Quote:
Originally Posted by Piszpan View Post
I don't know in which mode operate the buttons in your tool now, but they work OK (no strange behavior in Reaper when launching actions). I attached one action to the bottom row (it seems the whole row shares one parameter anyway), and another action to the right upper knob.
This sounds hopeful. Look at the code and see there are three sections for the buttons: Rec Arm, Mute, and Solo (TRACK_SOLO) in that order? Everything for the buttons in the current control surface is done by using the native Reaper OSC pattern calling actions.

So find and read the MidiMix.ReaperOSC file that (sort of) explains what the Reaper actions might be. Start with say just the "solo 1" button, because the buttons in this row have the simplest code, and repurpose that single button to another different ReaperOSC action with a different string pattern. Just work on the single button until happy with the result and gaining understanding as to how and why it works. There's advice to XamiKami above in the thread on button repurposing too. Searching thoroughly in the forums for OSC use by others may help.

Try calling another native Reaper OSC function that sounds really simple or you know well from the Reaper end from its name (you will need to use a different OSC string pattern to call that alternative Reaper action).

That gives you a working button with changed functionality that can then be extended to other buttons...

From there, in a subsequent stage as code writing confidence grows, you might add either alternative feedback detection (to drive an LED light) by altering code in @oscmsg section.

Or you might try to add a toggle for a reaper action that is not supported by .ReaperOSC : this toggle requires code to track the state of subsequent button presses since the MIDIMIX buttons themselves are momentary not toggling in their Midi action. (see dialogue with Darkstar earlier in the thread on this).

Good luck.

Last edited by goldenarpharazon; 11-23-2017 at 06:44 PM.
goldenarpharazon is offline   Reply With Quote