FoscMarkup

Returns a FoscMarkup.


Description

LilyPond markup.

!!!TODO: write a parser - see abjad source


Attributes Summary

Class Methods

*abjadMetronomeMark
*centerColumn LilyPond \center-column markup command.
*column LilyPond \column markup command.
*combine LilyPond \combine markup command.
*concat !!!TODO
*drawCircle LilyPond \draw-circle markup command.
*drawLine LilyPond \draw-line markup command.
*filledBox LilyPond filled-box markup command.
*flat LilyPond \flat markup command.
*fromLiteral !!!TODO: once parser is written
*fraction LilyPond \fraction markup command.
*hspace LilyPond \hspace markup command.
*leftColumn LilyPond \left-column markup command.
*line LilyPond \line markup command.
*makeImproperFractionMarkup Makes improper fraction markup.
*musicGlyph LilyPond \musicglyph markup command.
*natural LilyPond \natural markup command.
*noteByNumber LilyPond \note-by-number markup command.
*null LilyPond \null markup command.
*overlay !!!TODO: broken here and in abjad. Has been deprecated from lilypond?
*postscript LilyPond \postscript markup command.
*rightColumn LilyPond \right-column markup command.
*sharp LilyPond \sharp markup command.
*triangle LilyPond \triangle markup command.
*vspace LilyPond \vspace markup command.

Instance Properties

contents Gets contents of markup.
direction Gets direction of markup.
literal !!!TODO: when parser is written
tweak Gets tweaks.

Instance Methods: Special Methods

++ (abjad: add)
copy Copies markup.
== (abjad: eq)
asCompileString !!!TODO:INCOMPLETE
format Formats markup.
illustrate Illustrates markup.
< Is true when markup contents compare less than argument contents.
str (abjad: str)

Instance Methods

bold LilyPond \bold markup command.
box LilyPond \box markup command.
bracket LilyPond \bracket markup command.
caps LilyPond \caps markup command.
centerAlign LilyPond \center-align markup command.
circle LilyPond \circle markup command.
dynamic LilyPond \dynamic markup command.
finger LilyPond \finger markup command.
fontSize LilyPond \fontsize markup command.
generalAlign LilyPond \general-align markup command.
halign LilyPond halign markup command.
hcenterIn LilyPond \hcenter-in markup command.
huge LilyPond \huge markup command.
italic LilyPond \italic markup command.
larger LilyPond \larger markup command.
override LilyPond \override markup command.
padAround LilyPond \pad-around markup command.
padMarkup LilyPond \pad-markup markup command.
padToBox LilyPond pad-to-box markup command.
parenthesize LilyPond \parenthesize markup command.
raise LilyPond \raise markup command.
rotate LilyPond \rotate markup command.
sans LilyPond \sans markup command.
scale LilyPond \scale markup command.
small LilyPond \small markup command.
smaller LilyPond \smaller markup command.
sub LilyPond \sub markup command.
super LilyPond \super markup command.
tiny LilyPond \tiny markup command.
translate LilyPond translate markup command.
upright LilyPond \upright markup command.
vcenter LilyPond \vcenter markup command.
whiteout LilyPond \whiteout markup command.
withColor LilyPond \with-color markup command.
withDimensions


Usage

  1. Initialize from string.

    m = FoscMarkup("And one and two and three.");
    m.format;
    m.show;

  2. Initialize from array.

    m = FoscMarkup(["\\italic", "Allegro assai"]);
    m.format;
    \markup {
        \italic
        "Allegro assai"
    }
  3. Initialize from markup.

    m = FoscMarkup("And one and two and three.");
    m = FoscMarkup(m);
    m.format;
    \markup { "And one and two and three." }
  4. Attach markup to score components.

    m = FoscMarkup(["\\italic", "Allegro assai"], 'up');
    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    a[0].attach(m);
    a.show;

  5. Markups can be tweaked.

    m = FoscMarkup(["\\italic", "Allegro assai"], 'up');
    tweak(m).color = 'blue';
    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    a[0].attach(m);
    a.show;


Class Methods


*abjadMetronomeMark


*centerColumn

LilyPond \center-column markup command.

