Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Syntax for sending a MIDI sysex

General discussion about anything TouchDesigner

Syntax for sending a MIDI sysex

Postby archo-p » Mon Aug 07, 2017 8:45 pm

Hey Folks!

So I've got this lovely APC40 mkii that I'd like to put into Ableton User Mode1, as opposed to the User Mode 0 that it starts in when Ableton isn't running and connected to the device on start. This can be achieved by opening Bomes SendSX ( https://www.bome.com/products/sendsx ) copying this string :

F0 47 00 29 60 00 04 41 08 04 01 F7

into the outgoing area and pressing "send", works great, but obviously not as ideal as just opening my TD system and having it send that automatically. The 41 is the code for user mode 1 ( 40, 41 and 42 being the 3 modes)

So, I noodled around with the python sendExclusive method of the midiOutCHOP but I can't seem to understand the format needed to send. it seems like i need to take the F0 and F7 hex codes, and send them as the start and end bytes of the message ( 0xF0 and 0xF7), and then encode the rest of the hex into a string as the "message" but having a hard time parsing that out. I think I don't quite get the hex > bytes > string process...

Here is the script I have right now to try this, but no luck right now, can anyone advise?:

Code: Select all
import binascii
m = op('midiout1')

startByte = 0xF0
endByte = 0xF7
msgHex = '47002960000441080401'
msgBytes = bytes.fromhex(msgHex)
msgString = msgBytes.decode('utf-8')

m.sendExclusive(startByte, msgString, endByte)

print(startByte, endByte)
print(msgString)
User avatar
archo-p
 
Posts: 468
Joined: Thu Nov 19, 2009 3:03 pm
Location: Los Angeles

Re: Syntax for sending a MIDI sysex

Postby Peeet » Tue Aug 08, 2017 6:51 am

m.sendExclusive() already tacks the F0 and F7 onto the beginning and ends of your messages, so you don't need to include startByte and endByte; or you can keep the start and end byte stuff and just use m.send() instead of m.sendExclusive() if you want.
Peeet
 
Posts: 135
Joined: Fri Apr 08, 2011 4:28 am
Location: Los Angeles

Re: Syntax for sending a MIDI sysex

Postby boompje » Sat Oct 14, 2017 5:07 am

For anyone wanting to play around with the apc40 mkII. Here is a small script to toggle different modes :

Code: Select all
m = op("midiout1")
mode = 1

if mode == 0:
   ### standard ableton mode
   m.sendExclusive(71, 1, 41, 96, 0, 4, 64, 8, 2, 7)
elif mode == 1:
   ### control over buttons / automated knobs
   m.sendExclusive(71, 1, 41, 96, 0, 4, 65, 8, 2, 7)
elif mode == 2:
   ### full control
   m.sendExclusive(71, 1, 41, 96, 0, 4, 66, 8, 2, 7)
__
Roy.
boompje
 
Posts: 22
Joined: Fri Aug 24, 2012 10:23 am

Re: Syntax for sending a MIDI sysex

Postby why » Sun Jun 09, 2019 1:31 am

Nice! This helped me out.
gregfinger.github.io
why
 
Posts: 58
Joined: Mon Apr 27, 2015 3:14 pm


Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: Bing [Bot] and 24 guests