FoscTuplet

Returns a FoscTuplet.


Description

A tuplet.


Attributes Summary

Instance Properties

denominator Gets preferred denominator of tuplet.
denominator_ Sets preferred denominator of tuplet.
forceFraction Gets force fraction flag.
forceFraction_ Sets force fraction flag.
impliedProlation Gets implied prolation of tuplet.
identifier !!!TODO
isHidden Is true when tuplet bracket isHiddens.
isHidden_ Sets isHidden flag.
multipliedDuration Gets multiplied duration of tuplet.
multiplier Gets tuplet multiplier.
multiplier_ Sets tuplet mutliplier.
tag Gets tag.
tweaks Gets tweaks.

Instance Methods: Special Methods

asCompileString
storeArgs Gets new arguments of tuplet.

Instance Methods

add (append)
addAll (extend)
indexOf !!!TODO
insert !!!TODO
isAugmentation (augmentation)
isDiminution (diminution)
isTrivial (trivial)
isTrivializable (trivializable)
minimumDenominator_ (set_minimum_denominator)
normalizeMultiplier Normalizes tuplet multiplier.
pop !!!TODO
remove !!!TODO
rewriteDots Rewrites dots.
toggleProlation Changes augmented tuplets to diminished; changes diminished tuplets to augmented.
trivialize Trivializes tuplet.


Usage

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

  2. A nested tuplet.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    b = FoscTuplet(4/7, FoscLeafMaker().(#[67,69], [3/8, 1/16]));
    a.insert(1, b);
    a.show;

  3. Tuplets can be tweaked.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    tweak(a).color = 'blue';
    a.show;


Instance Properties


denominator

Gets preferred denominator of tuplet.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.denominator; // nil


denominator_

Sets preferred denominator of tuplet.

  1. Set preferred denominator.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

    a.denominator = 4;
    a.show;


forceFraction

Gets force fraction flag.

Returns true or false.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.forceFraction; // false
    false
    a.show;


forceFraction_

Sets force fraction flag.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

    a.forceFraction = true;
    a.show;


impliedProlation

Gets implied prolation of tuplet.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.impliedProlation.str;
    2/3


identifier

!!!TODO


isHidden

Is true when tuplet bracket isHiddens.

Returns true or false.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.isHidden; // false
    false


isHidden_

Sets isHidden flag.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

    a.isHidden = true;
    a.show;


multipliedDuration

Gets multiplied duration of tuplet.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.multipliedDuration.str;
    1/4


multiplier

Gets tuplet multiplier.

Returns multiplier.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.multiplier.str;
    2/3


multiplier_

Sets tuplet mutliplier.

  1. Example

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.multiplier_(#[4, 3]);
    a.show;


tag

Gets tag.


tweaks

Gets tweaks.


Instance Methods: Special Methods


asCompileString


storeArgs

Gets new arguments of tuplet.

Returns array.

  1. Example

    a = FoscTuplet(2/3, [FoscNote(60, 1/4), FoscNote(60, 1/8)]);
    a.storeArgs;
    a.cs; //!!! TODO: make compactRepresentation
    FoscTuplet(FoscMultiplier(2, 3), [  ])


Instance Methods


add

(append)

Adds component to tuplet.

  1. Add note to tuplet.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,65], [1/4]));
    a[0..].slur;
    a.show;

    a.add(FoscNote(64, 1/4));
    a.show;

  2. Add note to tuplet and preserve tuplet duration.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,65], [1/4]));
    a[0..].slur;
    a.show;

    a.add(FoscNote(64, 1/4), preserveDuration: true);
    a.show;

    a.normalizeMultiplier;
    a.show;


addAll

(extend)

