Python script to start Live + ReWired Reason

Share your favorite Ableton Live tips, tricks, and techniques.
Post Reply
rasputin
Posts: 645
Joined: Wed Mar 19, 2003 10:16 pm
Location: San Diego, California, USA
Contact:

Python script to start Live + ReWired Reason

Post by rasputin » 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.
Live 9.1 <> occasionally Reason 4.0.1 <> Reaper.latest! <> Windows 7 on a bespoke Intel Q6600 <> ASUS P5E <> 8GB RAM, M-Audio Delta 2496 and that's it.

rasputin
Posts: 645
Joined: Wed Mar 19, 2003 10:16 pm
Location: San Diego, California, USA
Contact:

Re: Python script to start Live + ReWired Reason

Post by rasputin » Tue Aug 23, 2011 12:46 am

Here's a simpler way.

Code: Select all

# Do this is the simplest possible way. Using subprocess didn't
#   do anything special for me.
#
import os, time, datetime
#
ciw=r"C:\Documents and Settings\............\Project\\"
#
song_name = "Song_name"
live_set = song_name+".als"
reason_set = song_name+".rns"
print "launching Live set", live_set
os.chdir(ciw)
os.startfile (live_set)
#
time.sleep(10)
print "launching Reason", reason_set
os.startfile (reason_set)
Live 9.1 <> occasionally Reason 4.0.1 <> Reaper.latest! <> Windows 7 on a bespoke Intel Q6600 <> ASUS P5E <> 8GB RAM, M-Audio Delta 2496 and that's it.

Post Reply