Skip to content

Commit a3492aa

Browse files
authored
Merge pull request #34 from bsmith96/qlab-reaper-integration
New marker scripts to intragrate with Qlab in particular
2 parents d77c7b1 + 17bc672 commit a3492aa

5 files changed

Lines changed: 696 additions & 0 deletions

File tree

.DS_Store

6 KB
Binary file not shown.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
--[[
2+
@description Create marker with name via OSC
3+
@author Ben Smith
4+
@link
5+
Author https://www.bensmithsound.uk
6+
Repository https://github.com/bsmith96/Reaper-Scripts
7+
@version 1.0
8+
@changelog
9+
+ Initial version
10+
@metapackage
11+
@provides
12+
[main] . > bsmith96_{filename}.lua
13+
qosc.lua
14+
Qlab5.ReaperOSC
15+
@about
16+
# Create marker with name via OSC
17+
Written by Ben Smith - June 2025
18+
19+
### Info
20+
* REQUIRES "osc.lua" IN THE SAME PATH
21+
* Intended for integration between Reaper and QLab, allowing markers when cues are fired when Multitrack Recording a live show
22+
23+
### Usage
24+
* Create a custom OSC shortcut for this script (in the actions menu)
25+
* Send this OSC trigger with a string as the first argument. This string will become the name of the marker.
26+
* For QLab integration:
27+
* Reaper Preferences > Control/OSC/Web
28+
* Add a new device
29+
* Device name: QLab
30+
* Configure device IP+local port
31+
* Device Port: 53000
32+
* Device IP: QLAB IP ADDRESS
33+
* Local listen port: 53001
34+
* Local IP: current IP address
35+
* Allow binding messages to REAPER actions and FX learn: TRUE
36+
* Pattern config: open config directory
37+
* Copy the provided file "Qlab5.ReaperOSC" into this directory
38+
* Pattern config: refresh list, then choose Qlab5
39+
* Check your QLab settings - you need to ensure Network > OSC Access > No passcode has "view" access
40+
* Now, Reaper should send a message to QLab whenever you start reaper playback, "/listen/go/name", which asks Reaper to send the cue name whenever "go" is fired.
41+
* In the actions menu, find this script.
42+
* Press play on reaper
43+
* Press "go" on any cue in Qlab
44+
* This should set the custom shortcut for the action to "/qlab/event/workspace/go/name"
45+
46+
### User customisation
47+
*
48+
]]
49+
50+
51+
-- =========================================================
52+
-- =============== USER CUSTOMISATION AREA ===============
53+
-- =========================================================
54+
55+
--------- End of user customisation area --
56+
57+
58+
-- =========================================================
59+
-- ================= GLOBAL VARIABLES ====================
60+
-- =========================================================
61+
62+
local r = reaper
63+
64+
-- get the script's name and directory
65+
local scriptName = ({r.get_action_context()})[2]:match("([^/\\_]+)%.lua$")
66+
local scriptDirectory = ({r.get_action_context()})[2]:sub(1, ({r.get_action_context()})[2]:find("\\[^\\]*$"))
67+
local scriptFolder = scriptDirectory:gsub(scriptName..".lua", "")
68+
69+
70+
package.path = scriptFolder .. '?.lua'
71+
72+
-- Require the osc module
73+
local osc = require('qosc')
74+
75+
-- debug
76+
--local msg = osc.get()
77+
--if msg then
78+
-- reaper.ShowMessageBox("OSC address: " .. msg.address .. ", argument: " .. (msg.arg and msg.arg or "(nil)"), "Info", 0)
79+
--else
80+
-- reaper.ShowMessageBox("Invalid or no OSC message", "Error", 0)
81+
--end
82+
83+
84+
-- =========================================================
85+
-- ====================== FUNCTIONS ======================
86+
-- =========================================================
87+
88+
-- =========================================================
89+
-- ====================== UTILITIES ======================
90+
-- =========================================================
91+
92+
-- Deliver messages and add new line in console
93+
function dbg(dbg)
94+
r.ShowConsoleMsg(tostring(dbg) .. "\n")
95+
end
96+
97+
-- Deliver messages using message box
98+
function msg(msg, title)
99+
local title = title or scriptName
100+
r.MB(tostring(msg), title, 0)
101+
end
102+
103+
104+
-- =========================================================
105+
-- =================== MAIN ROUTINE ======================
106+
-- =========================================================
107+
108+
r.Undo_BeginBlock()
109+
110+
-- get OSC message
111+
local msg = osc.get()
112+
113+
-- Create a marker at the current position, with the args of OSC message as the marker name
114+
r.AddProjectMarker(0,0,r.GetPlayPosition(),0,msg.arg,-1)
115+
116+
-- Send OSC message to QLab to request the cue name from cue ID
117+
118+
119+
r.Undo_EndBlock(scriptName, -1)

0 commit comments

Comments
 (0)