Skip to content

Release Change Pre-roll duration value v1.0 #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Various/JWM_Change pre-roll duration value.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- @description Change Pre-roll duration value
-- @author José M Muñoz (J-WalkMan)
-- @version 1.0
-- @metapackage
-- @provides
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to 1 bar.lua
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to 2 bars.lua
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to 4 bars.lua
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to 8 bars.lua
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to double the current value.lua
-- [main] JWM_Change pre-roll duration value/JWM_Set pre-roll duration to half of the current value.lua
-- @about
-- Minimum value is 1 measure
-- Maximum value is 16 measures

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- @noindex

reaper.SNM_SetDoubleConfigVar("prerollmeas", 1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- @noindex

reaper.SNM_SetDoubleConfigVar("prerollmeas", 2)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- @noindex

reaper.SNM_SetDoubleConfigVar("prerollmeas", 4)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- @noindex

reaper.SNM_SetDoubleConfigVar("prerollmeas", 8)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- @noindex

--Script by Mnz
-- -1 is just to highlight the odd case where reaper can't find a preroll measure value
-- the script makes sure the preroll can't be set to more than 16 bars

prerollmeas = reaper.SNM_GetDoubleConfigVar("prerollmeas", -1)
if prerollmeas == 0 then
reaper.SNM_SetDoubleConfigVar("prerollmeas", 1)
elseif prerollmeas >= 16 then
reaper.SNM_SetDoubleConfigVar("prerollmeas", 16)
else
reaper.SNM_SetDoubleConfigVar("prerollmeas", prerollmeas*2)
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- @noindex

--Script by Mnz
-- -1 is just to highlight the odd case where reaper can't find a preroll measure value
-- the script makes sure the preroll can't be set to less than 0

prerollmeas = reaper.SNM_GetDoubleConfigVar("prerollmeas", -1)
if prerollmeas <= 1 then
reaper.SNM_SetDoubleConfigVar("prerollmeas", 0)
else
reaper.SNM_SetDoubleConfigVar("prerollmeas", prerollmeas/2)
end