Next: , Previous: Backend, Up: Top



Scheme functions

— Function: Apply_context_iterator::constructor

Construct a Apply_context_iterator music iterator

— Function: Auto_change_iterator::constructor

Construct a Auto_change_iterator music iterator

— Function: Bar_check_iterator::constructor

Construct a Bar_check_iterator music iterator

— Function: Change_iterator::constructor

Construct a Change_iterator music iterator

— Function: Chord_tremolo_iterator::constructor

Construct a Chord_tremolo_iterator music iterator

— Function: Context_specced_music_iterator::constructor

Construct a Context_specced_music_iterator music iterator

— Function: Event_chord_iterator::constructor

Construct a Event_chord_iterator music iterator

— Function: Folded_repeat_iterator::constructor

Construct a Folded_repeat_iterator music iterator

— Function: Grace_iterator::constructor

Construct a Grace_iterator music iterator

— Function: Lyric_combine_music_iterator::constructor

Construct a Lyric_combine_music_iterator music iterator

— Function: Music_iterator::constructor

Construct a Music_iterator music iterator

— Function: Music_wrapper_iterator::constructor

Construct a Music_wrapper_iterator music iterator

— Function: Output_property_music_iterator::constructor

Construct a Output_property_music_iterator music iterator

— Function: Part_combine_music_iterator::constructor

Construct a Part_combine_music_iterator music iterator

— Function: Percent_repeat_iterator::constructor

Construct a Percent_repeat_iterator music iterator

— Function: Pop_property_iterator::constructor

Construct a Pop_property_iterator music iterator

— Function: Property_iterator::constructor

Construct a Property_iterator music iterator

— Function: Property_unset_iterator::constructor

Construct a Property_unset_iterator music iterator

— Function: Push_property_iterator::constructor

Construct a Push_property_iterator music iterator

— Function: Sequential_iterator::constructor

Construct a Sequential_iterator music iterator

— Function: Sequential_music_iterator::constructor

Construct a Sequential_music_iterator music iterator

— Function: Simple_music_iterator::constructor

Construct a Simple_music_iterator music iterator

— Function: Simultaneous_music_iterator::constructor

Construct a Simultaneous_music_iterator music iterator

— Function: Time_scaled_music_iterator::constructor

Construct a Time_scaled_music_iterator music iterator

— Function: Unfolded_repeat_iterator::constructor

Construct a Unfolded_repeat_iterator music iterator

— Function: Volta_repeat_iterator::constructor

Construct a Volta_repeat_iterator music iterator

— Function: ly:add-interface a b c

Add an interface description.

— Function: ly:add-moment a b

Add two moments.

— Function: ly:all-grob-interfaces

Get a hash table with all interface descriptions.

— Function: ly:bracket a iv t p

Make a bracket in direction a. The extent of the bracket is given by iv. The wings protude by an amount of p, which may be negative. The thickness is given by t.

— Function: ly:context-parent context

Return the parent of context, #f if none.

— Function: ly:context-properties context

Return all properties of context in an alist.

— Function: ly:context-property-where-defined context name

Return the context above context where name is defined.

— Function: ly:context-pushpop-property context grob eltprop val

Do a single \override or \revert operation in context. The grob definition grob is extended with eltprop (if val is specified) or reverted (if unspecified).

— Function: ly:context? x

Type predicate: is x a context?

— Function: ly:dimension? d

Return d is a number. Used to distinguish length variables from normal numbers.

— Function: ly:dir? s

type predicate. A direction is a -1, 0 or 1, where -1 represents left or down and 1 represents right or up.

— Function: ly:div-moment a b

Divide two moments.

— Function: ly:duration-dot-count dur

Extract the dot count from dur

— Function: ly:duration-factor dur

Extract the compression factor from dur. Return as a pair.

— Function: ly:duration-log dur

Extract the duration log from dur

— Function: ly:duration<? p1 p2

Is p1 shorter than p2?

— Function: ly:duration? x

Check if x is a Duration object

— Function: ly:export arg

Export a Scheme object to the parser, so it is treated as an identifier.

— Function: ly:find-glyph-by-name font name

This function retrieves a Molecule for the glyph named name in font. The font must be available as an AFM file. If the glyph is not found, #f is returned.

— Function: ly:font-metric? x

Check if x is a Font_metric object

— Function: ly:fontify-atom met f

Add a font selection command for the font metric met to f.

— Function: ly:get-all-function-documentation

Get a hash table with all lilypond Scheme extension functions.

— Function: ly:get-all-translators

Return an list of a all translator objects that may be instantiated during a lilypond run.

— Function: ly:get-broken-into spanner

Return broken-into list for spanner.

— Function: ly:get-context-property context name

retrieve the value of name from context context

— Function: ly:get-default-font grob

Return the default font for grob gr.

— Function: ly:get-extent grob refp axis

Get the extent in axis direction of grob relative to the grob refp

— Function: ly:get-glyph font index

This function retrieves a Molecule for the glyph numbered index in font.

— Function: ly:get-grob-property grob sym

