Note_OFF Subroutine

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

Writes a Note OFF event. MIDI notes are in the range 0..127 The release velocity is in the range 0..127.

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), optional :: velocity

Calls

proc~~note_off~~CallsGraph proc~note_off MIDI_file%Note_OFF proc~checked_int8 checked_int8 proc~note_off->proc~checked_int8

Called by

proc~~note_off~~CalledByGraph proc~note_off MIDI_file%Note_OFF proc~play_broken_chord MIDI_file%play_broken_chord proc~play_broken_chord->proc~note_off proc~play_chord MIDI_file%play_chord proc~play_chord->proc~note_off proc~play_note MIDI_file%play_note proc~play_note->proc~note_off program~blues blues program~blues->proc~note_off 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_OFF(self, channel, note, velocity)
        class(MIDI_file), intent(inout) :: self
        integer, intent(in) :: channel, note         ! 8 bits
        integer, optional, intent(in) :: velocity    ! 8 bits
        integer(int8) :: octets(0:2)

        octets(0) = OFF + checked_int8(channel, upper=15)
        octets(1) = checked_int8(note)
        if (present(velocity)) then
            octets(2) = checked_int8(velocity)
        else
            octets(2) = 64      ! Default value if no velocity captor
        end if
        write(self%unit, iostat=self%status) octets
    end subroutine Note_OFF