FoscLogicalTie

Returns a FoscLogicalTie.


Description

A selection of components in a logical tie.


Attributes Summary

Instance Properties

head Reference to element 0 in logical tie.
isPitched Is true when logical tie head is a note or chord.
isTrivial Is true when length of logical tie is less than or equal to 1.
leaves Leaves in logical tie.
tail Reference to element -1 in logical tie.
writtenDuration Sum of written duration of all components in logical tie.
writtenPitch Written pitch of logical tie if logical is pitched.
writtenPitch_ Sets written pitch of logical tie if logical is pitched.

Instance Methods: Special Methods

asCompileString
at Gets item at index in container. Traverses top-level items only.
copySeries Gets item at indices in container. Traverses top-level items only.

Instance Methods

toTuplet Changes logical tie to tuplet.


Instance Properties

Reference to element 0 in logical tie.

Returns component.

  1. Example

    a = FoscContainer([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    b = FoscLogicalTie(a[0..]);
    b.head;
    FoscNote('C4', 1/4)


isPitched

Is true when logical tie head is a note or chord.

Returns true or false.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a.isPitched;
    true
  2. Example

    a = FoscLogicalTie([FoscRest(1), FoscRest(1)]);
    a.isPitched;
    false


isTrivial

Is true when length of logical tie is less than or equal to 1.

Returns true or false.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a.isTrivial;
    false
  2. Example

    a = FoscLogicalTie([FoscNote(60, 1/4)]);
    a.isTrivial;
    true


leaves

Leaves in logical tie.

Returns selection.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a.leaves;
    FoscSelection([ FoscNote(FoscPitch("C4"), FoscDuration(1, 4)), FoscNote(FoscPitch("C4"), FoscDuration(1, 4)) ])


tail

Reference to element -1 in logical tie.

Returns component.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a.tail;
    FoscNote('C4', 1/4)


writtenDuration

Sum of written duration of all components in logical tie.

Returns duration.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 2/4)]);
    a.writtenDuration.cs;
    FoscDuration(3, 4)


writtenPitch

Written pitch of logical tie if logical is pitched.

Returns pitch.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 2/4)]);
    a.writtenPitch.cs;
    FoscPitch('C4')


writtenPitch_

Sets written pitch of logical tie if logical is pitched.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 2/4)]);
    a.writtenPitch_(61);
    a.writtenPitch.cs;
    FoscPitch('C#4')


Instance Methods: Special Methods


asCompileString

  1. Example

    m = FoscStaff(FoscLeafMaker().(#[60,60,62,nil], [1/4,2/4,5/4,3/4]));
    m.selectLeaves[0..1].tie;
    t = [];
    m.doLogicalTies { |each| t = t.add(each.cs) };
    t.postln;
    [ "FoscLogicalTie([
        FoscNote('C4', 1/4),
        FoscNote('C4', 1/2)
    ])", "FoscLogicalTie([
        FoscNote('D4', 1/1),
        FoscNote('D4', 1/4)
    ])", "FoscLogicalTie([
        FoscRest(3/4)
    ])" ]


at

Gets item at index in container. Traverses top-level items only.

Returns component or selection.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a[0].str;
    c'4
    b = a[[0, 1]];
    [ FoscNote(FoscPitch("C4"), FoscDuration(1, 4)), FoscNote(FoscPitch("C4"), FoscDuration(1, 4)) ]


copySeries

Gets item at indices in container. Traverses top-level items only.

Returns component or selection.

  1. Example

    a = FoscLogicalTie([FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    b = a[0..];
    b.items;
    [ FoscNote(FoscPitch("C4"), FoscDuration(1, 4)), FoscNote(FoscPitch("C4"), FoscDuration(1, 4)) ]


Instance Methods


toTuplet

Changes logical tie to tuplet.

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64], [1/8, 5/16, 1/4]));
    a.show;

    m = a[1].prGetLogicalTie;
    m.toTuplet(#[-2,1,1,1,2]);
    a.show;