Get the value of a value in grob g of property sym. It will return '() (end-of-list) if g doesn't have sym set.

Grob properties are stored as GUILE association lists, with symbols as keys. All lookup functions identify undefined properties with end-of-list (i.e. '() in Scheme or SCM_EOL in C)

Properties are stored in two ways:

— Function: ly:get-mus-property mus sym

Get the property sym of music expression mus. If sym is undefined, return '().

— Function: ly:get-music-length mus

Get the length (in musical time) of music expression mus.

— Function: ly:get-mutable-properties mus

Return an alist signifying the mutable properties of mus. The immutable properties are not available; they should be initialized by the functions make-music-by-name function.

— Function: ly:get-option var

Get a global option setting. Supported options include

old-relative-used
Report whether old-relative compatibility mode is necessary
old-relative
Report whether old-relative compatibility mode is used
verbose
Report whether we are running in verbose mode
— Function: ly:get-original grob

Return the original Grob of grob

— Function: ly:get-paper-variable grob sym

Get a variable from the \paper block.

— Function: ly:get-parent grob axis

Get the parent of grob. axis is 0 for the X-axis, 1 for the Y-axis.

— Function: ly:get-spanner-bound slur dir

Get one of the bounds of spanner. dir is -1 for left, and 1 for right.

— Function: ly:get-system grob

Return the System Grob of grob.

— Function: ly:grob-paper grob

Get \paper definition from a grob.

— Function: ly:grob-pq-less? a b

Compare 2 Grob PQ entries. Internal

— Function: ly:grob-script-priority-less a b

Compare two grobs by script priority. For internal use.

— Function: ly:grob-staff-position sg

Return the Y-position of this grob relative to the staff.

— Function: ly:grob-suicide g

Kill g.

— Function: ly:grob-translate-axis! g d a

Translate g on axis a over distance d.

— Function: ly:grob? x

Check if x is a Grob object

— Function: ly:gulp-file name

Read the file named name, and return its contents in a string. The file is looked up using the lilypond search path.

— Function: ly:input-location? x

Return whether x is an input location

— Function: ly:input-message sip msg

Print msg as a GNU compliant error message, pointing to the location in sip.

— Function: ly:intlog2 d

The 2-logarithm of 1/d.

— Function: ly:iterator? x

Check if x is a Music_iterator object

— Function: ly:make-bare-music type props

Make a music object/expression of type type, init with props. Warning: this interface will likely change in the near future.

Music is the data type that music expressions are stored in. The data type does not yet offer many manipulations.

WARNING: only for internal use. Please use make-music-by-name.

— Function: ly:make-duration length dotcount num den

length is the negative logarithm (base 2) of the duration: 1 is a half note, 2 is a quarter note, 3 is an eighth note, etc. The number of dots after the note is given by dotcount.

The duration factor is optionally given by num and den.

A duration is a musical duration, i.e. a length of time described by a power of two (whole, half, quarter, etc.) and a number of augmentation dots.

— Function: ly:make-molecule expr xext yext

The objective of any typesetting system is to put ink on paper in the right places. For LilyPond, this final stage is left to the TeX and the printer subsystem. For lily, the last stage in processing a score is outputting a description of what to put where. This description roughly looks like

                  PUT glyph AT (x,y)
                  PUT glyph AT (x,y)
                  PUT glyph AT (x,y)
     

you merely have to look at the tex output of lily to see this. Internally these instructions are encoded in Molecules.1 A molecule is what-to-print-where information that also contains dimension information (how large is this glyph?).

Conceptually, Molecules can be constructed from Scheme code, by translating a Molecule and by combining two molecules. In BNF notation:

          Molecule  :: COMBINE Molecule Molecule
                     | TRANSLATE Offset Molecule
                     | GLYPH-DESCRIPTION
                     ;
     

If you are interested in seeing how this information is stored, you can run with the -f scm option. The scheme expressions are then dumped in the output file.

— Function: ly:make-moment n d

create the rational number with main timing n/d.

Moment is a point in musical time. It is consists of a pair of rationals (m,g), where m is the timing for the main notes, and g the timing for grace notes. In absence of grace notes, g is zero.

— Function: ly:make-pitch o n a

octave is specified by an integer, zero for the octave containing middle C. note is a number from 0 to 6, with 0 corresponding to C and 6 corresponding to B. The shift is zero for a natural, negative for flats, or positive for sharps.

— Function: ly:molecule-add args

Combine molecules. Takes any number of arguments.

— Function: ly:molecule-align-to! mol axis dir

Align mol using its own extents. dir is a number -1, 1 are left and right respectively. Other values are interpolated (so 0 means the center.

— Function: ly:molecule-combine-at-edge first axis direction second padding minimum

Construct a molecule by putting second next to first. axis can be 0 (x-axis) or 1 (y-axis), direction can be -1 (left or down) or 1 (right or up). The molecules are juxtaposed with padding as extra space. If this puts the reference points closer than minimum, they are moved by the latter amount.

— Function: ly:molecule-get-extent mol axis

Return a pair of numbers signifying the extent of mol in axis direction (0 or 1 for x and y axis respectively).

— Function: ly:molecule-set-extent! mol axis np

Set the extent (extent must be a pair of numbers) of mol in axis direction (0 or 1 for x- and y-axis respectively).

Note that an extent (A . B) is an interval and hence A is smaller than B, and is often negative.

— Function: ly:molecule-translate mol offset

Return a mol, but translated by offset (a pair of numbers).

— Function: ly:molecule-translate-axis mol amount axis

Return a mol, but translated by amount in axis direction

— Function: ly:molecule? x

Check if x is a Molecule object

— Function: ly:moment? x

Check if x is a Moment object

— Function: ly:mul-moment a b

Multiply two moments.

— Function: ly:music-deep-copy m

Copy m and all sub expressions of m

— Function: ly:music-duration-compress mus factor

Extract the duration field from mus, and compress it.

— Function: ly:music-duration-length mus

Extract the duration field from mus, and return the length.

— Function: ly:music-name mus

Return the name of music.

— Function: ly:music-transpose m p

Transpose m such that central C is mapped to p. Return m.

— Function: ly:music? x

Check if x is a Music object

— Function: ly:number->string s

converts num to a string without generating many decimals. It leaves a space at the end.

— Function: ly:option-usage

Print ly-set-option usage

— Function: ly:paper-get-font paper chain

Return a font metric satisfying the font-qualifiers in the alist chain chain.

The font object represents the metric information of a font. Every font that is loaded into LilyPond can be accessed via Scheme.

LilyPond only needs to know the dimension of glyph to be able to process them. This information is stored in font metric files. LilyPond can read two types of font-metrics: TeX Font Metric files (TFM files) and Adobe Font Metric files (AFM files). LilyPond will always try to load AFM files first since they are more versatile.

An alist chain is a list of alists, containing grob properties.

— Function: ly:paper-lookup pap sym

Lookup sym in pap. Return the value or '() if undefined.

— Function: ly:pitch-alteration pp

extract the alteration from pitch p.

— Function: ly:pitch-diff pitch root

Return pitch with value DELTA = PITCH - ROOT, ie, ROOT == (ly:pitch-transpose root delta).

— Function: ly:pitch-notename pp

extract the note name from pitch pp.

— Function: ly:pitch-octave pp

extract the octave from pitch p.

— Function: ly:pitch-quartertones pp

calculate the number of semitones of p from central C.

— Function: ly:pitch-semitones pp

calculate the number of semitones of p from central C.

— Function: ly:pitch-steps p

Number of steps counted from central C of the pitch p.

— Function: ly:pitch-transpose p delta

Transpose p by the amount delta, where delta is the pitch that central C is transposed to.

— Function: ly:pitch<? p1 p2

Is p1 lower than p2? This uses lexicographic ordening.

— Function: ly:pitch? x

Check if x is a Pitch object

— Function: ly:round-filled-box xext yext blot

Make a filled-box of dimensions xext, yext and roundness blot.

— Function: ly:set-context-property! context name val

set value of property name in context context to val.

— Function: ly:set-grob-property! grob sym val

Set sym in grob grob to value val

— Function: ly:set-mus-property! mus sym val

Set property sym in music expression mus to val.

— Function: ly:set-option var val

Set a global option value. Supported options include

help
List all options.
midi-debug
If set to true, generate human readable MIDI
internal-type-checking
Set paranoia for property assignments
parse-protect
If protection is switched on, errors in inline scheme are caught in the parser. If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation.
old-relative
Relative for simultaneous functions similar to chord syntax
new-relative
Relative for simultaneous functions similar to sequential music

This function is useful to call from the command line: lilypond -e "(ly-set-option 'midi-debug #t_)".

— Function: ly:set-point-and-click what

Set the options for Point-and-click source specials output. The argument is a symbol. Possible options are none (no source specials), line and line-column

— Function: ly:text-dimension font text

Given the font metric in font and the string text, compute the extents of that text in that font. The return value is a pair of number-pairs.

— Function: ly:translator-description me

Return an alist of properties of translator me.

— Function: ly:translator-find context name

Find a parent of context that has name or alias name. Return #f if not found.

— Function: ly:translator-name trans

Return the type name of the translator trans.

— Function: ly:translator? x

Check if x is a Translator object

— Function: ly:transpose-key-alist l pitch

Make a new key alist of l transposed by pitch pitch

— Function: ly:unit

Return the unit used for lengths as a string.

— Function: ly:unset-context-property context name

Unset value of property name in context context.

— Function: ly:version

Return the current lilypond version as a list, e.g. (1 3 127 uu1).

— Function: ly:warn str

Scheme callable function to issue the warning msg.

— Function: music-list? l

Type predicate: return true if l is a list of music objects.


Footnotes

[1] At some point LilyPond also contained Atom-objects, but they have been replaced by Scheme expressions, making the name outdated.


This page is for LilyPond-2.0.3 (stable-branch).
Report errors to <bug-lilypond@gnu.org>.