#midi #music #smf #encoding


A library for playback and abstraction of MIDI files

31 releases (1 stable)

1.0.0 Jan 7, 2024
0.19.2 Jun 13, 2022
0.18.1 Jun 8, 2022
0.14.0 Mar 31, 2022
0.13.2 Oct 18, 2021

#119 in Audio

Download history 32/week @ 2024-02-26 3/week @ 2024-03-04 7/week @ 2024-03-11 71/week @ 2024-04-01 44/week @ 2024-05-20 16/week @ 2024-05-27 20/week @ 2024-06-03

80 downloads per month
Used in 3 crates

MIT license

697 lines


Build Status crates.io docs.rs

Nodi provides types and functions for playback and abstraction of MIDI files.

This crate works alongside the midly and midir crates. However you can implement your own MIDI player, instead of relying on midir.


  • Time-map MIDI events.
  • Join or merge multiple MIDI tracks.
  • Play MIDI files.
  • Split a MIDI track into measures/bars.
  • Transpose a track.


Check out /examples/play_midi.rs for a basic midi player.

I started developping this crate because I needed the features it now offers. Here are some real-world examples of nodi in action:

  • midnote: An accessible MIDI note viewer/ player.
  • plmidi: A MIDI player for the command line.

Crate Features

Features enabled by default:

  • hybrid-sleep: A more accurate sleep, mixing regular sleep with spin locking efficiently. With this feature enabled the default implementations of timers in this crate will use this. Highly recommended for Windows users but it may also increase timing on other platforms.

Optional features:

  • midir: Adds implementations of Connection for midir::MidiOutputConnection.
  • midir-jack: Same with midir but uses the Jack backend.
  • midir-winrt: Same with midir but uses the WinRT backend.


~338K SLoC