Pitch_Bend Subroutine

public subroutine Pitch_Bend(self, channel, lsb, msb)

Apply a pitch bend to all notes currently sounding on the channel. No bend is 00 40 (64 in decimal), maximum downward bend is 00 00, maximum upward bend is 7F 7F. The Least Significant Byte (lsb) is optional (default value is 0), as it is useful only for fine adjustment. You can not use it with play_note, play_chord or play_broken_chord: you must manage yourself the Note ON and Note OFF events, and put the bend between.

Type Bound

MIDI_file

Arguments

Type IntentOptional Attributes Name
class(MIDI_file), intent(inout) :: self
integer, intent(in) :: channel
integer, intent(in), optional :: lsb
integer, intent(in) :: msb

Calls

proc~~pitch_bend~~CallsGraph proc~pitch_bend MIDI_file%Pitch_Bend proc~checked_int8 checked_int8 proc~pitch_bend->proc~checked_int8 proc~delta_time MIDI_file%delta_time proc~pitch_bend->proc~delta_time proc~checked_int32 checked_int32 proc~delta_time->proc~checked_int32 proc~write_variable_length_quantity MIDI_file%write_variable_length_quantity proc~delta_time->proc~write_variable_length_quantity proc~variable_length_quantity variable_length_quantity proc~write_variable_length_quantity->proc~variable_length_quantity

Source Code

    subroutine Pitch_Bend(self, channel, lsb, msb)
        class(MIDI_file), intent(inout) :: self
        integer, intent(in) :: channel          ! 8 bits (0..15)
        integer, optional, intent(in) :: lsb    ! 8 bits (0..127)
        integer, intent(in) :: msb              ! 8 bits (0..127)
        integer(int8) :: octets(0:2)

        call self%delta_time(0)

        octets(0) = int(z'E0', int8) + checked_int8(channel, upper=15)
        if (present(lsb)) then
            octets(1) = checked_int8(lsb)
        else
            octets(1) = 0_int8
        end if
        octets(2) = checked_int8(msb)
        write(self%unit, iostat=self%status) octets
    end subroutine Pitch_Bend