Loading player_functions.py +6 −0 Original line number Diff line number Diff line Loading @@ -32,10 +32,14 @@ def updateDisplay(message): def resetDevice(device_id,mode='GS'): fn_prefix="player_functions.py/resetDevice" if(mode=="GM"): statusmsg=f"Performing GM Reset" updateDisplay(str.encode(statusmsg)) # send the sysex command for a GM Start to the synth using amidi subprocess.run(['amidi','-p',device_id,'-S','F07E7F0901F7']) print(fn_prefix+":Reset device to GM Mode") elif mode=="GS": statusmsg=f"Performing GS Reset" updateDisplay(str.encode(statusmsg)) # send the sysex command for a GS Reset to the synth using amidi subprocess.run(['amidi','-p',device_id,'-S','F04110421240007F0041F7']) print(fn_prefix+": Reset device to GS Mode") Loading Loading @@ -70,6 +74,8 @@ def playTrack(track_path,port): # or a finished track, terminate the subprocess if it hasn't already been proc.terminate() print(fn_prefix+": Recieved stop command") statusmsg=f"Stopped: Finished playing" updateDisplay(str.encode(statusmsg)) # send a GS reset to the synth resetDevice(findAMIDIDevice(),"GS") return Loading Loading
player_functions.py +6 −0 Original line number Diff line number Diff line Loading @@ -32,10 +32,14 @@ def updateDisplay(message): def resetDevice(device_id,mode='GS'): fn_prefix="player_functions.py/resetDevice" if(mode=="GM"): statusmsg=f"Performing GM Reset" updateDisplay(str.encode(statusmsg)) # send the sysex command for a GM Start to the synth using amidi subprocess.run(['amidi','-p',device_id,'-S','F07E7F0901F7']) print(fn_prefix+":Reset device to GM Mode") elif mode=="GS": statusmsg=f"Performing GS Reset" updateDisplay(str.encode(statusmsg)) # send the sysex command for a GS Reset to the synth using amidi subprocess.run(['amidi','-p',device_id,'-S','F04110421240007F0041F7']) print(fn_prefix+": Reset device to GS Mode") Loading Loading @@ -70,6 +74,8 @@ def playTrack(track_path,port): # or a finished track, terminate the subprocess if it hasn't already been proc.terminate() print(fn_prefix+": Recieved stop command") statusmsg=f"Stopped: Finished playing" updateDisplay(str.encode(statusmsg)) # send a GS reset to the synth resetDevice(findAMIDIDevice(),"GS") return Loading