Top-level functor for definitions related to regular temperaments, such as chord/scale/interval databases and notation output.
Functor
RegT ("/Users/torsten/oz/music/Strasheela/strasheela/trunk/strasheela/contributions/anders/RegularTemperament/RegularTemperament.oz")
Import
- GUtils at "x-ozlib://anders/strasheela/source/GeneralUtils.ozf"
- LUtils at "x-ozlib://anders/strasheela/source/ListUtils.ozf"
- HS at "x-ozlib://anders/strasheela/HarmonisedScore/HarmonisedScore.ozf"
- DB at "source/DB.ozf"
Export
Define
fun{JiPC SymPC}
Transforms symbolic accidental (atom) into the corresponding accidental integer. The following symbolic accidentals are supported: the empty atom '' is natural (!), '7' and 'L' are a septimal comma sharp and flat, '77' and 'LL' are two septimal commas sharp and flat, '#' and 'b' are a semitone sharp and flat, and finally 'x' and 'bb' are two semitones sharp and flat.
Note: Returned value depends on {HS.db.getAccidentalOffset}, set the HS database to ET41.db.fullDB.
*/
TODO: umkehroperation..
fun {Acc SymAcc}
AccDecls.SymAcc + {HS.db.getAccidentalOffset}
end
/** %% Tranforms a symbolic note name for a JI pitch class into the corresponding regular temperament pitch class (an int). SymPC is a pair of the form Nominal#Acc or Nominal#Acc1# ... #AccN. Nominal is one of the 7 neminals 'C', 'D', .. 'B', which express a chain of Pythagorean fifths. The following accidentals are supported.
'#' and 'b': a Pythagorean apotome up/down
'/' and '\\': a Syntonic comma up/down
'7' and 'L': a Septimal comma 64/63 up/down
'^' and 'v': a 11-limit quartertone 33/32 up/down
Note that the mapping of JI notation to regular temperament PCs may not correspond to the common notation for the temperament in question. For example, using common notation for 1/4-comma meantone the interval C-Fb is closer to the Pythagorean third 81/64 than C-E. Therefore for this temperament, if SymPC is 'E' (i.e. the Pythagorean third 81/64) then JiPC returns the pitch class that correspond to the tone usually notated Fb (given a high-enough generatorFactors).
fun{JiPitch Spec}
Tranforms a symbolic note name for a JI pitch into the corresponding regular temperament pitch (an int). Spec is pair of the form Nominal#Acc#Octave or Nominal#Acc1# ... #AccN#Octave. See JiPitch for the meaning of nominal and accidentals. Octave is an integer. The returned value depends on PitchesPerOctave.
fun{PC SymPC}
Tranforms a symbolic note name for a tempered pitch class into the corresponding regular temperament pitch class (an int). PC is used exactly like JiPC, see there for details.
The difference to JiPC is that PC internally uses tempered intervals. For example, in 1/4-comma meantone the Pythagorean third 81/64 is mapped to the PC of the interval 'C'-'E', because it takes tempered fifths into account.
fun{Pitch Spec}
Tranforms a symbolic note name for a tempered pitch into the corresponding regular temperament pitch (an int). Pitch is used exactly like JiPitch, and the different between Pitch and JiPitch is the same as the difference between PC and JiPC.
End