Add all components to tuplet.

  1. Add three notes to tuplet.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,65], [1/4]));
    a[0..].slur;
    a.show;

    b = FoscLeafMaker().(#[64,62,64], [1/32,1/32,1/16]);
    a.addAll(b);
    a.show;

  2. Add three notes to tuplet and preserve tuplet duration.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,65], [1/4]));
    a[0..].slur;
    a.show;

    b = FoscLeafMaker().(#[64,62,64], [1/32,1/32,1/16]);
    a.addAll(b, preserveDuration: true);
    a.show;


indexOf

!!!TODO


insert

!!!TODO


isAugmentation

(augmentation)

Is true when tuplet multiplier is greater than 1.

Returns true or false.

  1. Augmented tuplet.

    a = FoscTuplet(4/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.isAugmentation;
    true
  2. Diminished tuplet.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.isAugmentation;
    false
  3. Trivial tuplet.

    a = FoscTuplet(1/1, FoscLeafMaker().(#[60,62,64], [3/8]));
    a.isAugmentation;
    false


isDiminution

(diminution)

Is true when tuplet multiplier is less than 1.

Returns true or false.

  1. Augmented tuplet.

    a = FoscTuplet(4/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.isDiminution;
    false
  2. Diminished tuplet.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.isDiminution;
    true
  3. Trivial tuplet.

    a = FoscTuplet(1/1, FoscLeafMaker().(#[60,62,64], [3/8]));
    a.isDiminution;
    false


isTrivial

(trivial)

Is true when tuplet multiplier is equal to 1 and no multipliers attach to any leaves in tuplet.

  1. Example

    a = FoscTuplet(1/1, FoscLeafMaker().(#[60,62,64], [3/8]));
    a.isTrivial;
    true
  2. Tuplet is not trivial when any leaves have a multiplier.

    a = FoscTuplet(1/1, FoscLeafMaker().(#[60,62,64], [3/8]));
    a[0].multiplier_(FoscMultiplier(3, 2));
    a.isTrivial;
    false


isTrivializable

(trivializable)

Is true when tuplet is trivializable (can be rewritten with a ratio of 1:1).

  1. Trivializable tuplet.

    a = FoscTuplet(3/4, [FoscNote(60, 1/4), FoscNote(60, 1/4)]);
    a.isTrivializable;
    true
  2. Non-trivializable tuplet.

    a = FoscTuplet(3/5, FoscLeafMaker().(60 ! 5, [1/4]));
    a.isTrivializable;
    false


minimumDenominator_

(set_minimum_denominator)

Sets preferred denominator of tuplet to at least denominator.

  1. Sets preferred denominator of tuplet to at least 8.

    a = FoscTuplet(3/5, FoscLeafMaker().(#[60,62,64,65,67], [1/4,1/8,1/8,1/4,1/2]));
    a.show;

    a.minimumDenominator = 8;
    a.show;


normalizeMultiplier

Normalizes tuplet multiplier.

  1. Example

    a = FoscTuplet(1/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.show;

    a.normalizeMultiplier;
    a.show;


pop

!!!TODO


remove

!!!TODO


rewriteDots

Rewrites dots.

  1. Rewrites single dots at 3:2 prolation.

    a = FoscTuplet(1, [FoscNote(60, 3/16), FoscNote(60, 3/16)]);
    a.show;

    a.rewriteDots;
    a.show;

  2. Rewrites double dots at 7:2 prolation.

    a = FoscTuplet(1, [FoscNote(60, 7/32), FoscNote(60, 7/32)]);
    a.show;

    a.rewriteDots;
    a.show;

  3. Does nothing when dot counts differ.

    a = FoscTuplet(1, FoscLeafMaker().(#[60,62,64], [3/16,3/16,1/8]));
    a.show;

    a.rewriteDots;
    a.show;

  4. Does nothing when leaves carry no dots.

    a = FoscTuplet(3/2, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

    a.rewriteDots;
    a.show;


toggleProlation

Changes augmented tuplets to diminished; changes diminished tuplets to augmented.

Does not yet work with nested tuplets.

  1. Changes augmented tuplet to diminished.

    a = FoscTuplet(4/3, FoscLeafMaker().(#[60,62,64], [1/8]));
    a.show;

    a.toggleProlation;
    a.show;

  2. Changes diminished tuplet to augmented.

    a = FoscTuplet(2/3, FoscLeafMaker().(#[60,62,64], [1/4]));
    a.show;

    a.toggleProlation;
    a.show;


trivialize

Trivializes tuplet.

  1. Example

    a = FoscTuplet(3/4, [FoscNote(60, 2/4)]);
    a.show;

    a.trivialize;
    a.show;