krevis / MIDIApps

MIDI apps for Mac OS X: MIDI Monitor and SysEx Librarian.
http://www.snoize.com/
BSD 3-Clause "New" or "Revised" License
714 stars 112 forks source link

Support command line or scripting with AppleScript/Automator actions #100

Open mmontag opened 2 years ago

mmontag commented 2 years ago

I would like to use Sysex Librarian to transmit a file during a build step.

Maybe Sysex Librarian is the wrong tool for this, but I haven't found a command line tool (such as sendmidi) that supports nice throttling features like Sysex Librarian.

It would be cool if there were either 1) a command line version of Sysex Librarian, or 2) support for Automator Actions.

krevis commented 2 years ago

It's unlikely I will make a command-line version, since sendmidi already exists, and looks pretty complete. Sorry.

(I could definitely look into Automator, though.)

There might be a workaround. In theory, when you set a port's sysex transmit speed using SysEx Librarian's preferences, that will apply to any app that sends sysex using the CoreMIDI MIDISendSysex function.

I don't know whether sendmidi uses that function, though. Would have to dig through its code (and any libraries like JUCE that it uses) to find out.

Or, you could try it. What happens if you set the speed using SEL, say to a really slow speed, and then use sendmidi to send a file? Is it any slower?

(Also, are you sure you actually need the throttling? It's the year 2022, and any reasonable MIDI interface and device should be able to handle full-speed sysex transmission. Or so I'd hope.)

mmontag commented 2 years ago

Interesting... just tried it, changing the speed in SEL doesn't affect sendmidi behavior. Sendmidi is also weird in that it doesn't show a progress bar but immediately terminates. I set the speed to 20% in Sysex Librarian. I'm sending a 120 KB sysex file; the MIDI activity continues after the sendmidi exits for about 19 seconds.

I think my device at least needs a small delay between messages. In any case, the transfer from sendmidi is not working.

krevis commented 2 years ago

Hmmm. Napkin math:

Not sure why it's only taking half of that time!

krevis commented 2 years ago

(But thanks for running the experiment.)

mmontag commented 2 years ago

It looks like JUCE doesn't make use of the MIDISendSysex function (see also juce_mac_CoreMidi.mm). It does use MIDISend and MIDISendEventList. Would this explain why the system-wide transmit speed is being ignored?

krevis commented 2 years ago

Yes, exactly.