FoscLeafMaker

Returns a FoscLeafMaker.


Description

Leaf-maker.

Returns a FoscSelection.


Attributes Summary

Instance Properties

forbiddenNoteDuration Gets forbidden note duration.
forbiddenRestDuration Gets forbidden rest duration.
increaseMonotonic Is true when durations increase monotonically. Otherwise false.
metricalHierarchy Gets metrical hierarchy.
skipsInsteadOfRests Is true when skips appear in place of rests. Otherwise false.
repeatTies Is true when ties are repeat ties.
useMultimeasureRests Is true when rests are multimeasure.
tag Gets tag.

Instance Methods: Special Methods

value Calls leaf-maker on pitches and durations.


Usage

  1. Integer and string elements in pitches result in notes.

    m = FoscLeafMaker().(#[62,64,"F#5","G#5"], [1/4]);
    m.show;

  2. Tuple elements in pitches result in chords.

    m = FoscLeafMaker().(#[[60,62,64], ["F#5","G#5","A#5"]], [1/2]);
    m.show;

  3. !!!TODO: single string as chord not working

    m = FoscLeafMaker().(#[[60,62,64], "F#5 G#5 A#5"], [1/2]);
    m.show;

  4. Nil-valued elements in pitches result in rests.

    m = FoscLeafMaker().(nil, 1/4 ! 4);
    m.show;

  5. Values passed to pitches can be mixed and matched.

    m = FoscLeafMaker().(#[[60,62,64], nil, "C#5", "D#5"], [1/4]);
    m.show;

  6. Works with pitch segments.

    m = FoscLeafMaker().(FoscPitchSegment(#["E5","Eb5","D5","Db5", "C5"]), [1/4]);
    m.show;

  7. Reads pitches cyclically when the length of pitches is less than the length of durations.

    m = FoscLeafMaker().(#[72], [3/8, 1/8, 3/8, 1/8]);
    m.show;

  8. Reads durations cyclically when the length of durations is less than the length of pitches.

    m = FoscLeafMaker().(#[72,74,76,77], [1/4]);
    m.show;

  9. Elements in durations with non-power-of-two denominators result in tuplet-nested leaves.

    m = FoscLeafMaker().(#[60,62,64,65], [1/4, 1/12, 1/6, 1/2]);
    m.show;

  10. Set increaseMonotonic to false to return nonassignable durations tied from greatest to least.

    m = FoscLeafMaker(increaseMonotonic: false).(#["E5"], [13/16]);
    x = FoscStaff(m);
    x[0].attach(FoscTimeSignature(#[13, 16]));
    x.show;

  11. Set increaseMonotonic to true to return nonassignable durations tied from least to greatest.

    m = FoscLeafMaker(increaseMonotonic: true).(#["E5"], [13/16]);
    x = FoscStaff(m);
    x[0].attach(FoscTimeSignature(#[13, 16]));
    x.show;

  12. !!!TODO: update to abjad 3.0 documentation

    Set forbiddenNoteDuration to avoid notes greater than or equal to a certain written duration.

    m = FoscLeafMaker(forbiddenNoteDuration: FoscDuration(1, 2)).(#[65,67], [5/8]);
    x = FoscStaff(m);
    x[0].attach(FoscTimeSignature(#[5, 4]));
    x.show;

  13. forbiddenWrittenDuration and increaseMonotonic may be set together.

    m = FoscLeafMaker(increaseMonotonic: true, forbiddenNoteDuration: FoscDuration(1, 2));
    m = m.(#[65,67], [5/8]);
    x = FoscStaff(m);
    x[0].attach(FoscTimeSignature(#[5, 4]));
    x.show;

  14. Nil-valued elements in pitches result in multimeasure rests when the multimeasure rest keyword is set.

    m = FoscLeafMaker(useMultimeasureRests: true).(#[nil], [3/8, 5/8]);
    x = FoscStaff(m, lilypondType: 'RhythmicStaff');
    x.leafAt(0).attach(FoscTimeSignature(#[3, 8]));
    x.leafAt(1).attach(FoscTimeSignature(#[5, 8]));
    x.show;

  15. Make skips instead of rests.

    m = FoscLeafMaker(skipsInsteadOfRests: true).([nil], [13/16]);
    x = FoscStaff(m);
    x.format;
    \new Staff {
        s2.
        s16
    }


Instance Properties


forbiddenNoteDuration

Gets forbidden note duration.

Returns duration or nil.


forbiddenRestDuration

Gets forbidden rest duration.

Returns duration or nil.


increaseMonotonic

Is true when durations increase monotonically. Otherwise false.


metricalHierarchy

Gets metrical hierarchy.

Returns metrical hierarchy or none.


skipsInsteadOfRests

Is true when skips appear in place of rests. Otherwise false.


repeatTies

Is true when ties are repeat ties.


useMultimeasureRests

Is true when rests are multimeasure.


tag

Gets tag.


Instance Methods: Special Methods


value

Calls leaf-maker on pitches and durations.

Returns selection.