Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Compatibility

Reply
 
Thread Tools Display Modes
Old 03-27-2018, 08:28 AM   #81
Piszpan
Human being with feelings
 
Join Date: Aug 2016
Posts: 51
Default

@goldenarpharazon
Over 3 months later I'm still stuck in the same point. I have read your hints, but I am simply not able to do this myself. Copying/pasting sections of code or finding and changing some values - that's feasible for me. But writing new code - out of my reach.

I am talking here, of course, about adding some functionality to the buttons in the instrument mode. After some thinking I came to conclusion that even the simplest implementation (I mean: no banks, no second layer of funcionality accessible via the Solo button, no LED utilization) would still be a big advance in usability of your great script.

At this moment, whenever I have some virtual switches in my VST instrument GUI's, I use the second bank of knobs in your script. It works, but it is not as elegant nor ergonomic as just having physcial buttons under my fingers. Infortunatelly I am not able to write code that would handle the button toggle mode in instrument mode.

Help me, Obi-Wan...
Piszpan is offline   Reply With Quote
Old 03-31-2018, 01:06 PM   #82
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 119
Default Repurposing buttons to be learnable with a toggle

Here goes: teach a man to fish, rather than give a fish...

Use this Notepad++ editor to look at the script code. https://forum.cockos.com/showthread....t=notepad+eel2
It will highlight the syntax. aids learning, and helps to ensure that block start and ends (the curved brackets and semicolons etc) align

Then let's start by repurposing a single recarm button. One step at a time to make sure the syntax and intent is correct.

The code needing to be changed is here.
Code:
          midimix_mode == 0 ? oscsend(OSC_to_REAPER, reaper_track_recarm_toggle, 1 ) : 
          		      ( oscsend(OSC_to_REAPER, device_track_select, 1); oscsend(OSC_to_REAPER, device_fxparam_bank_select ););
We will change either the first, or more likely the second pair of oscsend() calls (device_track_select & device_fxparam_bank_select: which are made in instrument mode), to instead call a new function toggle_button() which will do the toggle and send the OSC.

Start by declaring a toggle flag. Do this in the // Variable section to be tidy and consistent.

Code:
button1 = 0;   // Flag to track button state
Secondly write the new function needed that looks about like this

Code:
function toggle_button()
//
// Send a toggling OSC string on a button press. Sends 1 or 0 value on subsequent button presses
//
(   
    button1 == 0 ?
    (     
       button1 = 1; 
       oscsend(OSC_to_REAPER,"f/midimix/button/1", 1);
    ):
    (
       button1 = 0;
       oscsend(OSC_to_REAPER,"f/midimix/button/1", 0);  
    ); 
);
Finally call toggle_button() as introduced at the start of this explanation. So the code looks like this. Check the ); so the blocks line and pair up correctly.

Code:
          midimix_mode == 0 ? oscsend(OSC_to_REAPER, reaper_track_recarm_toggle, 1 ) : 
          		      toggle_button(); );
There. We have a single toggling button that can be "learnt" to change something in Reaper, using Reaper's learn function instead of Record Arming or opening an effect

To harness all eight buttons, this function can either be cut and pasted and modified to make eight function variants (crude but effective) or by extending to do all eight buttons instead of the first one (better but trickier coding whilst learning).

