07-16-2018, 07:05 AM | #1 |
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
|
MidiMixControl.txt - track colours change
[oscii-bot.exe v0.6]
I have been using the AKAI MIDIMIX control surface by goldenarpharazon, Banned and others. Many thanks to you guys for this so I could get started. One thing that I saw, when in MIXER Mode, is that the oscii-bot script changes the colour of the tracks when "Bank Left" or "Bank Right" is selected. I wanted to keep the colours so thought that I would flash the Solo buttons momentarily. The code changes below work, but the flash is too quick - I would like it to be, say, 1 second. I tried the JS FX loop syntax but oscii-bot detected a syntax error. How can I add a timer? Code:
( midimix_mode == 0 ? ( oscsend(OSC_to_REAPER, reaper_action, 40297); // Unselect all tracks" oscsend(OSC_to_REAPER, "t/track/1,2,3,4,5,6,7,8/select/toggle", 1); // select tracks in current bank //DarkStar oscsend(OSC_to_REAPER, reaper_action, 40359); // Set to default color oscsend(OSC_to_REAPER, device_track_bank_increment, 1); oscsend(OSC_to_REAPER, reaper_action, 40297); // Unselect all tracks" oscsend(OSC_to_REAPER, "t/track/1,2,3,4,5,6,7,8/select/toggle", 1); // select all tracks in current bank //DarkStar oscsend(OSC_to_REAPER, reaper_action, 40360); // Set to one random color oscsend(OSC_to_REAPER, reaper_action, 7); // .... need a 1 second timer here oscsend(OSC_to_REAPER, reaper_action, 7); oscsend(OSC_to_REAPER, reaper_action, 40297); // Unselect all tracks // (makes sure tracks are unselected before using mixer oscsend(OSC_to_REAPER, reaper_action, 41070); // reset soft takeover oscsend(OSC_to_REAPER, reaper_action, 41743); // refresh all surfaces // makes REAPER send back the states of all mutes, solos and recarms for bank ): (a) why does it appear in my Notification Area (Windows 7) for a short time (~40 seconds) then disappear; there is also the usual icon on my Task Bar (b) if I close the OSCII-bot window using the [x] is the top-right corner, how do I get it back (to stop it properly)? The icon disappears from the Task Bar but the process is still running.
__________________
DarkStar ... interesting, if true. . . . Inspired by ... |
07-20-2018, 02:46 PM | #2 | ||
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Quote:
You shouldn't put any delay in the @midimsg section since as a minimum it will mess up detection of button presses etc. possibly worse given the simple scheduling and single threading model used in OSCII-bot. Instead you need to add an @timer section In @midimsg just set a flag to indicate that the "solo" action is needed. Then in the @timer section - detect that the flag is set - issue the action to set solo (once only) - start a timer: using a counter, or time() or time_precise() - when the timer expires -- issue the clear solo action -- reset the flag Quote:
Last edited by goldenarpharazon; 07-22-2018 at 06:12 AM. |
||
07-20-2018, 03:07 PM | #3 |
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
|
Thank you for your reply.
@timer -- is this documented somewhere? Edit: found it: https://www.cockos.com/oscii-bot/oscii-bot-doc.html --the syntax looks like eel/JS FX but I could not get a loop to work; what should it look like -- a time function sounds better oscii-bot icon -- disappears from the Notification Area after about 30 seconds, -- but is just hidden; I can pop up the hidden icons and double-click it there to restore the window.
__________________
DarkStar ... interesting, if true. . . . Inspired by ... Last edited by DarkStar; 07-20-2018 at 03:32 PM. |
07-22-2018, 06:07 AM | #4 | |
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Quote:
This may help https://support.microsoft.com/en-gb/...a-in-windows-7 Last edited by goldenarpharazon; 07-22-2018 at 06:13 AM. |
|
07-22-2018, 08:12 AM | #5 |
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
|
Ah, that could be it; mine says "Only show notifications"
__________________
DarkStar ... interesting, if true. . . . Inspired by ... |
07-22-2018, 01:33 PM | #6 |
Human being with feelings
Join Date: Oct 2015
Posts: 5
|
First of all, thanks to all involved for creating the MidiMixControl script, it works really well.
Incidentally, I was looking for alternative ways to highlight the tracks of the selected banks a couple of days ago and stumbled across this thread. The reason for this was: a) Changing the colour did not work for me (more on this below) b) I did not want the script to mess with my track colours I have played around with it a bit yesterday and got an initial version going using the timer and flashing the solo button as an alternative solution. But as I have no idea what I am doing, as this is the first time with scripting in Reaper and the OSCII-bot, I have also run into some issues. The timer bit seems to work, but I had to move the track deselect commands into the timer routine, as these seemed to be executed before the timer kicked in, according to the log window. So the solo enable/disable was done after all tracks in question had already been deselected. However, after confirming in the log window, that the order of commands is correct, I still see only my last manually selected track flash the solo, which leads me to believe that the select of the bank tracks does not work correctly, which might explain why I did not see any colour changes in the first place. The faders work correctly though, when switching to another bank. Any ideas how to troubleshoot this? |
07-22-2018, 03:06 PM | #7 |
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
|
^^^^
Toggling Solo may get a bit LOUD - perhaps change it to toggle the Mutes.
__________________
DarkStar ... interesting, if true. . . . Inspired by ... |
07-22-2018, 03:44 PM | #8 | ||
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Quote:
Appropriately pair the tracks' select and deselect, and only execute each of them once. Consider the order that things are actually happening on the two (allegedly) different threads @midimsg and @timer, as you are deducing from the log. One might need some sort of semaphore to wait momentarily and synchronously in @midimsg until @timer has run for the first time. Print messages using time_precise() to the log may be helpful whilst debugging. Beyond that one would need to see code, and associated log fragments, and possibly screen shots to be more helpful. Quote:
It's a shame that one can set colours etc with a Reaper action but there is no "toggle track colour" type action. An understated way of visually highlighting the tracks, that will have no audio effect, might be just to select the eight tracks in the bank and then unselect them after the one second delay. Last edited by goldenarpharazon; 07-22-2018 at 04:46 PM. Reason: Added idea of select / unselect |
||
07-27-2018, 02:42 PM | #9 |
Human being with feelings
Join Date: Oct 2015
Posts: 5
|
Using only a track selection indicator briefly would work for me I guess, but I still have the problem that the selection does not seem to work, unless I am doing something completely wrong.
For testing purposes, I removed most of the commands from the "Bank Right" action, which also shows up correctly in the OSC listening window of Reaper after pressing the "BANK RIGHT" button: /action [i] 40297 /track/1,2,3,4,5,6,7,8/select/toggle [] To my understanding, this should first deselect all tracks and then select all tracks from the current bank and leave it that way, right? However, I am left with no selected track in Reaper. Any help would be appreciated as I am not sure where any further debugging log information could be found here. |
07-27-2018, 03:03 PM | #10 |
Human being with feelings
Join Date: Oct 2015
Posts: 5
|
Ok, I found the issue now. The MidiMix.ReaperOSC file was not in its correct location and not used. Therefore things like
REAPER_TRACK_FOLLOWS DEVICE were not correctly set up, which I think is needed here. I can now go on and play around with the script a little more. ;-) |
07-31-2018, 09:19 AM | #11 |
Human being with feelings
Join Date: Oct 2015
Posts: 5
|
I used the layout change function for the selected tracks from Banned's script to indicate which tracks are the active ones, which works fine now. Thanks for the help!
|
Thread Tools | |
Display Modes | |
|
|