FoscLilypondLiteral

Returns a FoscLilypondLiteral.


Description

a LilyPond literal

FIXME: examples with FoscSlur do not compile


Attributes Summary

Class Methods

*allowableFormatSlots Lists allowable format slots.

Instance Properties

directed Is true when literal is directed.
formatSlot Gets format slot of LilyPond literal.
string Gets LilyPond literal string.
tweaks Gets tweaks.

Instance Methods: Special Methods

format Formats Lilypond literal.


Usage

  1. Dotted slur.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/8]));
    m = FoscSlur();
    a[0..].attach(m);
    l = FoscLilypondLiteral("\\slurDotted");
    a[0].attach(l);
    a.show;
  2. Use the absolute before and absolute after format slots like this.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/8]));
    l = FoscLilypondLiteral("% before all formatting", formatSlot: 'absoluteBefore');
    a[0].attach(l);
    l = FoscLilypondLiteral("% after all formatting", formatSlot: 'absoluteAfter');
    a[3].attach(l);
    a.format;
    \new Staff {
        % before all formatting
        c'8
        d'8
        e'8
        f'8
        % after all formatting
    }
  3. Lilypond literals can be tagged.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/8]));
    m = FoscSlur();
    a[0..].attach(m);
    l = FoscLilypondLiteral("\\slurDotted");
    a[0].attach(l, tag: 'RED');
    a.format;
  4. Multi-line input is allowed.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/8]));
    l = FoscLilypondLiteral(#[
        "\\stopStaff",
        "\\startStaff",
        "\\once \\override Staff.StaffSymbol.transparent = ##t"
    ]);
    a[2].attach(l);
    a.show;


Class Methods


*allowableFormatSlots

Lists allowable format slots.

  1. Example

    FoscLilypondLiteral.allowableFormatSlots.postln;
    [ 'absoluteAfter', 'absoluteBefore', 'after', 'before', 'closing', 'opening', 'right' ]


Instance Properties


directed

Is true when literal is directed.

  1. Directed literal.

    l = FoscLilypondLiteral("\\f", 'after', directed: true);
    l.directed.postln;
    true
  2. Nondirected literal.

    l = FoscLilypondLiteral("\\breathe", 'after', directed: false);
    l.directed.postln;
    false


formatSlot

Gets format slot of LilyPond literal.

Returns string.

  1. Example

    a = FoscLilypondLiteral(\slurDotted);
    a.formatSlot.postln;
    'opening'


string

Gets LilyPond literal string.

  1. Example

    l = FoscLilypondLiteral("\\slurDotted");
    l.string.postln;
    \slurDotted


tweaks

Gets tweaks.

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    l = FoscLilypondLiteral("\\f", 'after', directed: true, tweaks: #[['color', 'red']]);
    a[0].attach(l);
    a.show;


Instance Methods: Special Methods


format

Formats Lilypond literal.