Returns new markup.

  1. Example

    a = FoscMarkup("Los Angeles");
    b = FoscMarkup("May - August 2014");
    m = FoscMarkup.centerColumn([a, b]);
    m.show;


*column

LilyPond \column markup command.

Returns new markup.

  1. Example 1

    a = FoscMarkup("Los Angeles");
    b = FoscMarkup("May - August 2014");
    m = FoscMarkup.column([a, b]);
    m.show;


*combine

LilyPond \combine markup command.

Returns new markup.

Example 1

code:: a = FoscMarkup(“Allegro assai”); b = FoscMarkup.drawLine(13, 0); m = FoscMarkup.combine([a, b]); m.show;

img::

  1. • *combine

    LilyPond \combine markup command.

    Returns new markup.

    Example 1

    a = FoscMarkup("Allegro assai");
    b = FoscMarkup.drawLine(13, 0);
    m = FoscMarkup.combine([a, b]);
    m.show;


*concat

!!!TODO

LilyPond \concat markup command.

Returns new markup.

Example 1

code:: a = FoscMarkup.musicGlyph(‘scripts.downbow’); b = FoscMarkup.hspace(1); c = FoscMarkup.musicGlyph(‘scripts.upbow’); m = FoscMarkup.concat([a, b, c]); m.show;

img::

  1. • *concat !!!TODO

    LilyPond \concat markup command.

    Returns new markup.

    Example 1

    a = FoscMarkup.musicGlyph('scripts.downbow');
    b = FoscMarkup.hspace(1);
    c = FoscMarkup.musicGlyph('scripts.upbow');
    m = FoscMarkup.concat([a, b, c]);
    m.show;


*drawCircle

LilyPond \draw-circle markup command.

Returns new markup

Example 1

code:: m = FoscMarkup.drawCircle(10, 1.5); m.show;

img::

  1. • *drawCircle

    LilyPond \draw-circle markup command.

    Returns new markup

    Example 1

    m = FoscMarkup.drawCircle(10, 1.5);
    m.show;


*drawLine

LilyPond \draw-line markup command.

Returns new markup

Example 1

code:: m = FoscMarkup.drawLine(5, -2.5); m.show;

img::

  1. • *drawLine

    LilyPond \draw-line markup command.

    Returns new markup

    Example 1

    m = FoscMarkup.drawLine(5, -2.5);
    m.show;


*filledBox

