Index
HarmonisedScore
DB
HS_Score
Rules
DBs
HS_Distro
HS_Out
HS
Schoenberg
Default
Jazz
Partch
Johnston
Harrison
Chalmers
Catler
ArithmeticalSeriesChords
This functor defines output for score objects and concepts introduced by HS, e.g., Lilypond output for chord and scale objects and means to define Lilypond output for different temperaments.

Functor

Import

Export

Define

proc{AddExplorerOut_ChordsToScore Args}
Creates an Explorer action for outputting a pure sequence of chords. The solution of the script for which this explorer action is used 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. The result is transformed into music notation (with Lilypond), sound (with Csound), and Strasheela code (archived score objects).

Args:
outname (default out): name under which this action appears in the Explorer menu; and beginning of resulting file names (which get added the space number in the Explorer and then the current time).
renderAndShowLilypond (default HS.out.renderAndShowLilypond): binay procedure for outputting the result to Lilypond with the interface {RenderAndShowLilypond MyScore Args}.
prefix (default "declare \nChordSeq \n= {Score.makeScore\n"): VS added at the beginning of the resulting Lilypond file.
chordsToScore (default HS.score.chordsToScore): ternary procedure implementing the CSP used internally for creating the notes for the given chords. Interface: {ChordsToScore ChordSpecs Args ?ScoreWithNotes}.
Further, all args of chordsToScore are supported.


IMPORTANT: Args.chordsToScore typically conducts a search which potentially can fail (e.g., if insufficient arguments are provided)!



fun{MakeNoteToFomusClause Args}
MakeNoteToFomusClause adds support for HS notes (instances of class HS.score.pitchClassMixin) to Fomus export with customisable enharmonic notation. More specifically, it returns a clause that can be appended to the given to the argument eventClauses of Out.renderFomus and friends.

Args:
'table' (default FomusPCs_Default): a tuplet that maps pitch classes (ints) to Fomus pitch classes (strings or atoms of symbolic note names). A valid Fomus pitch class consists of a nominal and a Fomus accidental (e.g., 'Cn' or 'C#'). Note, if 'getPitchClass' is set to 'midi', then table must have entries for PCs 0-12 (0 and 12 are 'Cn').
'getSettings': unary function that expects the processed note and returns a record of fomus settings. This function can be used to arbitrarily customise the notation of each note depending on the note itself (only standard note settings like time etc cannot be overwritten).
'getPitchClass' (either pc or midi, default pc): specification how the pitch class is accessed that is used as index into table. If 'pc' the note's pitch class is used, if 'midi' this value depends on the note's pitchInMidi.


fun{MakeChordToFomusClause Args}
MakeChordToFomusClause adds support for HS chord objects to Fomus export with customisable enharmonic notation. More specifically, it returns a clause that can be appended to the given to the argument eventClauses of Out.renderFomus and friends.
MakeChordToFomusClause expects Table, a tuplet that maps pitch classes (ints) to Fomus pitch classes (strings or atoms of symbolic note names). A valid Fomus pitch class consists of a nominal and a Fomus accidental (e.g., 'Cn' or 'C#'). See functors like ET31.out for table examples.

Args:
'table' (default FomusPCs_Default): a tuplet that maps pitch classes (ints) to Fomus pitch classes (strings or atoms of symbolic note names). A valid Fomus pitch class consists of a nominal and a Fomus accidental (e.g., 'Cn' or 'C#').

'getSettings': unary function that expects the processed chord and returns a record of fomus settings. This function can be used to arbitrarily customise the notation of each root note depending on the note itself (only standard settings like time etc cannot be overwritten).


