midi_file 0.2.0

For reading and writing MIDI files.
Documentation
clamp!(
    /// Represents the MIDI channel. The minimum value is `0`, the maximum value is `15`. This type
    /// will clamp values to the valid range.
    Channel,
    u8,
    0,
    15,
    0,
    pub
);

clamp!(
    /// Represents the MIDI note number (`C4` is `60`, for example). The minimum value is `0`,
    /// the maximum value is `127` (i.e. `u7`). This type will clamp values to the valid range.
    NoteNumber,
    u8,
    0,
    127,
    60,
    pub
);

clamp!(
    /// Represents the MIDI velocity. The minimum value is `0`, the maximum value is `127` (i.e.
    /// `u7`). This type will clamp values to the valid range.
    Velocity,
    u8,
    0,
    127,
    72,
    pub
);

clamp!(
    /// Represents the MIDI program number. The minimum value is `0`, the maximum value is `127`
    /// (i.e. `u7`). This type will clamp values to the valid range.
    Program,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// Represents the number of channels in mono mode. The minimum value is `0`, the maximum value
    /// is `127` (i.e. `u7`). This type will clamp values to the valid range.
    MonoModeChannels,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// Represents a MIDI control value. The minimum value is `0`, the maximum value  is `127` (i.e.
    /// `u7`). This type will clamp values to the valid range.
    ControlValue,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// The [port](http://midi.teragonaudio.com/tech/midifile/obsolete.htm) number. The minimum
    /// value is `0`, maximum value is `127` (i.e. `u7`). The default value is `0`.
    PortValue,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// Represents the MIDI pitch bend value. The minimum value is `0`, the maximum value is `16383`
    /// (i.e. `u14`). This type will clamp values to the valid range.
    PitchBendValue,
    u16,
    0,
    16383,
    8192,
    pub
);

clamp!(
    /// Represents a MIDI channel pressure (after-touch) amount. The minimum value is `0`, the
    /// maximum value is `127` (i.e. `u7`). This type will clamp values to the valid range.
    PressureValue,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// Represents the data byte of a MIDI time code quarter frame message: a 3-bit message type
    /// and a 4-bit value packed as `0nnndddd`. The minimum value is `0`, the maximum value is
    /// `127` (i.e. `u7`). This type will clamp values to the valid range.
    QuarterFrameValue,
    u8,
    0,
    127,
    0,
    pub
);

clamp!(
    /// Represents a song position in MIDI beats (1 beat = six MIDI clocks) since the start of the
    /// song. The minimum value is `0`, the maximum value is `16383` (i.e. `u14`). This type will
    /// clamp values to the valid range.
    SongPosition,
    u16,
    0,
    16383,
    0,
    pub
);

clamp!(
    /// Represents the song or sequence number of a song select message. The minimum value is `0`,
    /// the maximum value is `127` (i.e. `u7`). This type will clamp values to the valid range.
    SongNumber,
    u8,
    0,
    127,
    0,
    pub
);