Skip to content

Instantly share code, notes, and snippets.

@junebash
Last active May 14, 2018 19:48
Show Gist options
  • Save junebash/d10f160a8836ab4e6573bb22ddfba825 to your computer and use it in GitHub Desktop.
Save junebash/d10f160a8836ab4e6573bb22ddfba825 to your computer and use it in GitHub Desktop.
Play back at half-time REAPER script
--[[
toggle transport playrate between 0.5 and 1.0;
sets master transport playback rate to 0.5
if currently at 0.5, sets to 1.0
by Jon Bash (@jonbash, www.jonbash.com)
]]--
playrate = reaper.Master_GetPlayRateAtTime(0)
function playback_halftime()
if (playrate == 0.5) then
-- reaper.Master_NormalizePlayRate(number playrate, boolean isnormalized)
-- reaper.Master_NormalizePlayRate(1, false)
-- reaper.CSurf_OnPlayRateChange(number playrate)
reaper.CSurf_OnPlayRateChange(1)
else
reaper.CSurf_OnPlayRateChange(0.5)
end
end
function main()
playback_halftime()
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment