Hey Tim
That's nice.
Now the question is whether the scales should be written in the form of
[2,2,1,2,2,2,1]
or
[0,2,4,5,7,9,11]
(both ionian scales).
I prefer the former. It means that in a 12 tone scale, 2 means a whole note, 1 means half note.
Then, for the maqams one just writes 3 for 3/4th note. (in a 24 tone tuning).
This is better than dealing with these as midinote numbers IMHO.
thor
On second thought, here's a version that does a lot better at mimicking normal object behavior:
ScaleTest {
classvar scaleDict;
var <>stepRatios;
*initClass { scaleDict = IdentityDictionary[ \ionian -> [2, 2, 1, 2, 2, 2, 1], \aeolian -> [2, 1, 2, 2, 1, 2, 2], // etc. ]; }
*new { |key| var newScale; newScale = super.new; ^key.notNil.if({ newScale.init(key) }, { newScale }) }
init { |key| stepRatios = scaleDict[key]; ^stepRatios.isNil.if({ nil }, { this }) }
*doesNotUnderstand { |selector, args| ^(scaleDict.includesKey(selector)).if({ this.new(selector) }, { super.doesNotUnderstand(selector, args) }) } }
--
_______________________________________________ Sc-devel mailing list
|