Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Live Use

Reply
 
Thread Tools Display Modes
Old 07-17-2024, 11:08 PM   #1
Josh_guitarreiru
Human being with feelings
 
Join Date: Sep 2013
Location: Barcelona, Spain
Posts: 67
Default Action to set state of MIDI chase

Hi all,

For live usage I'd like to have an action that allows to Set OFF midi chasing and another to set it ON. I know there is an action that allows to toggle ON/OFF but it would be much safer an action that allows to set the status independently of the previous state. The reason I want that is because we use MIDI chasing all the time, but would like to deactivate during loops in which we might improvise.
I'd insert those actions as smart markes prior / after the loop.

However I have not been able to find such action so I was wondering whether anybody knows a workaround for this?

I alway can use the toggle action and make sure that MIDI chasing is ON at the begining of the playback, but would like to make it more robustly safe if possible.

Thanks!

Josh
Josh_guitarreiru is offline   Reply With Quote
Old 07-18-2024, 12:17 AM   #2
dangguidan
Human being with feelings
 
Join Date: Jan 2019
Location: China
Posts: 720
Default

Create two new scripts.
open:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState ~= 1 then 
   reaper.Main_OnCommand(41992,0)
end
close:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState == 1 then 
   reaper.Main_OnCommand(41992,0)
end
__________________
My script sharing sources are mostly about MIDI editing.
https://github.com/zaibuyidao/YS_Rea...main/index.xml
dangguidan is online now   Reply With Quote
Old 07-18-2024, 12:45 AM   #3
Josh_guitarreiru
Human being with feelings
 
Join Date: Sep 2013
Location: Barcelona, Spain
Posts: 67
Default

Quote:
Originally Posted by dangguidan View Post
Create two new scripts.
open:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState ~= 1 then 
   reaper.Main_OnCommand(41992,0)
end
close:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState == 1 then 
   reaper.Main_OnCommand(41992,0)
end


Wow! Many thanks mate! It works as I needed!

Cheers!
Josh_guitarreiru is offline   Reply With Quote
Old 07-28-2024, 03:03 AM   #4
Josh_guitarreiru
Human being with feelings
 
Join Date: Sep 2013
Location: Barcelona, Spain
Posts: 67
Default

Quote:
Originally Posted by dangguidan View Post
Create two new scripts.
open:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState ~= 1 then 
   reaper.Main_OnCommand(41992,0)
end
close:
Code:
CommandState = reaper.GetToggleCommandStateEx(0,41992)
if CommandState == 1 then 
   reaper.Main_OnCommand(41992,0)
end
Hi again, I'm triying to fugure it out the logic behind such scripts so that I can make a simple action script which:

1. Checks whether the play state in ON
2. If its OFF (stopped) then press paly
3. If its ON then do nothing

However I just realised that in both of your scriptes the reaper.Main_OnCommand () bit is identical, what confuses me a little bit. I have tried as follows, have tried several combinations taking as a reference what you have done above, with no luck:


Code:
CommandState = reaper.GetPlayState()
if CommandState == 2 then 
   reaper.Main_OnCommand(1007,1)
end
Any suggestion? Also is there any source that you would recommend to learn the basics of reaper scripts?

Thanks!
Josh_guitarreiru is offline   Reply With Quote
Old 07-28-2024, 05:53 AM   #5
dangguidan
Human being with feelings
 
Join Date: Jan 2019
Location: China
Posts: 720
Default

Code:
CommandState = reaper.GetPlayState()
if CommandState ~= 1 then 
   reaper.Main_OnCommand(1007,0)
end
__________________
My script sharing sources are mostly about MIDI editing.
https://github.com/zaibuyidao/YS_Rea...main/index.xml
dangguidan is online now   Reply With Quote
Old 07-28-2024, 05:58 AM   #6
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 15,865
Default

For no-Toggle play I do (EEL)

Code:
      play_cmd_id = 1007;
      proj  = 0:

      Main_OnCommandEx(play_cmd_id, 0, proj);
but

Code:
      Main_OnCommand(play_cmd_id, 0);
should work as well.
mschnell 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 09:33 PM.


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