Expand description
§midi-io
A portable library for encoding, sending, decoding and streaming MIDI
§Features
- Send and receive strongly-typed MIDI 1 messages
- Async-first API with any runtime
- Receive messages as individual streams: MIDI, SysEx, backend notifications, errors
- Connection management: receive and react to connection/disconnection event notifications
§Supported Platforms
If you need a platform that isn’t yet supported, check out midir.
§Example
Connect to the first MIDI source and print every message as it arrives:
use midi_io::Client;
#[tokio::main]
async fn main() -> Result<(), midi_io::Error> {
let client = Client::new("my-app").await?;
let sources = client.sources().await?;
let source = sources.first().expect("no MIDI sources found");
let mut messages = client.connect_source(source).await?.into_messages();
while let Some(timed) = messages.recv().await {
println!("{}", timed.payload);
}
Ok(())
}See examples for more.
§Installation
cargo add midi-ioFor codec-only use, disable default features:
midi-io = { version = "0.1", default-features = false }.
§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.
Structs§
- Client
io - MIDI client for sending and receiving MIDI messages
- Data
Byte - Destination
io - A destination is a receiver of MIDI messages.
- Destination
Changes io - Destination
Connection io - Error
Stream io - Event
Stream io - Message
Stream io - Pitch
Bend - PortId
io - RawMidi
Message - An unparsed MIDI message.
- Song
Position - Source
io - A source is a sender of MIDI messages.
- Source
Changes io - Source
Connection io - Streams
io - SysEx
- Sysex
Stream io - Timed
io - Virtual
Destination io - Virtual
Source io
Enums§
- Channel
- Codec
Error - Decoded
- Destination
Change io - Indicates when available destinations have changed
- Error
- IoError
io - Midi
Message - Name
Error io - Parse
Error - Platform
Error io - Source
Change io - Indicates when available sources have changed
- SysEx
Error - Value
Error - A value outside the range representable in a MIDI message field.