Old 05-10-2018, 11:07 PM   #1
Thalamus
Human being with feelings
 
Thalamus's Avatar
 
Join Date: Jun 2011
Location: Cheshire, UK
Posts: 607
Default Set loop mode in MIDI editor

Currently I can toggle looping on/off but there is no option/action to set it on or off.

Would be kinda handy for macros...
Thalamus is offline   Reply With Quote
Old 05-17-2018, 03:59 AM   #2
enroe
Human being with feelings
 
Join Date: Nov 2017
Posts: 1,575
Default

Yes, I realized this too.

It would be nice if we could choose to definitely
set "repeat on" or set "repeat off". But I can't
find these commands in the action list.

In the action list is: "toggle repeat". If you use
"toggle repeat" in a macro you never know what
your macro will actually do.
__________________
free mp3s + info: andy-enroe.de songs and weird stuff: enroe.de
enroe is offline   Reply With Quote
Old 05-19-2018, 11:10 AM   #3
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 923
Default

-- enable looping lua script

function enable_looping()

numb = reaper.CountSelectedMediaItems(0)

for i = 0, numb - 1 do
MediaItem = reaper.GetSelectedMediaItem(0, i)
reaper.SetMediaItemInfo_Value(MediaItem, "B_LOOPSRC", 1)

end

reaper.UpdateArrange()

end

enable_looping()

---------------------------------------------------------
-- disable looping lua script

function disable_looping()

numb = reaper.CountSelectedMediaItems(0)

for i = 0, numb - 1 do
MediaItem = reaper.GetSelectedMediaItem(0, i)
reaper.SetMediaItemInfo_Value(MediaItem, "B_LOOPSRC", 0)

end

reaper.UpdateArrange()

end

disable_looping()

Last edited by Embass; 05-19-2018 at 11:15 AM.
Embass is offline   Reply With Quote
Old 05-19-2018, 11:12 AM   #4
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 923
Default

works with multiple media items too.
Embass is offline   Reply With Quote
Old 05-19-2018, 12:43 PM   #5
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

If you are referring to playback looping, not item looping, you can try these short scripts:

Code:
-- Transport - Toggle playback looping ON
currentState = reaper.GetToggleCommandStateEx(0, 1068)
if currentState == 0 then -- if off, then toggle
    reaper.Main_OnCommand(1068, 0, 0)
end
reaper.defer(function() end)
Code:
-- Transport - Toggle playback looping OFF
currentState = reaper.GetToggleCommandStateEx(0, 1068)
if currentState == 1 then -- if on, then toggle
    reaper.Main_OnCommand(1068, 0, 0)
end
reaper.defer(function() end)
juliansader is offline   Reply With Quote
Old 05-19-2018, 12:45 PM   #6
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Interesting: I just noticed that MIDI editor action "Transport: Toggle repeat" does not show any on/off state in the Actions list, unlike the Main section's equivalent.
juliansader is offline   Reply With Quote
Old 05-19-2018, 12:48 PM   #7
enroe
Human being with feelings
 
Join Date: Nov 2017
Posts: 1,575
Default

Thank you Julian,
this was exactly what I was looking for.
__________________
free mp3s + info: andy-enroe.de songs and weird stuff: enroe.de
enroe 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:01 AM.


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