Print multiple tracks to hardware in Reaper
Dec 20, 2022 17:57:55 GMT -6
svart, christopher, and 5 more like this
Post by copperx on Dec 20, 2022 17:57:55 GMT -6
Hi,
Maybe this is useful to those of you that mix with outboard in Reaper.
I have a few outboard units, and sometimes I want to apply the same effect to a few tracks (e.g., warm up a few tracks through transformers / preamps, apply the same hardware EQ to several tracks, saturate several synths with the same settings), and this entails a lot of manual work, so I wrote a Reaper script to automate this.
To be clear, the script processes multiple tracks (individually, one by one) through a single hardware unit. You can tell the script to send a hundred tracks through a single unit, then sit back and relax (or maybe take a nap; processing 100 three-minute tracks will take 5 hours -- but you don't have to do a thing).
It works like this: You select a bunch of tracks, create a time selection, and then run the script. The script will send each one of your selected tracks through the hardware using ReaInsert and it will record the output on top of each track as a new take. You can undo the whole process if anything goes wrong.
I'm pretty happy with it, and I thought I would share it.
Before you run the script, you must create a preset in ReaInsert and name it exactly "PrintHW" (without the quotes). In this preset, you specify the I/O channels where your outboard is connected, and ping the hardware so that you get the correct latency compensation (TIP: if you're connecting to a compressor, bypass it for the ping to be accurate).
I'm writing another script soon to process stereo tracks through a mono unit (e.g., so that you can process a stereo mix through a mono compressor or a single Pultec). I'll share that one too.
Maybe this is useful to those of you that mix with outboard in Reaper.
I have a few outboard units, and sometimes I want to apply the same effect to a few tracks (e.g., warm up a few tracks through transformers / preamps, apply the same hardware EQ to several tracks, saturate several synths with the same settings), and this entails a lot of manual work, so I wrote a Reaper script to automate this.
To be clear, the script processes multiple tracks (individually, one by one) through a single hardware unit. You can tell the script to send a hundred tracks through a single unit, then sit back and relax (or maybe take a nap; processing 100 three-minute tracks will take 5 hours -- but you don't have to do a thing).
It works like this: You select a bunch of tracks, create a time selection, and then run the script. The script will send each one of your selected tracks through the hardware using ReaInsert and it will record the output on top of each track as a new take. You can undo the whole process if anything goes wrong.
I'm pretty happy with it, and I thought I would share it.
Before you run the script, you must create a preset in ReaInsert and name it exactly "PrintHW" (without the quotes). In this preset, you specify the I/O channels where your outboard is connected, and ping the hardware so that you get the correct latency compensation (TIP: if you're connecting to a compressor, bypass it for the ping to be accurate).
I'm writing another script soon to process stereo tracks through a mono unit (e.g., so that you can process a stereo mix through a mono compressor or a single Pultec). I'll share that one too.
-- Print to hardware script (copperx)
-- Error checking: Is there a time selection?
local s, e = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
if s == e then
reaper.ShowMessageBox("Error: Please select a time range to print to hardware.", "Print to hardware", 0)
return
end
-- Error checking: Are any tracks selected?
local n = reaper.CountSelectedTracks(0) -- how many selected tracks?
if n == 0 then
reaper.ShowMessageBox("Error: Please select at least one track to print to hardware.", "Print to hardware", 0)
return
end
reaper.ShowMessageBox("PRINTING TRACKS TO HARDWARE\n\n-- CHECKLIST --\nMake sure you have:\n\n1) set the right I/O channels and latency compensation values on ReaInsert, and\n2) that you have saved said latency compensation onto preset name \"PrintHW\".", "Print to hardware: CHECKLIST", 0)
num_tracks = reaper.CountSelectedTracks(0) -- how many selected tracks?
local ans = reaper.ShowMessageBox("Print " .. num_tracks .. " track(s) to hardware? (Remove all ReaInserts connected to your hardware!)", "Reascript", 1)
if ans == 1 then
reaper.Undo_BeginBlock() -- start undo chunk
for current_track = 0, num_tracks-1, 1 do
reaper.Main_OnCommand(1016, 1) -- stop transport
reaper.Main_OnCommand(40491, 1) -- disable arm record for all tracks
local track = reaper.GetSelectedTrack(0, current_track) -- get one track
local fxpos = reaper.TrackFX_AddByName(track, "ReaInsert", false, 1) -- add ReaInsert
local succ = reaper.TrackFX_SetPreset(track, fxpos, "PrintHW") -- set ReaInsert's preset to PrintHW
if succ == false then
reaper.ShowMessageBox("Error: You must have a ReaInsert preset named \"PrintHW\". Operation aborted.", "", 0)
return
end
reaper.SetMediaTrackInfo_Value(track, "I_RECARM", 1) -- set track to record arm
reaper.SetMediaTrackInfo_Value(track, "I_RECMODE", 5) -- set track to record output
reaper.SetMediaTrackInfo_Value(track, "I_RECMON", 1) -- input monitoring on
reaper.SetMediaTrackInfo_Value(track, "I_RECMONITEMS", 1) -- monitor items
local stop_record_end = reaper.GetToggleCommandState(41834) -- are we going to stop at the end of the loop?
if stop_record_end == 0 then
reaper.Main_OnCommand(41834, 1) -- toggle stop recording at end of loop
disable_at_end = true -- remember this so that we disable it on exit
end
start_time, end_time = reaper.GetSet_LoopTimeRange2(0, false, false, 0, 0, false) -- get time selection
reaper.SetEditCurPos(start_time, false, false) -- go to beginning of loop
-- RECORD
reaper.Main_OnCommand(1013, 1) -- start recording
local wait_command_id = reaper.NamedCommandLookup("_SWS_LOOPWAIT")
reaper.Main_OnCommand(wait_command_id,0)
reaper.Main_OnCommand(1016, 1) -- stop transport
-- END RECORD
reaper.TrackFX_Delete(track, fxpos) -- remove ReaInsert
reaper.Main_OnCommand(40491, 1) -- disable arm record for all tracks
if disable_at_end then
reaper.Main_OnCommand(41834, 1) -- toggle stop recording at end of selection
end
end
reaper.Undo_EndBlock("Print track(s) to hardware",0)
end