Writes a broken chord using an array containing the intervals (see the music_common module). It uses plucked strings (Karplus-Strong). For the moment, each note has the same duration. https://en.wikipedia.org/wiki/Arpeggio
Type | Intent | Optional | 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 |
subroutine add_broken_chord(tape, track, t1, t2, f, Amp, chord) type(tape_recorder), intent(inout) :: tape integer, intent(in) :: track real(wp), intent(in) :: t1, t2, f, Amp integer, dimension(:), intent(in) :: chord integer :: i, interval real(wp) :: dnote ! duration of each note of the chord real(wp) :: fnote real(wp) :: t dnote = (t2-t1) / size(chord) t = t1 do i = 1, size(chord) interval = chord(i) fnote = f * SEMITONE**interval call add_karplus_strong(tape, track, t1=t, t2=t+dnote, f=fnote, Amp=Amp) t = t + dnote end do end subroutine add_broken_chord