Class: MusicalInterval

Environment: Siren
Superclass: Object
Category: Music-PitchClasses
Instance variables: type semiTones

MusicalInterval commentStamp: '' prior: 0!
Intervalle represente un intervalle entre deux notes.
type represente l'ecart entre les deux notes extremites. Cet ecart ne tient compte
que des notes naturelles. Par exemple, les tierces (majeures ou mineures) ont comme type 3,
les quarte 4 etc.
demisTons est le nombre de demis tons entre les deux notes. Par exemple une tierce
majeure a comme type 3 et demisTons = 4.

computing notes

topIfBottomIs: aNote
yields the note making the interval self with aNote

printing

isPrintable

printOn: s

printPrintableOn: s
Watch out : all Intervals cant print themselves.
You can convert a musicalInterval into a ChromaticInterval.
E.g. : Interval between Cbb and C ## (super super augmented
unison!!).
There are here 40 printable intervals. Cf. method MusicalInterval allPrintableIntervals
(put in protocol constants)

storeOn: s

automatic access

orientedSemiTones

semiTones

semiTones: aValue

type

type: aValue

arithmetics

+ anInterval
(MusicalInterval majorSecond) + (MusicalInterval perfectFifth)

testing

isA: anInterval

isAscending

isDescending

comparing

< anInterval

<= anInterval

= anInterval

> anInterval

>= anInterval

hasSameDirectionAs: anInterval

mutations

ascending

asChromaticInterval

descending

MetaClass: MusicalInterval class

examples

allPrintableIntervals
MusicalInterval allPrintableIntervals

example
MusicalInterval majorThird inverse
MusicalInterval perfectFourth topIfBottomIs: N C sharp -> Fa#
MusicalInterval perfectFourth bottomIfTopIs: N F sharp -> Do#

N do intervalBetween: N re -> Major second
N do flat intervalBetween: N sol -> Augmented fifth
N do flat intervalBetween: N do sharp -> superAugmented unisson
N do flat intervalBetween: N do sharp sharp -> non printable interval
(N do flat intervalBetween: N do sharp sharp) asChromaticInterval -> Chromatic 3
(N do intervalBetween: N sol) = (N re intervalBetween: N la) -> true
(N do intervalBetween: N fa sharp) = (N do intervalBetween: N sol flat) -> false
MusicalInterval allIntervalsType: 3 -> #(Major third Minor third )
MusicalInterval allIntervalsType: 2 ->
#(Augmented second Diminished second Major second Minor second )
MusicalInterval allIntervalsType: 1 -> #(Augmented unisson Diminished unisson superAugmented unisson superDiminished unisson unisson )

exampleTranspositions
three ways of of transposing pitch classes and od notes

creation

allIntervalsType: t
MusicalInterval allIntervalsType: 2

type: aType semiTones: d

all-printable

augmentedEleventh

augmentedFifth
8 semitones

augmentedFourth
6 semitones

augmentedNinth
15 semitones

augmentedOctave
3 semitones

augmentedSecond
3 semitones

augmentedTenth
17 semitones

augmentedTwelvth
20 semitones

augmentedUnison

diminishedFifth
6 semitones

diminishedFourth
5 semitones

diminishedNinth
1 octave + 1 semitones

diminishedOctave
11 semitones

diminishedSecond
0 semitones

diminishedSeventh
9 semitones

diminishedTenth
15 semitones

diminishedThirteenth

diminishedTwelvth
18 semitones

diminishedUnison
MusicalInterval diminishedUnison topIfBottomIs: N C

majorNinth
14 semitones

majorSecond
2 semitones

majorSeventh
11 semitones

majorSixth
9 semitones

majorTenth
14 semitones

majorThird
4 semitones

majorThirteenth

majorTwelvth
19 semitones

minorNinth
1 octave + 1 semitones

minorSecond
1 semitone

minorSeventh
10 semitones

minorSixth
8 semitones

minorThird
3 semitones

minorThirteenth

octave

perfectEleventh
5 semitones

perfectFifth
7 semitones

perfectFourth
5 semitones

superAugmentedUnison
MusicalInterval superAugmentedUnison topIfBottomIs: N C

superDiminishedUnison
MusicalInterval superDiminishedUnison topIfBottomIs: N C

unison

constants nick-names

aug11

aug4

aug5

aug9
15 semitones

dim13

dim5
6 semitones

dim7
9 semitones

dim9

eleventh

fifth

flatFifth

flatNinth
1 octave + 1 semitones

flatThirteenth

fourth

ninth

second
2 semitones

seventh

sixth

thirteenth