Old 03-24-2014, 08:20 AM   #1
HoJo
Human being with feelings
 
Join Date: Dec 2007
Location: Germany
Posts: 253
Default Automatically repeat macros...how?!

Hi All!

Anybody able to tell how I can automatically repeat macros?
Say I am about to create an Action Script that is doing what „Split at Transients“ is doing. It’s just an example.
How can I make Reaper do repeat the script automatically?

Perfect scenario would be:
starting the script and it runs automatically until it reaches the end of the item.

And this I would like to do for the Slip Editing…

Ideas are more than welcome.

Thanks.

HoJo
HoJo is offline   Reply With Quote
Old 07-05-2020, 12:23 PM   #2
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,114
Default

Automatically only with Cycle actions and provided there's only one selected item.

With regular macros only with a user input after each split.
Buy One is offline   Reply With Quote
Old 07-06-2020, 01:41 AM   #3
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,986
Default

I think the best way is via script, you can call macros using MainOnCommand or MIDIEditor_OnCommand, combined with loops in the script.

I just started learing about scripts but it is not difficult and is fun :P
Recomend X-raym videos about https://www.youtube.com/watch?v=0Dwo...aHLs5G4vOcyLF8

And

https://www.admiralbumblebee.com/mus...-Tutorial.html


EDIT: wait this is a 2014 post
daniellumertz is online now   Reply With Quote
Old 07-06-2020, 02:36 AM   #4
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,114
Default

Quote:
Originally Posted by daniellumertz View Post
I think the best way is via script, you can call macros using MainOnCommand or MIDIEditor_OnCommand, combined with loops in the script.
Do you know how to loop a native action or a number thereof with a script?
Buy One is offline   Reply With Quote
Old 07-06-2020, 03:29 PM   #5
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,986
Default

Quote:
Originally Posted by Buy One View Post
Do you know how to loop a native action or a number thereof with a script?
I'm a beginner at scripts but this should be easy.

what you want to do?
daniellumertz is online now   Reply With Quote
Old 07-07-2020, 01:55 AM   #6
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,114
Default

Quote:
Originally Posted by daniellumertz View Post
I'm a beginner at scripts but this should be easy.

what you want to do?
Sure, one simply has to know the syntax. Say repeat the action View: Increase selected track heights a little bit a predefined number of times
Buy One is offline   Reply With Quote
Old 07-07-2020, 03:17 AM   #7
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,986
Default

Quote:
Originally Posted by Buy One View Post
Sure, one simply has to know the syntax. Say repeat the action View: Increase selected track heights a little bit a predefined number of times
Code:
reaper.Undo_BeginBlock()

for i =  0, 99 do
    reaper.Main_OnCommand( 41327, 0 )
end

reaper.Undo_EndBlock( "Script: View: Increase selected track heights a little bit x times ", -1 )
the it will repeat it 100 times, there are more ways to create loops in lua https://www.youtube.com/watch?v=gi4DCaBpsnw&t=569s


The fun in reascript is reapet it according to a variable for exemple

Code:
reaper.Undo_BeginBlock()

reaper.ShowConsoleMsg( "" )
select_tracks_count = reaper.CountSelectedTracks( 0 )
for i =  0, 1000*(10^(select_tracks_count*(-1)))  do
    reaper.Main_OnCommand( 41327, 0 )
    reaper.ShowConsoleMsg( "Number of execution is "..tostring(i+1).."\n" )
end

reaper.Undo_EndBlock( "Script: View: Increase selected track heights a little bit x times ", -1 )
The more tracks selected less it repeat the action
1track= 101 times
2 = 11
3 = 2
A silly exemple but made just to demonstrate
daniellumertz is online now   Reply With Quote
Old 07-07-2020, 04:34 AM   #8
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,114
Default

Thank you, useful info.
Buy One 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 08:16 PM.


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