18 releases

Uses old Rust 2015

0.2.6 May 12, 2022
0.2.5 Aug 21, 2020
0.2.4 Jan 4, 2017
0.2.3 Aug 8, 2016
0.1.0 Feb 28, 2015

#37 in Audio

Download history 59/week @ 2022-01-28 42/week @ 2022-02-04 28/week @ 2022-02-11 56/week @ 2022-02-18 60/week @ 2022-02-25 38/week @ 2022-03-04 75/week @ 2022-03-11 92/week @ 2022-03-18 30/week @ 2022-03-25 51/week @ 2022-04-01 63/week @ 2022-04-08 56/week @ 2022-04-15 75/week @ 2022-04-22 186/week @ 2022-04-29 151/week @ 2022-05-06 346/week @ 2022-05-13

767 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

29KB
592 lines

portmidi-rs

Build Status Documentation

High-level PortMidi bindings for Rust.

PortMidi website: http://portmedia.sourceforge.net/portmidi/

Installation

Add this to your Cargo.toml.

[dependencies]
portmidi = "^0.2"

Prerequisites

You need to make sure you have the PortMidi library installed.

On Ubuntu / Debian:

apt-get install libportmidi-dev

Arch Linux:

pacman -S portmidi

On OSX (Homebrew):

brew install portmidi

On OSX, if you get a linker error ld: library not found for -lportmidi, either,

  • make sure you have the Xcode Command Line Tools installed, not just Xcode, or

  • make sure you have the PortMidi library in your $LIBRARY_PATH, e.g. for Homebrew:

    export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"
    

Examples

Examples can be run by cloning the repository and running cargo run --example <example name>.

  • play: demonstrates midi output by playing Twinkle Twinkle Little Star (forever...)
  • monitor: demonstrate midi input
  • monitor-all: listens on all-input devices and uses threads and channels

Example: cargo run --example play -- 1 --verbose

Both play and monitor need a device number supplied, run them without an argument to get a list of the connected devices, e.g.

License

Licensed under either of

Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps