Environment: Siren
Instances of (subclasses of) this class represent pitch-classes.
private intervals
descendingSemiTonesToNatural
intervalBetween: aNote
returns the interval between the two notes
intervalTypeBetween: aNote
returns the interval between the two notes
nthFollowing: i
returns the i th natural note following self
nthPreceding: i
returns the i th natural note preceding self
numberOfSemiTonesBetween: aNote
Important method in the theory. It is a 3-stage computation of the interval between 2 notes
semiToneCount
smallestIntervalBetween: aNote
returns the descending interval between the two notes
public intervals
alterateBelow: note toReach: i
augmentedEleventh
augmentedFifth
augmentedFourth
augmentedNinth
augmentedSecond
augmentedUnison
diminishedFifth
diminishedNinth
diminishedSecond
diminishedSeventh
diminishedThirteenth
eleventh
fifth
flatFifth
flatNinth
flatThirteenth
fourth
majorNinth
majorSecond
majorSeventh
majorSixth
majorThird
majorThirteenth
minorNinth
minorSecond
minorSeventh
minorSixth
minorThird
minorThirteenth
ninth
octave
perfectEleventh
perfectFifth
perfectFourth
second
seventh
sixth
thirteenth
unison
testing
isDoubleSharp
isFlat
isNatural
isSharp
pitchEqual: aNote
chord creation
majorTriad
minorTriad
mutations
chordFromString: st
inTessitura: qualTessitura
N C pitchInTessitura: QTessitura high
octave: o
scales
harmonicMinorScale
majorScale
melodicMinorScale
minorScale
pseudoMinorScale
making octave-dep notes
returns two octave dependent notes of self who are repectively
lower and higher than the given odNote
pitchBetween: n1 and: n2
return, if it exists, a pitch (octave dependent note) between the two given notes
the: nb octavesBeginningFrom: initialOctave
N D the: 3 octavesBeginningFrom: 0
access
doubleSharp
natural
pitchClass
saving
to ensure uniqueness, pitch classes save themselves as messages sent
to the appropriate class, so that no duplicate are created
printing
storeOn: s
N C storeString
transpose
three cases: integer (+/-), method name (= ascending interval), or interval
object
constraining
Paleo
nameInScale: aScale
MetaClass: PitchClass class
initialization
initialize
There are 35 pitch classes. That's too much for Squeak, so the method was split into two methods
initializeAllNaturalNotes
initializeClass
There are 35 pitch classes. That's too much for Squeak, so the method was split into two methods
initializeDoubleFlat
initializeFrenchNames
initializeGlobals
global access
allNotesButDoubles
allPlausibleRootNotes
allPlausibleRootsForMajorScales
self allPlausibleRootsForMajorScales
allPlausibleRootsForMinorScales
self allPlausibleRootsForMinorScales
B
C
D
do
E
F
fa
flatNotes
fromSemiTones: n
arbitrary method, used for transposing pitch classes (a strange notion...)
G
la
mi
naturalNotes
noteNamed: c
takes the case of flat into account. Sharps are naturally parsed out
from the note name by the smalltalk parser.
Since the algorithm proceeds from the left, it accepts any number of sharps and flats (using the common algebra) :
N noteNamed: 'C#b#b#b#' -> C#
re
sharpNotes
si
sol
vocal ranges
retourne la collection des notes de l'alto
altoRangeInScale: aScale
PitchClass sopranoRangeInScale: (N do sharp minorScale)
baseRange
retourne la collection des notes de la basse
baseRangeInScale: aScale
PitchClass sopranoRangeInScale: (N do sharp minorScale)
sopranoRange
retourne la collection des notes du soprano
sopranoRangeInScale: aScale
PitchClass sopranoRangeInScale: (N do sharp minorScale)
tenorRange
retourne la collection des notes du tenor
tenorRangeInScale: aScale
PitchClass sopranoRangeInScale: (N do sharp minorScale)
ordering
nFirstFlats: n
PitchClass nFirstFlats: 3
nFirstSharps: n
PitchClass nFirstSharps: 3
sharpOrdering
examples
N C sharp chordFromString: '' -> [C# ]
(N C sharp chordFromString: 'min 7 dim5') notes -> OrderedCollection (C# E G B )
closestEnharmonic
N D sharp closestEnharmonic Eb
N E flat closestEnharmonic D#
N B sharp closestEnharmonic C
N C flat closestEnharmonic D#
N D sharp sharp closestEnharmonic E
N E flat flat closestEnharmonic D
------
(N D sharp @ 2) closestEnharmonic Eb2
(N E flat @ 2) closestEnharmonic D#2
(N B sharp @ 2) closestEnharmonic C3
(N C flat @ 3) closestEnharmonic B2
majorScaleExample
PitchClass B majorScale notes- > #(B C# D# E F# G# A# )
melodicMinorScaleExample
minorScaleExample
pitchInTessituraExamples
N C pitchInTessitura: QTessitura high -> C5
N A pitchInTessitura: QTessitura high -> A4
N G pitchInTessitura: QTessitura high -> G4
N F pitchInTessitura: QTessitura high -> F5
N A pitchInTessitura: QTessitura low -> A2
sharpflatAlgebraExample
sharp and flat's algebra
N C sharp ->Do#
N C sharp sharp ->Do##
N C sharp sharp sharp ->error
N C flat sharp -> Do
N re sharp sharp natural -> re
Intervals computation :
N C diminishedFifth -> Solb
N C augmentedFourth -> Fa#
N C diminishedThirteenth -> Lab
N C flat minorSeventh -> Sibb
N C majorThird majorThird -> Sol#
Notes equivalence : pitchEgal methode
N C sharp pitchEqual: N re flat -> true
N C augmentedFourth pitchEqual: N C diminishedFifth -> true
N C diminishedFifth pitchEqual: N F minorSecond -> true