Skip to content

Commit d522057

Browse files
committed
Sound - fix controlling chord groups
1 parent 42f6039 commit d522057

File tree

1 file changed

+7
-4
lines changed
  • app/server/sonicpi/lib/sonicpi/lang

1 file changed

+7
-4
lines changed

app/server/sonicpi/lib/sonicpi/lang/sound.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3725,7 +3725,7 @@ def invert_chord(*args)
37253725

37263726
def control(*args)
37273727

3728-
if (!args.first.is_a?(SonicPi::SynthNode || !args.first.nil?))
3728+
if (!args.first.is_a?(SonicPi::Node || !args.first.nil?))
37293729
# we haven't specified a node to control - take it from the TL
37303730
node = __thread_locals.get(:sonic_pi_local_last_triggered_node)
37313731
else
@@ -3743,6 +3743,7 @@ def control(*args)
37433743

37443744
info = node.info
37453745
defaults = info ? info.arg_defaults : {}
3746+
37463747
if node.info
37473748
args_h = info.munge_opts(args_h)
37483749
resolve_midi_args!(args_h, info)
@@ -3751,16 +3752,18 @@ def control(*args)
37513752
end
37523753

37533754
if node.is_a?(ChordGroup)
3754-
37553755
note = args_h.delete(:note)
37563756
notes = args_h.delete(:notes)
37573757
notes = note if note && !notes
3758-
notes = [notes] unless is_list_like?(notes)
37593758
normalise_args! args_h, defaults
37603759
# don't normalise notes key as it is special
37613760
# when controlling ChordGroups.
37623761
# TODO: remove this hard coded behaviour
3763-
args_h[:notes] = notes.map{|n| normalise_transpose_and_tune_note_from_args(n, args_h)}
3762+
if notes
3763+
notes = [notes] unless is_list_like?(notes)
3764+
puts "hiii: #{notes}"
3765+
args_h[:notes] = notes.map{|n| normalise_transpose_and_tune_note_from_args(n, args_h)}
3766+
end
37643767
else
37653768
note = args_h[:note]
37663769
if note

0 commit comments

Comments
 (0)