Cockos Reaper “A/B Switcher” for Mastering Purposes

Everybody involved into mastering audio knows how important A/B track referencing is. Thus said, there are various techniques and setups depending on your DAW and studio hardware. Some people use hardware monitor controller systems which provide input switching, some use DAW internal switching methods, other people control their DAC/Soundcard directly via midi, and so on. There are cheap and very expensive solutions and the sky is the limit. Anyway, this article describes a flexible and cheap way to achieve A/B/C track referencing using just Cockos Reaper DAW and a standard external midi controller.

The principle is simple:

  • midi ctrl button A mutes all reference tracks, unsolos original track and starts playback: original track is hearable
  • midi ctrl button B solos reference track 1, unsolos all other tracks and starts playback: reference track 1 is hearable
  • midi ctrl button C solos reference track 2, unsolos all other tracks and starts playback: reference track 2 is hearable

Installation (Windows Version, but Mac should be similar ?):

  • Create three tracks in Reaper
  • Track “A”: the track you’re working on
  • Track “RF1”: the first reference track (must be named RF1 !)
  • Track “RF2”: the second reference track (must be named RF2 !)
  • Download Python and register python3x.dll in Reaper preferences. Hint: if it doesn’t work try to run Reaper as Administrator !
  • Save the attached Python scripts as play_not.py and play_rf1.py to a folder on your system. Best folder is the REAPER/scripts folder in your Windows profile
  • Copy play_rf1.py to play_rf2.py
  • Open Reaper Actions dialog and click on “ReaScript New/Load”. This creates a new Custom action. Open play_not.py
  • Do the same for play_rf1.py and play_rf2.py
  • Select the Costum action for play_rf2.py and click on “ReaScript Edit”. Edit line “refsig=”RF1” into “refsig=”RF2”
  • Assign the new three Custom actions to you favorite midi buttons or keyboard keys
  • Have fun and modify as you like.

HINT: it’s possible to add more reference tracks. Just create a new play_rfX.py Custom action for each reference track. Also it’s worthwile to mention that it’s possible to use e.g. the “RF1” track name for other tracks, too. In this case these tracks will be treated like reference track 1.

# Mute and unsolo all reference Tracks
# (C) Airmann 2/2013

refsig = "RF"
debug = False

# Unsolo all tracks
RPR_Main_OnCommand(40340, 0)

# iterate over all tracks and find reference track signature
numTracks = RPR_CountTracks(0)
i = 0
mute = 0.0
for i in range (0, numTracks): 

	# get track attributes
	tr = RPR_GetTrack(0,i) # 0 is current project !?
	name = RPR_GetSetMediaTrackInfo_String(tr, "P_NAME","", False)[3]	
	mute = RPR_GetMediaTrackInfo_Value(tr, "B_MUTE")

	if debug :
		RPR_ShowConsoleMsg("Name: "+name+"  MUTE: "+str(mute)+"\n")

	start = name[:2]

	if start == refsig:

		if debug :
			RPR_ShowConsoleMsg("FOUND SIGNATURE\n")

		# Switch Mute On
		if mute != 49.0 :  # why 49 ?
			if debug :           
				RPR_ShowConsoleMsg("MUTE ON\n")
			RPR_GetSetMediaTrackInfo_String(tr,"B_MUTE","1",True)				

	i += 1

# Play
RPR_Main_OnCommand(1007, 0)
# Play Reference Track 1
# (C) Airmann 2/2013

# reference Start Signature. Hint: length must be 3 chars. 
# Multiple tracks using signature are allowed (grouping)
refsig = "RF1"   
debug = False

# Unsolo all tracks
RPR_Main_OnCommand(40340, 0)

# iterate over all tracks and find reference track signature
numTracks = RPR_CountTracks(0)
i = 0
solo = 0.0
mute = 0.0
for i in range (0, numTracks): 

	# get track attributes
	tr = RPR_GetTrack(0,i) # 0 is current project !?
	name = RPR_GetSetMediaTrackInfo_String(tr, "P_NAME","", False)[3]
	solo = RPR_GetMediaTrackInfo_Value(tr, "I_SOLO")
	mute = RPR_GetMediaTrackInfo_Value(tr, "B_MUTE")

	if debug :
		RPR_ShowConsoleMsg("Name: "+name+" SOLO:"+str(solo)+"  MUTE: "+str(mute)+"\n")

	start = name[:3]
	if start == refsig : # Valid Signature ?	
		if debug :
			RPR_ShowConsoleMsg("VALID SIGNATURE: "+start+"\n")

		# Switch Mute On
		if mute != 49.0 :  # why 49 ?
			if debug :           
				RPR_ShowConsoleMsg("MUTE ON\n")
			RPR_GetSetMediaTrackInfo_String(tr,"B_MUTE","1",True)

		# Switch To Solo
		if solo != 50.0 : # why 50 ?
			if debug :
				RPR_ShowConsoleMsg("SOLO ON\n ")
			RPR_GetSetMediaTrackInfo_String(tr,"I_SOLO","2.0",True)							

	i += 1

# Play
RPR_Main_OnCommand(1007, 0)
This entry was posted in Production, Software. Bookmark the permalink.

One Response to Cockos Reaper “A/B Switcher” for Mastering Purposes

Leave a Reply

Your email address will not be published.