Class: OctaveDependentNote

Environment: Siren
Superclass: Object
Category: Music-PitchClasses
Instance variables: oct pc midiPitch natural

Instances of this class represent octave dependent notes.
pc : the pitch class of the note (takes enharmonic spelling into account)
octave: integer from 0 to .., represent the octave.
Middle C is therefore represented by
pc : C
octave: 4
Defines methods to compute intervals, midiPitches, and lots
of thing that PitchClass implements too.
So why not make this class and PitchClass have
a common superclass, to factor out common computations ?
Ontological questions :
how to compute an interval between two octave-dependent notes,
since their ambitus may be arbitrarily large (no question of computing 25th intervals).
So intervals should be reduced to thirteenth, i.e. :
octaves should be taken into account only in a 0/1 manner

access

oct

oct: o

octave: o

pitchClass

pitchClass: aPc

alterations

flat

isDoubleFlat

isDoubleSharp

isFlat

isNatural

isSharp

natural

sharp

printing

printOn: s

storeOn: s
(N C sharp sharp octave: 3) storeString = '(N C sharp sharp @ 3)'

intervals

closestEnharmonic

diatonicStepsTo: aNote
returns the number of diatonic steps to aNote

following
the next diatonic note of self's natural note

newdiatonicStepsTo: aNote
returns the number of diatonic steps to aNote

nthFollowing: i
yields the nth diatonic note following self.
Takes octave shifts into account

nthPreceding: i
yields the nth diatonic note preceding self.
Takes octave shifts into account

olddiatonicStepsTo: aNote
returns the number of diatonic steps to aNote

oldEquals: x
important pour l'integrite des operations sur les melodies

preceding
the next diatonic note of self's natural note

semiToneCount
related to OctaveDependentNote fromMidiPitch

semiTonesWith: aNote

interval testing

intervalBetween: aNote
returns the interval between the two octaveDependentNotes.
Assume that aNote is really a OctaveDependentNote

intervalTypeBetween: aNote
returns the type of the interval between the two notes modulo one
octave
(N C octave: 6) intervalTypeBetween: (N re octave: 3)

isLessThanA: interval from: od
ascending or descending direction

realIntervalTypeBetween: aNote
returns the type of the interval between the two notes
(N C octave: 6) realIntervalTypeBetween: (N C octave: 3)

testIntervalsFrom: pitch1 to: pitch2
(N C sharp @ 3) testIntervalsFrom: (N A @ 1) to: (N A @ 4)

public intervals

alterate: note toReach: i
Join semitons to note in order to obtain the required number of
semitones with self.
Redefined here because interval computation must take octave
into account ...

alterateBelow: note toReach: i
Join semitons to note in order to obtain the required number of
semitones with self.
Redefined here because interval computation must take octave
into account ...

augmentedEleventh

augmentedFifth

augmentedFourth

augmentedNinth

augmentedOctave

augmentedSecond

diminishedFifth

diminishedNinth

diminishedOctave

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

transpose

beDownAnOctave

beTransposedBy: i

beTransposedOneStepDown
used by the score editor as diatonic step!

beTransposedOneStepUp
used by the score editor as diatonic step!

beUpAnOctave

downAnOctave

setPitchTo: aPitch

switchTo: aNote

transposeOf: anInterval
three cases: integer (+/-), method name (= ascending interval), or interval
object

upAnOctave

comparing

< aNote

<= aNote

= x

> aNote

>= aNote

hash

isbetween: n1 and: n2

isNearerTo: n1 than: n2

midiPitchEquals: aNote

pitchEqual: aNote

theNearestPitch: list
(N A flat @ 2) theNearestPitch: (Array with: (N C @ 2) with: (N C @ 3))

mutations

duration: d

leading

isLeadingToneTo: n

lowerLeadingToneInScale: s

upperLeadingToneInScale: s

private-pacts

respectsBassTessitura

modifying

inTessitura: qualTessitura
modify octave according to the given tessitura

mutations more

dottedEighth

dottedFull

dottedHalf

dottedQuarter

eighth

eighthInTriplet

full

half

quarter

quarterInTriplet

sixteenth

accessing delegation

downAndUpOctaves: odNote

constraining

intervalTypeModuloOctaveBetween: n

MetaClass: OctaveDependentNote class

creation

from: aNote to: n2

fromMidiPitch: n
yields the note that has n as midiPitch. Only natural and sharp
notes are created as there is no possible way of knowing the
intention

named: s
self named: 'Re#2'

octave: o pc: pc

examples

examples
(N do octave: 3) minorThird sharp sharp E#3

(N C octave: 3) semiTonesWith: (N la octave: 4) 21

(#(do re mi fa sol la si ) collect: [:x | (N perform: x) octave: 3])
collect: [:y | y - #octave]

(N B octave: 3) intervalBetween: (N B flat octave: 4)
(N B octave: 3) intervalBetween: (N B flat octave: 2)

(N C octave: 3) intervalBetween: (N C octave: 2) descending octave
(N C octave: 2) intervalBetween: (N C octave: 3) octave

vocal ranges

altoRange
retourne la collection des notes de l'alto

altoRangeInScale: aScale
OctaveDependentNote sopranoRangeInScale: (N do sharp minorScale)

baseRange
retourne la collection des notes de la basse

baseRangeInScale: aScale
OctaveDependentNote sopranoRangeInScale: (N do sharp minorScale)

sopranoRange
retourne la collection des notes du soprano

sopranoRangeInScale: aScale
OctaveDependentNote sopranoRangeInScale: (N do sharp minorScale)

tenorRange
retourne la collection des notes du tenor

tenorRangeInScale: aScale
OctaveDependentNote sopranoRangeInScale: (N do sharp minorScale)