Skip to content

Commit

Permalink
Teach play_chord how to play symbols and strings in addition to numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Jun 6, 2014
1 parent abd2fe7 commit 07c8da8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/server/sonicpi/mods/sound.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,12 @@ def play_pattern_timed(notes, times, *args)

def play_chord(notes, *args)
ensure_good_timing!

shift = Thread.current.thread_variable_get(:sonic_pi_mod_sound_transpose) || 0
shifted_notes = notes.map{|n| n + shift}
shifted_notes = notes.map do |n|
n = note(n) unless n.is_a? Numeric
n + shift
end
synth_name = @mod_sound_studio.current_synth_name
trigger_chord(synth_name, shifted_notes, args)
end
Expand Down

0 comments on commit 07c8da8

Please sign in to comment.