This functor defines Lilypond output (using semitone and quartertone accidentals) and Explorer output actions for 22 ET.
BUG: Lilypond notation problem: using grace notes (for showing chord and scale notes) seems to disable the Staff.instrumentName display. It is possible that this has to do with the missing \score at the beginning of lilypond 22 ET score data. Yet, setting this causes an error related to the \override of Score.Accidental and Score.KeySignature #'glyph-name-alist for 22 ET. For now, I leave it like this -- either I show Staff.instrumentName or scale/chord pitch classes with grace notes. If I want to publish a score with analytical information using grace notes, I will again look into this matter.
Functor
Out ("/Users/t/oz/music/Strasheela/strasheela/trunk/strasheela/contributions/anders/ET22/source/Output.oz")
Import
- OS
- FS
- Explorer
- Resolve
- Path at "x-ozlib://anders/tmp/Path/Path.ozf"
- GUtils at "x-ozlib://anders/strasheela/source/GeneralUtils.ozf"
- Out at "x-ozlib://anders/strasheela/source/Output.ozf"
- Score at "x-ozlib://anders/strasheela/source/ScoreCore.ozf"
- HS at "x-ozlib://anders/strasheela/HarmonisedScore/HarmonisedScore.ozf"
- DB at "DB.ozf"
- ET22 at "../ET22.ozf"
Export
Define
proc{RenderAndShowLilypond MyScore Args}
Proc is like Out.renderAndShowLilypond, but provides buildin support for notes and chords with pitch units in et22.
Please note that this support is defined by the argument clauses and wrapper (see Out.toLilypond) -- additional clauses are still possible, but adding new note/chord clauses will overwrite the support for 22 ET (the wrapper can be defined like for Out.renderAndShowLilypond).
Also, note that convert-ly (which updates) sometimes breaks the 22 ET notation (e.g., when inserting new explicit staffs).
proc{SetEnharmonicNotationTable Table}
The enharmonic notation for 22 ET can be customised by specifying for each numeric 22 ET pitch class how it is notated. Note that this setting will be fixed throughout the score though (e.g., pitch class 7 may be notated as 'E\\', but then it is never 'D#'). The enharmonic notation is specified by a record which maps pitch class integers to pitch names. See ET22.pc and friends for an explanation of the pitch names. The default are the default pitch names in Scala for 22 ET (using E22 notation system).
Note that the lowest feature in the table is 0 (i.e., 'C') and not 1 (i.e. Table is not a tuple if all pitch classes are specified, a tuple has no feature 0).
NB: an error will occur if you fail to specify a notation for a 22 ET pitch class in your scores, so Table should specify a notation for every 22 ET pitch class.
proc{AddExplorerOut_ChordsToScore Args}
Creates an Explorer output. The script solution must be a sequential container with chord objects (i.e. without the actual notes).
The Explorer output action creates a CSP with expects a chord sequence and returns a homophonic chord progression. AddExplorerOut_ChordsToScore internally uses ET22.score.chordsToScore for this purpose.
The result is transformed into music notation (with Lilypond), sound (with Csound), and Strasheela code (archived score objects).
Args are outname and the arguments of ET22.score.chordsToScore. the outname arg sets the output file name (which gets added the space number in the Explorer and then a random number). outname also sets the name under which this action appears in the Explorer menu.
IMPORTANT: ET22.score.chordsToScore conducts a search which potentially can fail (e.g., if insufficient arguments are provided)!
proc{MakeChordComment MyChord Result}
Returns the chord comment (also works for scale).
proc{MakeChordRatios MyChord Result}
proc{MakeScaleComment MyScale Result}
Returns the scale comment.
fun{IsEt22Note X}
Returns true if X is a note object with pitch unit et22.
fun{IsEt22Chord X}
Returns true if X is a chord object with root pitch unit et22.
fun{IsEt22Scale X}
Returns true if X is a scale object with root pitch unit et22.
fun{NoteEt22ToLily MyNote}
Expects a Strasheela note object and returns the corresponding
Lilypond code (a VS). For simplicity, this transformation does not
support any additional expessions (e.g. fingering marks, or articulation
marks).
fun{NoteEt22ToLily_AdaptiveJI MyNote}
Like NoteEt22ToLily, but additionally notates the adaptive JI pitch offset of this note with respect to 22 ET.
End