Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mmontag opened this issue Feb 6, 2022 · 6 comments
Open

Comments

@mmontag
Copy link

mmontag commented Feb 6, 2022

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
Copy link
Owner

krevis commented Feb 6, 2022

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
Copy link
Author

mmontag commented Feb 6, 2022

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
Copy link
Owner

krevis commented Feb 6, 2022

Hmmm. Napkin math:

  • 120 KB = 122880 bytes
  • MIDI transmits at 3125 bytes / second
  • It should take 122880 / 3125 = 39.3 seconds at full speed.

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

@krevis
Copy link
Owner

krevis commented Feb 6, 2022

(But thanks for running the experiment.)

@mmontag
Copy link
Author

mmontag commented Feb 6, 2022

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
Copy link
Owner

krevis commented Feb 6, 2022

Yes, exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants