Re: [LAU] slowing down sysex dumps

From: Tim Goetze <tim@email-addr-hidden>
Date: Sat Feb 02 2013 - 12:41:47 EET

[Brent Busby]
> Is there anything you can do on Linux to transmit a sysex file more slowly?
> I'm not sure, but I think it may help if the data wasn't coming in so fast.

sysex files being raw data dumps and ALSA devices being accessible
through a raw file interface, this works for me:

#! /usr/bin/env python
import time,sys
midi = open(sys.argv[1],'w')
data = sys.stdin.read()
for c in data[:-1]:
        midi.write(c)
        midi.flush()
        # sleep 2 seconds after EOX, 1 ms otherwise
        time.sleep (c == "\xf7" and 2 or .001)
midi.write(data[-1])
# EOF

$ cat file.syx | theabovescript.py /dev/snd/midiCxDy

Obviously, midiCxDy needs to be replaced with the proper device path,
x and y being card number and subdevice, and you may need or want to
adjust the delay constants. Some devices need extra time to process
complete sysex bulks before being ready for the next so an extra delay
is triggered by interspersed EOX markers.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Sat Feb 2 12:15:01 2013

This archive was generated by hypermail 2.1.8 : Sat Feb 02 2013 - 12:15:01 EET