pub(crate) fn write<W: Write>(&self, out: &mut W) -> WriteResult<W> {
        match self {
            MidiMessage::NoteOff { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::NoteOn { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::Aftertouch { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::Controller { controller, value } => {
                out.write(&[controller.as_int(), value.as_int()])?
            }
            MidiMessage::ProgramChange { program } => out.write(&[program.as_int()])?,
            MidiMessage::ChannelAftertouch { vel } => out.write(&[vel.as_int()])?,
            MidiMessage::PitchBend { bend } => {
                let raw = bend.0.as_int();
                out.write(&[(raw & 0x7F) as u8, (raw >> 7) as u8])?
            }
        }
        Ok(())
    }
/// Write the data part of this message, not including the status.
Write the data part of this message, not including the status.
Write the data part of this message not including the status .
pub(crate) fn write<W: Write>(&self, out: &mut W) -> WriteResult<W> {
        match self {
            MidiMessage::NoteOff { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::NoteOn { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::Aftertouch { key, vel } => out.write(&[key.as_int(), vel.as_int()])?,
            MidiMessage::Controller { controller, value } => {
                out.write(&[controller.as_int(), value.as_int()])?
            }
            MidiMessage::ProgramChange { program } => out.write(&[program.as_int()])?,
            MidiMessage::ChannelAftertouch { vel } => out.write(&[vel.as_int()])?,
            MidiMessage::PitchBend { bend } => {
                let raw = bend.0.as_int();
                out.write(&[(raw & 0x7F) as u8, (raw >> 7) as u8])?
            }
        }
        Ok(())
    }
pub ( crate ) fn write < W : Write > ( & self , out : & mut W ) -> WriteResult < W > { match self { MidiMessage :: NoteOff { key , vel } => out . write ( & [ key . as_int ( ) , vel . as_int ( ) ] ) ? , MidiMessage :: NoteOn { key , vel } => out . write ( & [ key . as_int ( ) , vel . as_int ( ) ] ) ? , MidiMessage :: Aftertouch { key , vel } => out . write ( & [ key . as_int ( ) , vel . as_int ( ) ] ) ? , MidiMessage :: Controller { controller , value } => { out . write ( & [ controller . as_int ( ) , value . as_int ( ) ] ) ? } MidiMessage :: ProgramChange { program } => out . write ( & [ program . as_int ( ) ] ) ? , MidiMessage :: ChannelAftertouch { vel } => out . write ( & [ vel . as_int ( ) ] ) ? , MidiMessage :: PitchBend { bend } => { let raw = bend . 0 . as_int ( ) ; out . write ( & [ ( raw & 0x7F ) as u8 , ( raw >> 7 ) as u8 ] ) ? } } Ok ( ( ) ) }
Write the data part of this message, not including the status.
Write the data part of this message not including the status .
&self
out
&mut W
&self
out
&mut W