add_chord Subroutine

public subroutine add_chord(tape, track, t1, t2, f, Amp, chord, envelope)

Writes a chord using an array containing the intervals (see the music_common module)

Arguments

Type IntentOptional Attributes Name
type(tape_recorder), intent(inout) :: tape
integer, intent(in) :: track
real(kind=wp), intent(in) :: t1
real(kind=wp), intent(in) :: t2
real(kind=wp), intent(in) :: f
real(kind=wp), intent(in) :: Amp
integer, intent(in), dimension(:) :: chord
type(ADSR_envelope), intent(inout), optional :: envelope

Calls

proc~~add_chord~~CallsGraph proc~add_chord add_chord proc~add_note add_note proc~add_chord->proc~add_note proc~add_sine_wave add_sine_wave proc~add_note->proc~add_sine_wave proc~adsr_level ADSR_envelope%ADSR_level proc~add_sine_wave->proc~adsr_level

Called by

proc~~add_chord~~CalledByGraph proc~add_chord add_chord program~chords_and_melody chords_and_melody program~chords_and_melody->proc~add_chord program~demo_effects demo_effects program~demo_effects->proc~add_chord

Source Code

    subroutine add_chord(tape, track, t1, t2, f, Amp, chord, envelope)
        type(tape_recorder), intent(inout) :: tape
        integer, intent(in)  :: track
        real(wp), intent(in) :: t1, t2, f, Amp
        integer, dimension(:), intent(in) :: chord
        type(ADSR_envelope), optional, intent(inout) :: envelope
        integer :: i, interval

        do i = 1, size(chord)
            interval = chord(i)
            call add_note(tape, track, t1, t2, f * SEMITONE**interval, Amp, envelope)
        end do
    end subroutine add_chord