Skip to content

Commit

Permalink
ClassLib: fix non-keywords being passed to Scale and Tunings construc…
Browse files Browse the repository at this point in the history
…tor methods.
  • Loading branch information
JordanHendersonMusic committed May 6, 2024
1 parent 6ebdb6b commit 1a9c607
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions SCClassLibrary/Common/Collections/Scale.sc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ Scale {
}

*doesNotUnderstand { |selector, args|
var scale = this.newFromKey(selector, args).deepCopy;
^scale ?? { super.doesNotUnderstand(selector, args) };
var scale = this.newFromKey(selector, args);
if(scale.notNil) { ^scale };
^super.doesNotUnderstand(selector, args)
}

*doesNotUnderstandWithKeys {|selector, argumentsArray, keywordArgumentPairs|
^Scale.performWith(\newFromKey, [selector] ++ argumentsArray, keywordArgumentPairs)
}

*newFromKey { |key, tuning|
Expand Down Expand Up @@ -185,8 +190,13 @@ Tuning {
}

*doesNotUnderstand { |selector, args|
var tuning = this.newFromKey(selector, args).deepCopy;
^tuning ?? { super.doesNotUnderstand(selector, args) }
var tuning = this.newFromKey(selector, args);
if(tuning.notNil) { ^tuning };
^super.doesNotUnderstand(selector, args)
}

*doesNotUnderstandWithKeys {|selector, argumentsArray, keywordArgumentPairs|
^Tuning.performWith(\newFromKey, [selector] ++ argumentsArray, keywordArgumentPairs)
}

*newFromKey { | key |
Expand Down

0 comments on commit 1a9c607

Please sign in to comment.