Reading a binary sysex file and sending to midiout

Carl Cregor's icon

Can someone point me in the right direction or help out with how to read a binary .syx file?
I've tried mixtures of filein, text, seq, etc... with no love. I'm sure this is possible. Searching forums and docs/lessons I'm not finding what I'm looking for. I've checked out existing patches with syx file load features, but want to avoid getting into javascript if at all possible. Is this possible with just native Max?

The sysex files are binary, they contain multiple F0....F7 messages on one big 'ol line. Ideally I'd love to load up umenu with my folder of sysex files and feed the picked patch from that to something that reads the file and sends right to midiout.

Source Audio's icon

filein object can read and output contents of binary file.

Max Patch
Copy patch and select New From Clipboard in Max.

Carl Cregor's icon

Counter and metro! Thanks!!! This is what I need to get going :)
Now to figure out how to split out the f0....f7 messages. Seems that when loaded in Ableton this isn't the happiest. Altering the metro time seems to help, but I think that may be dependent on the buffer?
So current thought is to divide each sysex message into individual messages and send to midiout one-after-the-other

Source Audio's icon

You can try to pause the metro after each 247
for a short time.
Most sysex apps offer pause between messages,
and to slow down transmission speed.

Max Patch
Copy patch and select New From Clipboard in Max.

Carl Cregor's icon

You da greatest! Still had a few issues with timing, so went back to converting to text before midiout. But it's working now and working beautifully! Gonna play with how much I can lower the time. Here is the completed rough sysex patch loader :)

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

I am not at all convinced with the patch you posted.
dumping text outputs faster than midi allows quite sure.
And don't forget - text dumps a list the way you feed it.
Midiout iters the list, otherwise it would not work.
But with large sysex message you might overload
midi alltogether, and break the communication.

also pipe 10 is probably too short as pause between individual sysex messages.
I would leave the patch I posted as is, just adjust metro and pipe time
to safe values which allways work for sysex dump.
---------
But if by some miracle text dumpout and midiout manage to transfer
the sysex messages you use at acceptable speed for midi output,
you can speed up the metro or even use uzi,
because in the last patch you posted metro speed plays no role,
and you can speed up transfer from filein into text object.
and add more pause between sysex messages.
-------
At the end I'd say if it works for you, all ok, but I would not post this as
solution for bin sysex to midi out, because it could not work for someone else,
or even do some harm to midi devices that receive sysex.