FoscLilypondFile

Returns a FoscLilypondFile.


Description

A Lilypond file.

FIXME: should Lilypond file include stylesheets/default.ily?


Attributes Summary

Class Methods

*pitch One staff per array in pitches.
*rhythm Makes rhythm-maker-style LilyPond file.

Instance Properties

comments Gets comments of Lilypond file.
dateTimeToken Gets date-time token.
defaultPaperSize Gets default paper size of Lilypond file. Set to pair or nil. Defaults to nil.
globalStaffSize Gets global staff size of Lilypond file. Set to number or nil. Defaults to nil.
headerBlock Gets header block.
includes Gets includes of Lilypond file.
items Gets items in Lilypond file.
layoutBlock Gets layout block.
lilypondLanguageToken Gets Lilypond language token.
lilypondVersionToken Gets Lilypond version token.
paperBlock Gets paper block.
scoreBlock Gets score block.
useRelativeIncludes Is true when Lilypond file should use relative includes.

Instance Methods: Special Methods

format Formats Lilypond file.
at (abjad: getitem)
illustrate Illustrates Lilypond file.
asCompileString Gets interpreter representation of Lilypond file.


Usage

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    f = FoscLilypondFile(a);
    f.show;

  2. Set proportional notation duration.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    f = FoscLilypondFile(a);
    b = f.layoutBlock['Score'];
    if (b.isNil) { b = FoscContextBlock(sourceLilypondType: 'Score') };
    f.layoutBlock.items.add(b);
    set(b).proportionalNotationDuration = FoscSchemeMoment([1, 20]);
    f.show;


Class Methods


*pitch

One staff per array in pitches.

  1. FIXME: Lilypond compile fails, error: cannot find file: `../stylesheets/default.ily’

    a = (60,60.25..71);
    b = (60..53);
    f = FoscLilypondFile.pitch([a, b]);
    f.show;


*rhythm

Makes rhythm-maker-style LilyPond file.

Used in rhythm-maker docs.

Returns LilyPond file.

  1. Make a rhythmic staff.

    d = #[[3,4],[4,8],[1,4]];
    m = FoscLeafMaker();
    
    x = [m.(64 ! 6, 1/8), m.(64 ! 8, 1/16), m.(64 ! 2, 1/8)];
    x.do { |each| each.beam };
    
    f = FoscLilypondFile.rhythm(x, d);
    f.show;

  2. !!!TODO: functionality removed - bring it back?

    Set time signatures explicitly.

    d = #[[3,4],[4,8],[1,4]];
    m = FoscLeafMaker();
    
    x = [m.(64 ! 6, 1/8), m.(64 ! 8, 1/16), m.(64 ! 2, 1/8)];
    x.do { |each| each.beam };
    
    t = #[[6,8],[4,8],[2,8]];
    f = FoscLilypondFile.rhythm(x, t);
    f.show;

  3. Make pitched staff.

    d = #[[3,4],[4,8],[1,4]];
    m = FoscLeafMaker();
    
    x = [m.(64 ! 6, 1/8), m.(64 ! 8, 1/16), m.(64 ! 2, 1/8)];
    x.do { |each| each.beam };
    
    f = FoscLilypondFile.rhythm(x, d, pitchedStaff: true);
    f.show;

  4. Adjust horizontal spacing with stretch. Defaults to 1.

    m = FoscRhythmMaker().(divisions: [1/4], ratios: #[[2,1],[3,2],[4,3]]);
    f = FoscLilypondFile.rhythm(m, stretch: 4);
    f.show;

  5. !!!TODO: not yet working

    Make simultaneous voices.

    d = #[[3,4],[4,8],[1,4]];
    m = FoscLeafMaker();
    
    x = [m.(64 ! 6, 1/8), m.(64 ! 8, 1/16), m.(64 ! 2, 1/8)];
    x.do { |each| each.beam };
    x = FoscSelection(x).flat;
    
    y = [m.(60 ! 12, 1/16), m.(60 ! 16, 1/32), m.(60 ! 4, 1/16)];
    y.do { |each| each.beam };
    y = FoscSelection(y).flat;
    
    a = ('Voice_1': x, 'Voice_2': y);
    f = FoscLilypondFile.rhythm(a, divisions: d, attachLilypondVoiceCommands: true);
    f.show;

  6. Use implicitly when displaying state of rhythm-makers.

    a = FoscRhythmMaker();
    a.(divisions: [1/4], ratios: #[[2,1],[3,2],[4,3]]);
    a.show;


Instance Properties


comments

Gets comments of Lilypond file.

  1. Example

    a = FoscLilypondFile();
    a.comments.postln;
    [  ]


dateTimeToken

Gets date-time token.

  1. FIXME: this returns ERROR: NotYetImplementedError when run by make, works fine in emacs…

    a = FoscLilypondFile();
    a.dateTimeToken.postln;


defaultPaperSize

Gets default paper size of Lilypond file. Set to pair or nil. Defaults to nil.

  1. Example

    a = FoscLilypondFile();
    a.defaultPaperSize.postln;


globalStaffSize

Gets global staff size of Lilypond file. Set to number or nil. Defaults to nil.

  1. Example

    a = FoscLilypondFile();
    a.globalStaffSize.postln;


headerBlock

Gets header block.

Returns block or nil.

  1. Example

    a = FoscLilypondFile();
    a.headerBlock.name.postln;
    'header'


includes

Gets includes of Lilypond file.

  1. Example

    a = FoscLilypondFile();
    a.includes.postln;
    [  ]


items

Gets items in Lilypond file.

  1. Example

    a = FoscLilypondFile();
    a.items.postln;
    List[ FoscBlock.new, FoscBlock.new, FoscBlock.new, FoscBlock.new ]


layoutBlock

Gets layout block.

Returns block or nil.

  1. Example

    a = FoscLilypondFile();
    a.layoutBlock.name.postln;
    'layout'


lilypondLanguageToken

Gets Lilypond language token.

  1. Example

    a = FoscLilypondFile();
    a.lilypondLanguageToken.postln;
    FoscLilypondLanguageToken.new


lilypondVersionToken

Gets Lilypond version token.

  1. Example

    a = FoscLilypondFile();
    a.lilypondVersionToken.postln;
    FoscLilypondVersionToken.new


paperBlock

Gets paper block.

Returns block or nil.

  1. Example

    a = FoscLilypondFile();
    a.paperBlock.name.postln;
    'paper'


scoreBlock

Gets score block.

Returns block or nil.

  1. Example

    a = FoscLilypondFile();
    a.scoreBlock.name.postln;
    'score'


useRelativeIncludes

Is true when Lilypond file should use relative includes.

  1. Example

    a = FoscLilypondFile();
    a.useRelativeIncludes.postln;
    false


Instance Methods: Special Methods


format

Formats Lilypond file.

Returns string.


at

(abjad: getitem)

Gets item with name.

Returns item.

Raises key error when no item with name is found.


illustrate

Illustrates Lilypond file.

Returns Lilypond file unchanged.


asCompileString

Gets interpreter representation of Lilypond file.

Returns string.