Python script to start Live + ReWired Reason
Posted: Sun Aug 14, 2011 11:28 pm
I have a number of Live sets that use Reason synths. I got tired of having to launch Live then Reason separately (although it's not as if that's a huge effort). So I wrote a very Q&D Python script to do it.
# --- start ---
import os, time, subprocess, datetime
#
ciw=(r"C:\Documents and Settings\.......\1 music\Afrikoan Project\\")
progfiles=r"C:\Program Files\\"
live_app = progfiles + r"Ableton\Live 8.2.2\Program\Live 8.2.2.exe"
reason_app = progfiles + r"Propellerhead\Reason\Reason.exe"
#
song_name = "Afrikoan"
live_set = song_name+".als"
reason_set = song_name+".rns"
print "launch Live", live_app, live_set
#
LiveProc = subprocess.Popen([live_app, ciw+live_set], cwd=ciw)
print "Live startup status = ", LiveProc.pid
#
time.sleep(15)
print "launch Reason", reason_app, reason_set
RsnProc = subprocess.Popen([reason_app, reason_set], cwd=ciw)
print "Reason startup status = ", RsnProc.pid
#
# give ourselves a few seconds to observe the log window
# before it goes away...
time.sleep(7)
# --- end ---
The first (15 sec) delay waits while Live opens then starts
Reason. Remember you're supposed to start the ReWired app
AFTER the ReWire master. Ideally I would somehow detect that
the Live set is completely open and then Popen Reason, but
I don't know how to do that.
The other weird thing is that even if I have the Live set
maximized when I close it, when it reopens using this script
it resizes to some small window size like 640x480. It doesn't
seem to matter whether I chdir the script to the folder the
als lives in or not.
Using Python 2.7 on Windows XP. If you find it useful,
great; if you have a better way I would really love to see
it...this is a bit kludgey.
Cheers,
r.
# --- start ---
import os, time, subprocess, datetime
#
ciw=(r"C:\Documents and Settings\.......\1 music\Afrikoan Project\\")
progfiles=r"C:\Program Files\\"
live_app = progfiles + r"Ableton\Live 8.2.2\Program\Live 8.2.2.exe"
reason_app = progfiles + r"Propellerhead\Reason\Reason.exe"
#
song_name = "Afrikoan"
live_set = song_name+".als"
reason_set = song_name+".rns"
print "launch Live", live_app, live_set
#
LiveProc = subprocess.Popen([live_app, ciw+live_set], cwd=ciw)
print "Live startup status = ", LiveProc.pid
#
time.sleep(15)
print "launch Reason", reason_app, reason_set
RsnProc = subprocess.Popen([reason_app, reason_set], cwd=ciw)
print "Reason startup status = ", RsnProc.pid
#
# give ourselves a few seconds to observe the log window
# before it goes away...
time.sleep(7)
# --- end ---
The first (15 sec) delay waits while Live opens then starts
Reason. Remember you're supposed to start the ReWired app
AFTER the ReWire master. Ideally I would somehow detect that
the Live set is completely open and then Popen Reason, but
I don't know how to do that.
The other weird thing is that even if I have the Live set
maximized when I close it, when it reopens using this script
it resizes to some small window size like 640x480. It doesn't
seem to matter whether I chdir the script to the folder the
als lives in or not.
Using Python 2.7 on Windows XP. If you find it useful,
great; if you have a better way I would really love to see
it...this is a bit kludgey.
Cheers,
r.