Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

midi-communications-macos

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midi-communications-macos

  • 0.5.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

MIDI Communications MacOS Layer

Realtime MIDI IO with Ruby for OSX.

Access the Apple Core MIDI framework API with Ruby.

This library is part of a suite of Ruby libraries for MIDI:

FunctionLibrary
MIDI Events representationMIDI Events
MIDI Data parsingMIDI Parser
MIDI communication with Instruments and Control SurfacesMIDI Communications
Low level MIDI interface to MacOSMIDI Communications MacOS Layer
Low level MIDI interface to LinuxTO DO (by now MIDI Communications uses alsa-rawmidi)
Low level MIDI interface to JRubyTO DO (by now MIDI Communications uses midi-jruby)
Low level MIDI interface to WindowsTO DO (by now MIDI Communications uses midi-winm)

This library is based on Ari Russo's library ffi-coremidi.

Features

  • Simplified API
  • Input and output on multiple devices concurrently
  • Generalized handling of different MIDI Message types (including SysEx)
  • Timestamped input events
  • Patch MIDI via software to other programs using IAC
  • No events history and no buffers optimization

Requirements

Installation

If you're using Bundler, add this line to your application's Gemfile:

gem "midi-communications-macos"

Otherwise

gem install midi-communications-macos

Documentation

(TO DO) rdoc

Differences between MIDI Communications MacOS Layer library and ffi-coremidi library

MIDI Communications MacOS Layer is mostly a clone of ffi-coremidi with some modifications:

  • Added locking behaviour when waiting midi events
  • Removed buffering and process history information logging (to reduce CPU usage in some scenarios)
  • Improved MIDI devices name detection
  • Source updated to Ruby 2.7 code conventions (method keyword parameters instead of options = {}, hash keys as 'key:' instead of ':key =>', etc.)
  • Updated dependencies versions
  • Renamed module to MIDICommunicationsMacOS instead of CoreMIDI
  • Renamed gem to midi-communications-macos instead of ffi-coremidi
  • TODO: update tests to use rspec instead of rake
  • TODO: migrate to (or confirm it's working ok on) Ruby 3.0 and Ruby 3.1

Then, why does exist this library if it is mostly a clone of another library?

The author has been developing since 2016 a Ruby project called Musa DSL that needs a way of representing MIDI Events and a way of communicating with MIDI Instruments and MIDI Control Surfaces.

Ari Russo has done a great job creating several interdependent Ruby libraries that allow MIDI Events representation (MIDI Message and Nibbler) and communication with MIDI Instruments and MIDI Control Surfaces (unimidi, ffi-coremidi and others) that, with some modifications, I've been using in MusaDSL.

After thinking about the best approach to publish MusaDSL I've decided to publish my own renamed version of the modified dependencies because:

  • The original libraries have features (buffering, very detailed logging and processing history information, not locking behaviour when waiting input midi messages) that are not needed in MusaDSL and, in fact, can degrade the performance on some use cases in MusaDSL.
  • The requirements for Musa DSL users probably will evolve in time, so it will be easier to maintain an independent source code base.
  • Some differences on the approach of the modifications vs the original library doesn't allow to merge the modifications on the original libraries.
  • Then the renaming of the libraries is needed to avoid confusing existent users of the original libraries.
  • Due to some of the interdependencies of Ari Russo libraries, the modification and renaming on some of the low level libraries (ffi-coremidi, etc.) forces to modify and rename unimidi library.

All in all I have decided to publish a suite of libraries optimized for MusaDSL use case that also can be used by other people in their projects.

FunctionLibraryBased on Ari Russo'sDifference
MIDI Events representationMIDI EventsMIDI Messageremoved parsing, small improvements
MIDI Data parsingMIDI ParserNibblerremoved process history information, minor optimizations
MIDI communication with Instruments and Control SurfacesMIDI Communicationsunimidiuse of [MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos, removed process history information, removed buffering, removed command line script)
Low level MIDI interface to MacOSMIDI Communications MacOS Layerffi-coremidiremoved buffering and process history information, locking behaviour when waiting midi events, improved midi devices name detection, minor optimizations
Low level MIDI interface to LinuxTO DO
Low level MIDI interface to JRubyTO DO
Low level MIDI interface to WindowsTO DO

Author

Acknowledgements

Thanks to Ari Russo for his ruby library ffi-coremidi licensed under Apache License 2.0.

As explained by Ari Russo regarding his library ffi-coremidi:

  • ffi-coremidi began with some coremidi/ffi binding code for MIDI output by Colin Harris contained in his fork of MIDIator and a blog post.
  • MIDIator is (c)2008 by Ben Bleything and Topher Cyll and released under the MIT license (see LICENSE.midiator and LICENSE.prp)
  • Also thank you to Jeremy Voorhis for some useful debugging.

License

MIDI Communicatios MacOS Layer Copyright (c) 2021-2023 Javier Sánchez Yeste, licensed under LGPL 3.0 License

ffi-coremidi Copyright (c) 2011-2017 Ari Russo, licensed under Apache License 2.0 (see the file LICENSE.ffi-coremidi)

FAQs

Package last updated on 28 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc