Crate nodi[][src]

Expand description

This crate provides types and functions for abstracting MIDI files.

This crate works alongside with the midly and midir crates. However you can implement your own Connection, instead of using midir.

A Basic Workflow

  • Use midly to parse a MIDI file.
  • Create a Timer from the header.
  • Create a Sheet from the parsed tracks.
  • Initialize a MIDI connection using midir.
  • Create a Player from the connection and the timer.
  • Play the sheet using the player.

Examples

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.

Debugging

Nodi uses the log crate for the logging; you can use a compatible logger for consumption.

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.
  • jack: Same with midir but uses the Jack backend.
  • winrt: Same with midir but uses the WinRT backend.
  • verbose-log: Enables more logging, not recommended unless you really want to see the Ticker tick.

Modules

Various Timer implementations.

Structs

An iterator over bars in a MIDI Sheet.

Represents a MIDI message. An instance of this type can sometimes be converted from a TrackEventKind with the TryFrom trait. This type can be fed to a synthesizer.

A type that orchestrates playing of MIDI tracks.

Holds every moment in a MIDI track, each moment representing a MIDI tick.

Enums

Represents a single MIDI event.

Represents a single moment (tick) in a MIDI track.

Traits

Any type that can play sound, given a MidiEvent.

Used for timing MIDI playback.