Spread amp change across arbitrary number of notes

def play_bar (pitches, durations, dynamic_start, dynamic_end)
  volumes = (line dynamic_start, dynamic_end, steps: (pitches.length), inclusive: true)
  pitches.each_with_index do |pitch, index|
    play_pattern_timed [pitch], [durations[index]], amp: volumes[index]
  end
end

(see https://github.com/cewillis001/sonic-pi-compos/blob/master/4partSongTemplate.rb#L20-L25 )

1 Like

Oh hey it turns out transposing is super simple…

uuuuugh I’m having so much fun :smiley:

3 Likes