forked from christhoms/ma2-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNudgeBPM.lua
More file actions
32 lines (28 loc) · 1.05 KB
/
NudgeBPM.lua
File metadata and controls
32 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--[[config]]--
local speedMaster = "SpecialMaster 3.1"
local nudgeAmount = 2
--[[handy shortcuts]]--
local text = gma.textinput
local feed = gma.feedback
local cmd = gma.cmd
local o = gma.show.getobj.handle
local property = gma.show.property.get
--[[actual functions that do things]]--
function NudgeBPMUp()
local master = o(speedMaster)
local speedPercent = property(master, 1)
local speedBPM = math.floor(((tonumber(speedPercent:sub(0, speedPercent:len() - 1)) / 100) * 225) + 0.5)
--feed("BPM:" .. speedBPM)
gma.show.setvar("StoredBPM", speedBPM)
local nudgeBPM = speedBPM + nudgeAmount
cmd(speedMaster .. " at " .. nudgeBPM)
end
function NudgeBPMDown()
local master = o(speedMaster)
local speedPercent = property(master, 1)
local speedBPM = math.floor(((tonumber(speedPercent:sub(0, speedPercent:len() - 1)) / 100) * 225) + 0.5)
--feed("BPM:" .. speedBPM)
gma.show.setvar("StoredBPM", speedBPM)
local nudgeBPM = speedBPM - nudgeAmount
cmd(speedMaster .. " at " .. nudgeBPM)
end