From 07c8da851ff1fa20c842672d3f20ff48cdffc815 Mon Sep 17 00:00:00 2001 From: Sam Aaron Date: Fri, 6 Jun 2014 10:49:18 +0100 Subject: [PATCH] Teach play_chord how to play symbols and strings in addition to numbers --- app/server/sonicpi/mods/sound.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/server/sonicpi/mods/sound.rb b/app/server/sonicpi/mods/sound.rb index 5de3710d33..d8e2f5c8c0 100644 --- a/app/server/sonicpi/mods/sound.rb +++ b/app/server/sonicpi/mods/sound.rb @@ -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