fun{MakeScaleToFomusClause Args}
MakeScaleToFomusClause adds support for HS scale objects to Fomus export with customisable enharmonic notation. See MakeChordToFomusClause for more information.
*/
TODO: sequence of grace notes with the following approach -- enable if Fomus supports these properly.
/*
time 0 dur 1/4
grace 0 pitch 50 ;
grace + pitch 53 ;
grace + pitch 56 ;
time 0 dur 1/2 pitch 59 ;

fun{VsToFomusForLilyMarks VS Args}
[markup function] Expects a VS and returns a Fomus settings record with this VS as a Lilypond markup.

Args:
'where' (default 'below'): atom where to position markup, either 'above' or 'below'.


fun{VsToFomusMarks VS Args}
[markup function] Expects a VS and returns a Fomus markup record.

Args:
'where' (default 'x'): atom in Fomus syntax where to position the VS (e.g., 'x', 'x^', 'x_' or 'x!', see http://fomus.sourceforge.net/doc.html/Articulation-Markings-_0028File_0029.html#Articulation-Markings-_0028File_0029).


fun{AppendFomusMarks Mark1 Mark2}
[Note markup function] Expects two Fomus markup records (e.g., unit(marks: ['x "x"']), the value returned by MakeNonChordTone_FomusMarks) and returns a single record with those marks combined.


fun{MakeCentOffset_FomusMarks MyNote}
[Note markup function] Expects a note and returns a fomus settings record. The different of the pitch of MyNote and the closest 12-TET is annotated in cent.
TODO: make accuracy argument. Currently accuracy is in cent (i.e. integer) to simplify the notation.


fun{MakeNonChordTone_FomusMarks MyNote}
[Note markup function] Expects a note and returns a fomus settings record. Non-harmonic tones are marked with an x, and for all other score objects unit (no settings) is returned.


fun{MakeAdaptiveJI_FomusForLilyMarks MyNote}
[Note markup function] Expects a note and returns a fomus settings record with a 'lily-insert' VS that prints the adaptive JI pitch offset of this note in cent. For all other score objects nil is returned.

Note that Lilypond does not necessarily preserve the order marks for multiple parts per staff.


fun{MakeAdaptiveJI2_FomusForLilyMarks MyNote}
[Note markup function] Expects a note and returns a fomus settings record with a 'lily-insert' VS that prints the adaptive JI pitch offset of this note and additionally the absolute pitch in cent. For all other score objects nil is returned.

Note that Lilypond does not necessarily preserve the order marks for multiple parts per staff.


fun{MakeChordComment_FomusForLilyMarks MyChord}
[Chord markup function] Expects a chord and returns the chord comment (a fomus settings record with a 'lily-insert' VS). For all other score objects nil is returned.


fun{MakeChordRatios_FomusForLilyMarks MyChord}
fun{MakeComment_FomusMarks MyChord}
[Chord markup function] Expects a chord or scale and returns the chord/scale comment in a fomus mark. For all other score objects nil is returned (Is it??).


fun{MakeChordRatios_FomusMarks MyChord}
fun{MakeScaleComment_FomusForLilyMarks MyScale}
[Scale markup function] Expects a scale and returns the scale comment (a fomus settings record with a 'lily-insert' VS). For all other score objects nil is returned.


proc{RenderAndShowLilypond MyScore Args}
HS.out.renderAndShowLilypond is a variant of Out.renderAndShowLilypond that additionally notates chord and scale objects and also supports different temperaments beyond 12 ET.

Args:

'pitchUnit': a pitch unit atom for which the Lilypond output is defined.
'pcsLilyNames' (default pcs(0:c 1:cis 2:d 3:'dis' 4:e 5:f 6:fis 7:g 8:gis 9:a 10:ais 11:b)): tuple of atomes that assigns to each pitch class of the temperament a Lilypond pitch name. The width of the tuple should correspond to the pitch unit.
'upperMarkupMakers' (default [MakeNonChordTone_LilyMarkup]): a list of unary functions (markup makers) for creating textual markup placed above the staff over a given score object. Each markup function expects a score object and returns a VS. There exist four cases of score objects for which markup can be applied: note objects in general, note objects in simultaneous containers of notes (notated as a chord in Lilypond), chord objects and scale objects. The definition of each markup function must care for all these cases (e.g., with an if expression test whether the input is a note object and then create some VS or alternatively create the empty VS nil).
'lowerMarkupMakers' (default [MakeChordComment_LilyMarkup MakeScaleComment_LilyMarkup]): same as 'upperMarkupMakers', but for markups placed below the staff.
'codeBeforeNoteMakers' (default nil): list of unary functions for creating Lilypond code placed directly before a note. Each function expects a score object and returns a VS. There exist three cases of score objects for which markup can be applied: note objects in general, notes in simultaneous containers of notes (notated as a chord in Lilypond), and Strasheela chord/scale objects (the resulting Lilypond code is placed before the chord/scale root). The definition of each function must care for these cases.
'codeBeforePcCollectionMakers' (default nil): list of binary functions for creating Lilypond code placed directly before a Lilypond note that is part of a Lilypond representation of a Strasheela chord/scale pitch class. Each function expects a chord/scale object and a pitch class; it returns a VS.

In addition, the arguments of Out.renderAndShowLilypond are supported.

Please note that HS.out.renderAndShowLilypond is defined by providing Out.renderAndShowLilypond the argument Clauses -- additional clauses are still possible, but adding new note/chord clauses will overwrite the support for defined by this procedure.



fun{MakeNonChordTone_LilyMarkup MyNote}
[Note markup function] Expects a note and returns a VS. For harmonic tones the VS is " " and for non-harmonic tones "x". For all other score objects nil is returned.


fun{MakeAdaptiveJI_Marker MyNote}
[Note markup function] Expects a note and returns a VS that prints the adaptive JI pitch offset of this note in cent. For all other score objects nil is returned.

Note that Lilypond does not necessarily preserve the order marks for multiple parts per staff.


fun{MakeAdaptiveJI2_Marker MyNote}
[Note markup function] Expects a note and returns a VS that prints the adaptive JI pitch offset of this note and additionally the absolute pitch in cent. For all other score objects nil is returned.

Note that Lilypond does not necessarily preserve the order marks for multiple parts per staff.


proc{MakeChordComment_LilyMarkup MyChord Result}
[Chord markup function] Expects a chord and returns the chord comment (a VS). For all other score objects nil is returned.


proc{MakeChordRatios_LilyMarkup MyChord Result}
proc{MakeScaleComment_LilyMarkup MyScale Result}
[Scale markup function] Expects a scale and returns the scale comment (a VS). For all other score objects nil is returned.


fun{MakeNoteToLily Args}
fun{MakeSimToLilyChord Args}
Outputs Sim (for which IsLilyChord must return true) as a Lilypond chord VS.



fun{MakePcCollectionToLily Args}
Creates Lilypond output (VS) for a PC collection (chord or scale). The PC collection's duration and root is notated by a single a note, all pitch classes as grace notes are following.


fun{Pc2RatioVS MyPC}
Transforms the pitch class MyPC into a ratio VS. Alternative ratio transformations are given (written like 1/2|1/3). If no transformation existists, 'n/a' is output.
NOTE: transformation uses the current interval database, so it only works for interval databases defined with rations. Also, because just intonation interval interpretations for intervals of a temperament are ambiguous the returned ratio may be missleading..


End