Note_ON Subroutine

public subroutine Note_ON(self, channel, note, velocity)

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 Bound

MIDI_file

Arguments

Type IntentOptional Attributes Name
class(MIDI_file), intent(inout) :: self
integer, intent(in) :: channel
integer, intent(in) :: note
integer, intent(in) :: velocity

Calls

proc~~note_on~~CallsGraph proc~note_on MIDI_file%Note_ON proc~checked_int8 checked_int8 proc~note_on->proc~checked_int8

Called by

proc~~note_on~~CalledByGraph proc~note_on MIDI_file%Note_ON proc~play_broken_chord MIDI_file%play_broken_chord proc~play_broken_chord->proc~note_on proc~play_chord MIDI_file%play_chord proc~play_chord->proc~note_on proc~play_note MIDI_file%play_note proc~play_note->proc~note_on program~blues blues program~blues->proc~note_on program~blues->proc~play_chord program~canon canon program~canon->proc~play_note program~circle_of_fifths circle_of_fifths program~circle_of_fifths->proc~play_chord program~la_folia la_folia program~la_folia->proc~play_broken_chord program~la_folia->proc~play_chord program~motifs motifs program~motifs->proc~play_broken_chord program~motifs->proc~play_chord program~motifs->proc~play_note program~third_kind third_kind program~third_kind->proc~play_note

Source Code

    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