To do such extension the new toggle_button() function would need extending
- to take a parameter 1-8 passed to it depending on the button (see example of parameters in send_soft_fader() function )
- to use an array of eight flags one per button, rather than a single variable
(see the use of memset(): considerable care needed here to start a second array so it doesn't overlap FX_GUIstate)
- send an OSC string per button like "f/midimix/button/1" where the integer in the string varies from 1-8 per button

Finally tidy up the use of a literal string in the toggle_button() function by declaring the string in the same way as the other strings.

One could even extend the use of this new function to more buttons beyond the eight record arms.

Last edited by goldenarpharazon; 04-16-2018 at 02:33 PM. Reason: Made end intention of changes clearer. Added easy cut and paste suggestion. Added EEL2 syntax aware editor
goldenarpharazon is offline   Reply With Quote
Old 04-20-2018, 01:16 PM   #83
Piszpan
Human being with feelings
 
Join Date: Aug 2016
Posts: 51
Default

@goldenarpharazon

Hurray! I finally managed to do it - thanks to your detailed instructions, of course.
Thank you!
Piszpan is offline   Reply With Quote
Old 06-18-2018, 01:36 PM   #84
warsaw
Human being with feelings
 
Join Date: Jun 2018
Posts: 1
Default

How would it be possible to disable Mixer Mode completely and just have it at Instrument mode with the banks alongside the Mute/Rec buttons and Faders as extra controllers. Asking for a friend, deleting some code doesn't seem to work unless I'm- I'm meaning to say he- is doing something wrong unless this seems to be beyond my uh-friend's paygrade but the answers right in golden's fishing lesson and no effort was made from learning from it.

Changing midimix_mode = 0 to 1 doesn't seem to help and stays in Mixer mode and won't switch to Instrument. In fact, this may be the problem that could spell out the rest of the solution if that could be solved.
warsaw is offline   Reply With Quote
Old 06-19-2018, 12:24 AM   #85
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 119
Default Starting in instrument mode

See step 12 of this post earlier in the thread https://forum.cockos.com/showpost.ph...1&postcount=66 for how to start in instrument mode.
Step 1 onwards of the same post explains how to use the faders as extra controllers

Last edited by goldenarpharazon; 06-19-2018 at 12:34 AM. Reason: Fader repurpose request answered
goldenarpharazon is offline   Reply With Quote
Old 06-30-2018, 06:55 AM   #86
Piszpan
Human being with feelings
 
Join Date: Aug 2016
Posts: 51
Default

@warsaw
PM me. I may help you.
Piszpan is offline   Reply With Quote
Old 07-22-2018, 06:26 AM   #87
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 119
Default Head up display for Midimix knob assignments

Darkstar has released a useful GUI Head Up Display that helps keep track of, and displays the assignments of the 144 assignable knobs.

Here is a screenshot thumbnail as taste of what is available

>>> https://i.imgur.com/pUFlQ3k.png
goldenarpharazon is offline   Reply With Quote
Old 09-18-2018, 05:40 AM   #88
Starfighter753
Human being with feelings
 
Join Date: Sep 2018
Posts: 1
Default Problems

Quote:
Originally Posted by smithoid View Post
All I can see is:



===== Loading scripts from C:\Users\paul\AppData\Roaming\oscii-bot:

C:\Users\paul\AppData\Roaming\oscii-bot\MidiMixControl.txt
Listening on 'localhost:9000'
2 inputs, 2 outputs

Total: 1 scripts, 2 inputs, 2 outputs

================================================== ==============================


I get this message from oscii-bot:

===== Loading scripts from C:\Users\Morten\AppData\Roaming\oscii-bot:

C:\Users\Morten\AppData\Roaming\oscii-bot\MidiMixControl.txt
Warning: tried to open device 'MIDI Mix' but failed
Listening on 'localhost:9000'
Warning: tried to open device 'MIDI Mix' but failed
1 inputs, 1 outputs, 2 bidirectional

Total: 1 scripts, 1 inputs 1 outputs 2 bidirectional

================================================== ==============================

What should I do to make this work?
Starfighter753 is offline   Reply With Quote
Old 09-18-2018, 08:52 AM   #89
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 119
Default

Quote:
Originally Posted by Starfighter753
What should I do to make this work?
Please follow this from page 3 of the AKAI MidiMix control surface user guide "Troubleshooting" section.

"Should you need further guidance on setting up OSCII-bot and OSC in Reaper then see http://forum.cockos.com/showpost.php?p=1334028&postcount=11"

Simple troubleshooting steps for the Midi or OSC inputs and outputs should get the control surface working.
goldenarpharazon is offline   Reply With Quote
Old 11-05-2018, 08:51 AM   #90
antor
Human being with feelings
 
Join Date: Sep 2018
Posts: 7
Default

Hello and thanks for the awesome script!

Is it normal that Reaper reacts slowly to the controls? The mute buttons for example take a few seconds to actually mute a track and then a few more before the mute-light comes on. This does not happen if playback/record is stopped, then its as fast as anything. I've tried narrowing down the cause but it still happens with only one device connected (Microbrute via Midi cable). When I start playback the response is reasonable but a short while later it's slower. Like if data is building up somewhere.
antor 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 10:09 PM.


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