songleaf.engrave¶
Score snippets engraved by Verovio: the score extra (pip install songleaf[score]).
The default snippet provider (songleaf.snippets.abc_snippet()) draws a
short ABC subset with reportlab lines. With this extra, engraved_snippet()
engraves the notation recorded on the song’s score annotation properly
(clef, key and time signatures, beams, ties, chord names) from ABC (a body, or a
whole tune with its header), MusicXML or MEI: Verovio renders it to SVG, and
svglib turns the SVG into a reportlab drawing placed on the sheet.
songleaf.snippets.default_provider() prefers this provider when the extra
is installed. Nothing here touches the network: the notation is the text stored
on the song.
Both libraries are LGPL-3.0 and only imported when a snippet is drawn.
Module Attributes
The notation formats Verovio reads here, as recorded in a score annotation's |
|
Notation longer than this is not engraved (a snippet is a few bars). |
|
Verovio's half staff space, in its units at scale 100 (its default). |
|
the same eighth-note unit as the subset. |
Functions
|
notation as a whole ABC tune: a body with no |
Whether the |
|
|
The SVG of notation ( |
|
The provider: the song's first |
|
A |
- songleaf.engrave.ABC_HEADER = 'X:1\nL:1/8\nK:C\n'¶
the same eighth-note unit as the subset.
- Type:
The header given to an ABC body with none
- songleaf.engrave.ENGRAVE_FORMATS = {'abc': 'abc', 'mei': 'mei', 'musicxml': 'musicxml'}¶
The notation formats Verovio reads here, as recorded in a score annotation’s
format.
- songleaf.engrave.MAX_ENGRAVE_CHARS = 200000¶
Notation longer than this is not engraved (a snippet is a few bars).
- songleaf.engrave.VEROVIO_UNIT = 9¶
Verovio’s half staff space, in its units at scale 100 (its default).
- songleaf.engrave.as_abc_tune(notation)[source]¶
notation as a whole ABC tune: a body with no
X:header getsABC_HEADER.- Return type:
- songleaf.engrave.available()[source]¶
Whether the
scoreextra (verovio, svglib) is installed.- Return type:
- songleaf.engrave.engrave_svg(notation, format='abc')[source]¶
The SVG of notation (
format: a key ofENGRAVE_FORMATS), cropped to the music.- Return type:
- songleaf.engrave.engraved_snippet(song)[source]¶
The provider: the song’s first
scoreannotation with notation Verovio reads, engraved.Nonewhen there is none, or when it cannot be engraved (the sheet is then drawn without it).- Return type: