9 unstable releases (3 breaking)
Uses new Rust 2024
| 0.4.4 | Jul 25, 2025 |
|---|---|
| 0.4.3 | Jul 25, 2025 |
| 0.3.0 | May 23, 2025 |
| 0.2.1 | May 21, 2025 |
| 0.1.0 | May 20, 2025 |
#1208 in Audio
503 downloads per month
110KB
2.5K
SLoC
rtpmidi
This provides functions for working with RTP-MIDI in Rust.
Usage
let port = 5004_u16;
let ssrc = 123456_u32;
let session = RtpMidiSession::start(port, "My Session", ssrc, InviteResponder::Accept); // you can choose to accept all invitations, none, or supply a custom handler
// Wait for midi commands
session
.add_listener(RtpMidiEventType::MidiPacket, move |data| {
for command in data.commands() {
event!(Level::INFO, "Received command: {:?}", command);
}
})
.await;
// invite another participant to the session
let addr = SocketAddr::new("192.168.0.1".parse().unwrap(), 5006);
let _ = invite_server.invite_participant(addr).await.unwrap();
// send MIDI commands
let command = MidiCommand::NoteOn {
channel: 1,
key: 64,
velocity: 127,
};
session.send_midi(command).await.unwrap();
See the Examples directory for more examples.
Installation
cargo add rtpmidi
Status
Supported:
- Responding to invitations
- Inviting others
- Advertising via MDNS / Bonjour (optional - enable the 'mdns' feature for this)
- SysEx
Not supported:
- Recovery journal
Dependencies
~9–24MB
~212K SLoC