Environment: Siren
Notion of signature is related to the notion of "legal" scales, i.e.
printing
storeOn: s
testing
isEmpty
isLegal
sharpsInRightOrder
tonality
access
flats
initialize
nbFlats: n
nbSharps: n
reOrderSharpsAndFlats
attempts to reorder flats and sharps according to the natural order as found in
PitchClass
sharps
sharps: s flats: f
attempts to reorder flats and sharps according to the natural order as found in
PitchClass
MetaClass: Signature class
examples
example2
Signature new tonality -> C MajorScale
(Signature new nbSharps: 4) tonality -> E MajorScale
(Signature new nbFlats: 3) tonality -> Eb MajorScale
example3
Signature fromTonality: N D majorScale
Signature fromTonality: N E flat majorScale
example4
Signatures may be created for illegal scales. However, method
tonality yields an error for these scales:
Signature fromTonality: N D minorScale -> 1 sharps; 1 flats
Signature sharps: (Array with: N F sharp) flats: (Array with: (N E flat)) -> 1 sharps; 1 flats
(Signature fromTonality: N D minorScale) tonality -> error
creation
Signature choseSignature
fromTonality: aScale
Signature fromTonality: N E flat majorScale
new
sharps: s flats: f