LilyPond filled-box markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.filledBox(#[0,10], #[2,5], 1.5); m.show;

img::

  1. • *filledBox

    LilyPond filled-box markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.filledBox(#[0,10], #[2,5], 1.5);
    m.show;


*flat

LilyPond \flat markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.flat; m.show;

img::

  1. • *flat

    LilyPond \flat markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.flat;
    m.show;


*fromLiteral

!!!TODO: once parser is written

  1. • *fromLiteral

    !!!TODO: once parser is written


*fraction

LilyPond \fraction markup command.

Returns new markup

Example 1

code:: m = FoscMarkup.fraction(1, 4); m.show;

img::

  1. • *fraction

    LilyPond \fraction markup command.

    Returns new markup

    Example 1

    m = FoscMarkup.fraction(1, 4);
    m.show;

  2. p = “%/fosc/docs/img/markup-markup-16”.format(Platform.userExtensionDir);

    m.writePNG(“%.ly”.format(p));


*hspace

LilyPond \hspace markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.hspace(0.75); m.format;

  1. • *hspace

    LilyPond \hspace markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.hspace(0.75);
    m.format;
    \markup {
        \hspace
            #0.75
    }


*leftColumn

LilyPond \left-column markup command.

Returns new markup.

Example 1

code:: a = FoscMarkup(“Los Angeles”); b = FoscMarkup(“May - August 2014”); m = FoscMarkup.leftColumn([a, b]); m.show;

img::

  1. • *leftColumn

    LilyPond \left-column markup command.

    Returns new markup.

    Example 1

    a = FoscMarkup("Los Angeles");
    b = FoscMarkup("May - August 2014");
    m = FoscMarkup.leftColumn([a, b]);
    m.show;


*line

LilyPond \line markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.line(#[“Allegro”, “assai”]); m.show;

img::

  1. • *line

    LilyPond \line markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.line(#["Allegro", "assai"]);
    m.show;


*makeImproperFractionMarkup

Makes improper fraction markup.

!!!TODO

  1. • *makeImproperFractionMarkup

    Makes improper fraction markup.

    !!!TODO


*musicGlyph

LilyPond \musicglyph markup command.

Returns new markup.

!!!TODO: update call to LilypondMusicGlyphs when files in ly folder have been updated

Example 1

code:: m = FoscMarkup.musicGlyph(“accidentals.sharp”); m.show;

img::

  1. • *musicGlyph

    LilyPond \musicglyph markup command.

    Returns new markup.

    !!!TODO: update call to LilypondMusicGlyphs when files in ly folder have been updated

    Example 1

    m = FoscMarkup.musicGlyph("accidentals.sharp");
    m.show;


*natural

LilyPond \natural markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.natural; m.show;

img::

  1. • *natural

    LilyPond \natural markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.natural;
    m.show;


*noteByNumber

LilyPond \note-by-number markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.noteByNumber(log: 3, dotCount: 2, stemDirection: 1); m.show;

img::

  1. • *noteByNumber

    LilyPond \note-by-number markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.noteByNumber(log: 3, dotCount: 2, stemDirection: 1);
    m.show;


*null

LilyPond \null markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.null; m.format;

  1. • *null

    LilyPond \null markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.null;
    m.format;
    \markup {
        \null
    }


*overlay

!!!TODO: broken here and in abjad. Has been deprecated from lilypond?

LilyPond \overlay markup command.

Returns new markup.

Example 1

code:: a = FoscMarkup(“Los Angeles”); b = FoscMarkup(“May - August 2014”); m = FoscMarkup.overlay([a, b]); m.show;

img::

  1. • *overlay

    !!!TODO: broken here and in abjad. Has been deprecated from lilypond?

    LilyPond \overlay markup command.

    Returns new markup.

    Example 1

    a = FoscMarkup("Los Angeles");
    b = FoscMarkup("May - August 2014");
    m = FoscMarkup.overlay([a, b]);
    m.show;


*postscript

LilyPond \postscript markup command.

Returns new markup.

Example 1

code:: p = FoscPostscript(); p.moveto(1.0, 1.0); p.setlinewidth(2.5); p.lineto(3, -4); p.stroke; m = FoscMarkup.postscript(p); m.format; m.show;

img::

  1. • *postscript

    LilyPond \postscript markup command.

    Returns new markup.

    Example 1

    p = FoscPostscript();
    p.moveto(1.0, 1.0);
    p.setlinewidth(2.5);
    p.lineto(3, -4);
    p.stroke;
    m = FoscMarkup.postscript(p);
    m.format;
    m.show;


*rightColumn

LilyPond \right-column markup command.

Returns new markup.

Example 1

code:: a = FoscMarkup(“Los Angeles”); b = FoscMarkup(“May - August 2014”); m = FoscMarkup.rightColumn([a, b]); m.show;

img::

  1. • *rightColumn

    LilyPond \right-column markup command.

    Returns new markup.

    Example 1

    a = FoscMarkup("Los Angeles");
    b = FoscMarkup("May - August 2014");
    m = FoscMarkup.rightColumn([a, b]);
    m.show;


*sharp

LilyPond \sharp markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.sharp; m.show;

img::

  1. • *sharp

    LilyPond \sharp markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.sharp;
    m.show;


*triangle

LilyPond \triangle markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.triangle(isFilled: true); m.show;

img::

  1. • *triangle

    LilyPond \triangle markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.triangle(isFilled: true);
    m.show;


*vspace

LilyPond \vspace markup command.

Returns new markup.

Example 1

code:: m = FoscMarkup.vspace(0.75); m.format;

  1. • *vspace

    LilyPond \vspace markup command.

    Returns new markup.

    Example 1

    m = FoscMarkup.vspace(0.75);
    m.format;
    \markup {
        \vspace
            #0.75
    }


Instance Properties


contents

Gets contents of markup.

Returns array.

  1. Example

    m = FoscMarkup("Allegro");
    m.contents;
    [ "Allegro" ]


direction

Gets direction of markup.

Defaults to none.

Set to up, down, center or none.

Returns up, down, center or none.

  1. Example

    m = FoscMarkup("Allegro", direction:'-');
    m.direction;
    m.format;
    -\markup { Allegro }


literal

!!!TODO: when parser is written

Is true when markup formats contents literally.


tweak

Gets tweaks.

  1. Example

    m = FoscMarkup("Allegro assai", 'up');
    tweak(m).color = 'blue';
    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    a[0].attach(m);
    a.show;

  2. Example

    m = FoscMarkup("Allegro assai", 'up', tweaks: #[['color', 'blue']]);
    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    a[0].attach(m);
    a.show;


Instance Methods: Special Methods


++

(abjad: add)

Adds markup to argument.


copy

Copies markup.


==

(abjad: eq)

Is true markup equals argument.


asCompileString

!!!TODO:INCOMPLETE


format

Formats markup.

Returns string.


illustrate

Illustrates markup.

Returns LilyPond file.

  1. Example

    m = FoscMarkup("foo");
    m.illustrate;
    m.show;


<

Is true when markup contents compare less than argument contents.

Raises type error when argument is not markup.


str

(abjad: str)

Gets string representation of markup.

Returns string.

  1. Example

    FoscMarkup("Allegro assai").str;
    \markup { "Allegro assai" }


Instance Methods


bold

LilyPond \bold markup command.

Returns new markup.

  1. Example

    m = bold(FoscMarkup("Allegro assai"));
    m.show;


box

LilyPond \box markup command.

Returns new markup.

  1. Example

    m = box(FoscMarkup("Allegro assai", direction: 'up'));
    m = override(m, #['box-padding', 1]);
    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    a[0].attach(m);
    a.show;


bracket

LilyPond \bracket markup command.

Returns new markup.

  1. Example

    m = bracket(FoscMarkup("Allegro assai"));
    m.show;


caps

LilyPond \caps markup command.

Returns new markup.

  1. Example

    m = caps(FoscMarkup("Allegro assai"));
    m.show;


centerAlign

LilyPond \center-align markup command.

Returns new markup

  1. Example

    a = FoscMarkup("Allegro");
    b = centerAlign(FoscMarkup("non"));
    c = FoscMarkup("troppo");
    m = FoscMarkup.column([a, b, c]);
    m.show;


circle

LilyPond \circle markup command.

Returns new markup

  1. Example

    m = circle(FoscMarkup.fraction(3, 5));
    m = override(m, ['circle-padding', 0.5]);
    m.show;


dynamic

LilyPond \dynamic markup command.

Returns new markup.

  1. Example

    m = dynamic(FoscMarkup("sffz"));
    m.show;


finger

LilyPond \finger markup command.

Returns new markup

  1. Example

    m = finger(FoscMarkup(1));
    m.show;


fontSize

LilyPond \fontsize markup command.

Returns new markup.

  1. Example

    m = fontSize(FoscMarkup("Allegro assai"), -3);
    m.show;

  2. Example

    m = fontSize(FoscMarkup("Allegro assai"), 10);
    m.show;


generalAlign

LilyPond \general-align markup command.

Returns new markup.

  1. Example

    m = FoscMarkup("Allegro assai");
    m = m.generalAlign('Y', 'UP');
    m.format;
    \markup {
        \general-align
            #Y
            #UP
            "Allegro assai"
    }
  2. Example

    m = FoscMarkup("Allegro assai");
    m = m.generalAlign('Y', 0.75);
    m.format;
    \markup {
        \general-align
            #Y
            #0.75
            "Allegro assai"
    }


halign

LilyPond halign markup command.

Returns new markup.

  1. Example

    m = halign(FoscMarkup("Allegro assai"), 0);
    m.format;
    \markup {
        \halign
            #0
            "Allegro assai"
    }


hcenterIn

LilyPond \hcenter-in markup command.

Returns new markup.

  1. Example

    m = hcenterIn(FoscMarkup("Allegro assai"), 12);
    m.format;
    \markup {
        \hcenter-in
            #12
            "Allegro assai"
    }


huge

LilyPond \huge markup command.

Returns new markup.

  1. Example

    m = huge(FoscMarkup("Allegro assai"));
    m.show;


italic

LilyPond \italic markup command.

Returns new markup.

  1. Example

    m = italic(FoscMarkup("Allegro assai"));
    m.show;


larger

LilyPond \larger markup command.

Returns new markup.

  1. Example

    m = larger(FoscMarkup("Allegro assai"));
    m.show;


override

LilyPond \override markup command.

Returns new markup.

  1. Example

    m = parenthesize(FoscMarkup("Allegro assai"));
    m = override(m, ['padding', 0.75]);
    m.show;


padAround

LilyPond \pad-around markup command.

Returns new markup.

  1. Example

    m = padAround(FoscMarkup("Allegro assai"), 10);
    m.format;
    \markup {
        \pad-around
            #10
            "Allegro assai"
    }


padMarkup

LilyPond \pad-markup markup command.

Returns new markup.

  1. Example

    m = padMarkup(FoscMarkup("Allegro assai"), 10);
    m.format;
    \markup {
        \pad-markup
            #10
            "Allegro assai"
    }


padToBox

LilyPond pad-to-box markup command.

  1. Example

    m = padToBox(FoscMarkup("Allegro assai"), #[1,1], #[1,1]);
    m.format;
    \markup {
        \pad-to-box
            #'(1 . 1)
            #'(1 . 1)
            "Allegro assai"
    }


parenthesize

LilyPond \parenthesize markup command.

Returns new markup.

  1. Example

    m = parenthesize(FoscMarkup("Allegro assai"));
    m.show;


raise

LilyPond \raise markup command.

Returns new markup.

  1. Example

    m = raise(FoscMarkup("Allegro assai"), 0.35);
    m.format;
    \markup {
        \raise
            #0.35
            "Allegro assai"
    }


rotate

LilyPond \rotate markup command.

Returns new markup.

  1. Example

    m = rotate(FoscMarkup("Allegro assai"), 45);
    m.show;


sans

LilyPond \sans markup command.

Returns new markup.

  1. Example

    m = sans(FoscMarkup("Allegro assai"));
    m.show;


scale

LilyPond \scale markup command.

Returns new markup.

  1. Example

    m = FoscMarkup("Allegro assai");
    m = m.scale(#[0.75, 1.5]);
    m.show;


small

LilyPond \small markup command.

Returns new markup.

  1. Example

    m = small(FoscMarkup("Allegro assai"));
    m.show;


smaller

LilyPond \smaller markup command.

Returns new markup.

  1. Example

    m = smaller(FoscMarkup("Allegro assai"));
    m.show;


sub

LilyPond \sub markup command.

Returns new markup.

  1. Example

    a = [FoscMarkup("A"), sub(FoscMarkup("j"))];
    m = FoscMarkup.concat(a);
    m.show;


super

LilyPond \super markup command.

Returns new markup.

  1. Example

    a = [FoscMarkup("1"), super(FoscMarkup("st"))];
    m = FoscMarkup.concat(a);
    m.show;


tiny

LilyPond \tiny markup command.

Returns new markup.

  1. Example

    m = tiny(FoscMarkup("Allegro assai"));
    m.show;


translate

LilyPond translate markup command.

Returns new markup.

  1. Example

    m = FoscMarkup("Allegro assai");
    m = m.translate(#[2, 2]);
    m.show;


upright

LilyPond \upright markup command.

Returns new markup.

  1. Example

    m = upright(FoscMarkup("Allegro assai"));
    m.show;


vcenter

LilyPond \vcenter markup command.

Returns new markup.

  1. Example

    m = vcenter(FoscMarkup("Allegro assai"));
    m.format;
    \markup {
        \vcenter
            "Allegro assai"
    }


whiteout

LilyPond \whiteout markup command.

Returns new markup.

  1. Example

    m = whiteout(FoscMarkup("Allegro assai"));
    m.format;
    \markup {
        \whiteout
            "Allegro assai"
    }


withColor

LilyPond \with-color markup command.

Returns new markup.

  1. Example

    m = withColor(FoscMarkup("Allegro assai"), 'blue');
    m.show;


withDimensions

  1. Example

    m = FoscMarkup("Allegro assai");
    m = m.withDimensions(#[0, 20], #[0, -20]);
    m.format;
    \markup {
        \with-dimensions
            #'(0 . 20)
            #'(0 . -20)
            "Allegro assai"
    }