Skip to content

Instantly share code, notes, and snippets.

@andrewyager
Last active October 12, 2019 01:21
Show Gist options
  • Save andrewyager/247622914ceff74c07c6451acbb44eaf to your computer and use it in GitHub Desktop.
Save andrewyager/247622914ceff74c07c6451acbb44eaf to your computer and use it in GitHub Desktop.
Generate multiple Reaper Tracks lazily
#!/usr/bin/python
"""
Ever wanted to record audio using Dante Virtual Soundcard in Reaper?
Wanted to set up a project with 64 tracks, mapped to each of the 64 inputs
and also to the 64 Dante outputs?
Thought that it would take too long by hand?
This script generates the XML for 64 tracks with output maps suitable
for use in this application. IT's not a whole Reaper Project file, but rather
the "track" definitions which you can copy/paste into a reaper file.
Creative Commons Attribution License or something if you care.
Written by Andrew Yager October 2019
"""
import uuid
offset = 0
while offset<64:
uuid_1="{"+str(uuid.uuid4()).upper()+"}"
uuid_2="{"+str(uuid.uuid4()).upper()+"}"
track_id = offset
track_id_2 = offset + 1
output = """
<TRACK {uuid_1}
NAME ""
PEAKCOL 16576
BEAT -1
AUTOMODE 0
VOLPAN 1 0 -1 -1 1
MUTESOLO 0 0 0
IPHASE 0
ISBUS 0 0
BUSCOMP 0 0
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
FREEMODE 0
SEL 0
REC 0 {track_id} 0 0 0 0 0
VU 2
TRACKHEIGHT 0 0 0
INQ 0 0 0 0.5 100 0 0 100
NCHAN 2
FX 1
TRACKID {uuid_1}
PERF 0
MIDIOUT -1
MAINSEND 1 0
HWOUT {offset} 0 1 -1 0 0 0 -1:U -1
<FXCHAIN
WNDRECT 32 608 724 387
SHOW 0
LASTSEL 0
DOCKED 0
>
>
<TRACK {uuid_2}
NAME ""
PEAKCOL 16576
BEAT -1
AUTOMODE 0
VOLPAN 1 0 -1 -1 1
MUTESOLO 0 0 0
IPHASE 0
ISBUS 0 0
BUSCOMP 0 0
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
FREEMODE 0
SEL 0
REC 0 {track_id_2} 0 0 0 0 0
VU 2
TRACKHEIGHT 0 0 0
INQ 0 0 0 0.5 100 0 0 100
NCHAN 2
FX 1
TRACKID {uuid_2}
PERF 0
MIDIOUT -1
MAINSEND 1 0
HWOUT {offset} 0 1 1 0 0 0 -1:U -1
>""".format(uuid_1=uuid_1, uuid_2=uuid_2, track_id=track_id, track_id_2=track_id_2, offset=offset)
print(output)
offset = offset + 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment