Writes a Note ON event. MIDI notes are in the range 0..127 The attack velocity is in the range 1..127 and will set the volume. A Note ON event with a zero velocity is equivalent to a Note OFF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MIDI_file), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | channel | |||
integer, | intent(in) | :: | note | |||
integer, | intent(in) | :: | velocity |
subroutine Note_ON(self, channel, note, velocity) class(MIDI_file), intent(inout) :: self integer, intent(in) :: channel, note, velocity ! 8 bits integer(int8) :: octets(0:2) octets(0) = ON + checked_int8(channel, upper=15) octets(1) = checked_int8(note) octets(2) = checked_int8(velocity) write(self%unit, iostat=self%status) octets end subroutine Note_ON