beam

Returns a beam.


Description

A beam

[ ]


Usage

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/8]));
    set(a).autoBeaming = false;
    a[0..1].beam;
    a[2..3].beam;
    a.show;

  2. Example

    a = FoscStaff(FoscLeafMaker().((60..75), [1/32]));
    set(a).autoBeaming = false;
    a[0..].beam(durations: 1/8 ! 4, spanBeamCount: 1);
    a.show;
    prFormatCodeString interpret initial failed: a DoesNotUnderstandError
    
    a = FoscStaff(FoscLeafMaker().((60..75), [1/32]));
    set(a).autoBeaming = false;
    a[0..].beam(durations: 1/8 ! 4, spanBeamCount: 1);
    
  3. Partition selection by sizes and beam each new selection.

    a = FoscStaff(FoscLeafMaker().((60..75), [1/32]));
    set(a).autoBeaming = false;
    a[0..].partitionBySizes(#[3,4,6,3]).do { |sel| sel.beam };
    a.show;

  4. Beams can be tweaked.

    a = FoscStaff(FoscLeafMaker().((60..75), [1/32]));
    set(a).autoBeaming = false;
    a[0..].partitionBySizes(#[3,4,6,3]).do { |selection|
        b = FoscStartBeam(direction: 'up', tweaks:#['positions', [6,6], 'color', 'grey']);
        selection.beam(startBeam: b);
    };
    a.show;

  5. Specify spanning beams using durations and spanBeamCount.

    x = FoscLeafMaker().((60..83), [1/16]);
    d = [[1/4, 1/8],[1/8, 1/4],[1/4, 1/8],[1/8, 1/4]];
    m = x.partitionBySizes(#[6,6,6,6]);
    m.do { |sel, i| sel.beam(durations: d[i], spanBeamCount: 1) };
    x.show;
    prFormatCodeString interpret initial failed: a DoesNotUnderstandError
    
    x = FoscLeafMaker().((60..83), [1/16]);
    d = [[1/4, 1/8],[1/8, 1/4],[1/4, 1/8],[1/8, 1/4]];
    m = x.partitionBySizes(#[6,6,6,6]);
    m.do { |sel, i| sel.beam(durations: d[i], spanBeamCount: 1) };