From da989f0c4b522eeb45fd52099d430bcb20c929ac Mon Sep 17 00:00:00 2001 From: pepper Date: Fri, 25 Apr 2014 07:48:24 -0400 Subject: added logging, finished v1 of commandline tool --- API_NOTES | 1 - FXPS/badboy.FXP | Bin 0 -> 187581 bytes FXPS/badboy2.FXP | Bin 0 -> 188422 bytes FXPS/laserdrums.FXP | Bin 0 -> 188987 bytes FXPS/newtest.FXP | Bin 0 -> 186633 bytes FXPS/stylus_PUNCHY_lingo_dingo.FXP | Bin 0 -> 38534 bytes MIDI/Drums.mid | Bin 0 -> 4072 bytes MIDI/drum_patterns.mid | Bin 0 -> 3885 bytes MIDI/example.mid | Bin 0 -> 9283 bytes RPLS/badboy.RPL | 5860 ++++++++++++++++++++++++++++++++++++ _proj_config | 1 + add_vsti_to_midi_file.py | 47 - example.mid | Bin 9283 -> 0 bytes newtest.FXP | Bin 186633 -> 0 bytes reapify | 60 +- 15 files changed, 5910 insertions(+), 59 deletions(-) delete mode 100644 API_NOTES create mode 100644 FXPS/badboy.FXP create mode 100644 FXPS/badboy2.FXP create mode 100644 FXPS/laserdrums.FXP create mode 100644 FXPS/newtest.FXP create mode 100644 FXPS/stylus_PUNCHY_lingo_dingo.FXP create mode 100644 MIDI/Drums.mid create mode 100644 MIDI/drum_patterns.mid create mode 100644 MIDI/example.mid create mode 100644 RPLS/badboy.RPL create mode 100644 _proj_config delete mode 100644 add_vsti_to_midi_file.py delete mode 100644 example.mid delete mode 100644 newtest.FXP diff --git a/API_NOTES b/API_NOTES deleted file mode 100644 index 8b13789..0000000 --- a/API_NOTES +++ /dev/null @@ -1 +0,0 @@ - diff --git a/FXPS/badboy.FXP b/FXPS/badboy.FXP new file mode 100644 index 0000000..b75c25f Binary files /dev/null and b/FXPS/badboy.FXP differ diff --git a/FXPS/badboy2.FXP b/FXPS/badboy2.FXP new file mode 100644 index 0000000..d0d7126 Binary files /dev/null and b/FXPS/badboy2.FXP differ diff --git a/FXPS/laserdrums.FXP b/FXPS/laserdrums.FXP new file mode 100644 index 0000000..b9ed849 Binary files /dev/null and b/FXPS/laserdrums.FXP differ diff --git a/FXPS/newtest.FXP b/FXPS/newtest.FXP new file mode 100644 index 0000000..c5b0860 Binary files /dev/null and b/FXPS/newtest.FXP differ diff --git a/FXPS/stylus_PUNCHY_lingo_dingo.FXP b/FXPS/stylus_PUNCHY_lingo_dingo.FXP new file mode 100644 index 0000000..c91cdbc Binary files /dev/null and b/FXPS/stylus_PUNCHY_lingo_dingo.FXP differ diff --git a/MIDI/Drums.mid b/MIDI/Drums.mid new file mode 100644 index 0000000..1491dc8 Binary files /dev/null and b/MIDI/Drums.mid differ diff --git a/MIDI/drum_patterns.mid b/MIDI/drum_patterns.mid new file mode 100644 index 0000000..2eca345 Binary files /dev/null and b/MIDI/drum_patterns.mid differ diff --git a/MIDI/example.mid b/MIDI/example.mid new file mode 100644 index 0000000..d957434 Binary files /dev/null and b/MIDI/example.mid differ diff --git a/RPLS/badboy.RPL b/RPLS/badboy.RPL new file mode 100644 index 0000000..5053b99 --- /dev/null +++ b/RPLS/badboy.RPL @@ -0,0 +1,5860 @@ + + + + +> diff --git a/_proj_config b/_proj_config new file mode 100644 index 0000000..4086f90 --- /dev/null +++ b/_proj_config @@ -0,0 +1 @@ +midi_source ./drum_patterns.mid \ No newline at end of file diff --git a/add_vsti_to_midi_file.py b/add_vsti_to_midi_file.py deleted file mode 100644 index d028d52..0000000 --- a/add_vsti_to_midi_file.py +++ /dev/null @@ -1,47 +0,0 @@ -from subprocess import call -WORKING_DIR = '/Users/pepper/Desktop/REAPER_SCRIPTS/' -DEFAULT_MIDI_TRACK = WORKING_DIR + 'example.mid' -DEFAULT_VSTI = 'Omnisphere'; -DEFAULT_TRACK_NAME = 'last' -DEFAULT_PRESET_NAME = 'newtest' - -def console(m): - s = str(m) + '\n' - return RPR_ShowConsoleMsg(s) - -def insertMidiNewTrack(midi_file=DEFAULT_MIDI_TRACK): - return RPR_InsertMedia(midi_file, 1); - -def addVstiToTrack(track_number=0, FX=DEFAULT_VSTI): - track = RPR_GetTrack(track_number,0); - fxIdx = RPR_TrackFX_GetByName (track, FX, 1) - isOpen = RPR_TrackFX_GetOpen(track, fxIdx) - if isOpen ==0: - isOpen = 1 - else: - isOpen = 0 - RPR_TrackFX_SetOpen(track, fxIdx, isOpen) - RPR_Main_OnCommand(41749,0) #close FX dialog on track 1 - -def insertVstPreset(preset=DEFAULT_PRESET_NAME): - track = RPR_GetTrack(0,0); - fxIdx = RPR_TrackFX_GetByName (track, DEFAULT_VSTI, 1) - return RPR_TrackFX_SetPreset(track, fxIdx, preset) - -def renderAndClear(track_name=DEFAULT_TRACK_NAME): - RPR_Main_OnCommand(41824,0); #render everything - filename = "/Users/pepper/Documents/REAPER Media/%s.wav" % track_name; - call(["mv","/Users/pepper/Documents/REAPER Media/untitled.wav", filename]) - RPR_Main_OnCommand(40668,0) #delete everything - RPR_Main_OnCommand(40296,0) #select all tracks - RPR_Main_OnCommand(40005,0) #remove selected tracks from project - -def main(): - insertMidiNewTrack() - addVstiToTrack() - insertVstPreset() - renderAndClear() - -main() - - diff --git a/example.mid b/example.mid deleted file mode 100644 index d957434..0000000 Binary files a/example.mid and /dev/null differ diff --git a/newtest.FXP b/newtest.FXP deleted file mode 100644 index c5b0860..0000000 Binary files a/newtest.FXP and /dev/null differ diff --git a/reapify b/reapify index 6d69e13..8a78057 100755 --- a/reapify +++ b/reapify @@ -1,22 +1,60 @@ #!/usr/bin/python +import sys, os from subprocess import call, Popen from simpleOSC import * import socket -#make sure reaper is running -check = call([ 'pgrep', 'REAPER' ]); -if check: - Popen(['/Applications/REAPER64.app/Contents/MacOS/REAPER']) +REAPER_ARGUMENTS_FILE = '_proj_config' +def setUpArgumentsFile(): + previous_arguments = 0; + if os.path.exists(REAPER_ARGUMENTS_FILE): #load file contents into hash + f = open(REAPER_ARGUMENTS_FILE, 'r'); + lines = f.readlines(); + for line in lines: + parts = line.split("\t"); + previous_arguments[parts[0]] = parts[1]; + f.close(REAPER_ARGUMENTS_FILE); + return previous_arguments + -ip_address = socket.gethostbyname(socket.gethostname()) -#start the client -initOSCClient(ip_address, 8088) -#start the server to receive messages (not yet implemented) -initOSCServer(ip_address, 8808) +def writeArgumentsFile(reaper_arguments): + f = open(REAPER_ARGUMENTS_FILE, 'w'); + for i in reaper_arguments.keys(): + f.write("%s\t%s" % (i, reaper_arguments[i])); + f.close(); -#run main.py -sendOSCMsg("/action/41061") +def getCommandlineArgs(): + reaper_args = {}; + if len(sys.argv) == 1: + return + else: + midi_file_to_process = os.path.join(os.path.curdir, sys.argv[1]); + if not os.path.exists(midi_file_to_process): + print "please specify full path as argument" + reaper_args = {"midi_source" : midi_file_to_process}; + writeArgumentsFile(reaper_args); +def main(): + getCommandlineArgs(); #process commandline args + + #make sure reaper is running + check = call([ 'pgrep', 'REAPER' ]); + if check: + Popen(['/Applications/REAPER64.app/Contents/MacOS/REAPER']) + + + + + ip_address = socket.gethostbyname(socket.gethostname()) + #start the client + initOSCClient(ip_address, 8088) + #start the server to receive messages (not yet implemented) + initOSCServer(ip_address, 8808) + + #run main.py + sendOSCMsg("/action/41061") + +main(); -- cgit v1.2.3-70-g09d2