FoscTimeSignature

Returns a FoscTimeSignature.


Description

Time signature.


Attributes Summary

Instance Properties

context Gets context of time signature.
denominator Gets denominator of time signature:
duration Gets duration of time signature.
hasNonPowerOfTwoDenominator Is true when time signature has non-power-of-two denominator.
hide Is true when time signature should not appear in output (but should still determine effective time signature).
impliedProlation Gets implied prolation of time signature.
numerator Gets numerator of time signature.
pair Gets numerator / denominator pair corresponding to time signature.
parameter Is true.
partial Gets duration of pick-up to time signature.
tweaks Tweaks are not implemented on time signature.

Instance Methods: Special Methods

add !!!TODO: incomplete
copy Copies time signature.
== Is true when arg is a time signature with numerator and denominator equal to
format Formats time signature.
>= Is true when duration of time signature is greater than or equal to duration of arg. Otherwise false.
> Is true when duration of time signature is greater than duration of arg. Otherwise false.
<= Is true when duration of time signature is less than or equal to duration of arg. Otherwise false.
< Is true when duration of time signature is less than duration of arg. Otherwise false.
[(abjad:](#(abjad:) radd)
str Gets string representation of time signature.

Instance Methods

withPowerOfTwoDenominator Makes new time signature equivalent to current time signature with power-of-two denominator.

Instance Methods: Display

inspect


Usage

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64], [1/8]));
    m = FoscTimeSignature(#[3,8]);
    a[0].attach(m);
    a.show;

  2. !!!TODO: not yet working

    Create a score-contexted time signature. Score-contexted time signatures format behind comments when no Abjad score container is found.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64], [1/8]));
    m = FoscTimeSignature(#[3,8]);
    a[0].attach(m, context: 'Score');
    a.format;
    \new Staff {
        \time 3/8
        c'8
        d'8
        e'8
    }
    a.show;

  3. Score-contexted time signatures format normally when an Abjad score container is found.

    a = FoscScore([a]);
    a.show;

  4. !!!TODO: tags not yet implemented

    Time signatures can be tagged.

    a = FoscStaff(FoscLeafMaker().(#[60,62,64], [1/8]));
    m = FoscTimeSignature(#[3,8]);
    a[0].attach(m, tag: "RED");
    a.format;
    \new Staff {
        \time 3/8
        c'8
        d'8
        e'8
    }


Instance Properties


context

Gets context of time signature.

  1. Example

    a = FoscTimeSignature(#[3,4]);
    a.context.postln;
    Staff


denominator

Gets denominator of time signature:

  1. Example

    a = FoscTimeSignature(#[3,4]);
    a.denominator.postln;
    4


duration

Gets duration of time signature.

  1. Example

    a = FoscTimeSignature(#[3,4]);
    a.duration.postcs;
    FoscDuration(3, 4)


hasNonPowerOfTwoDenominator

Is true when time signature has non-power-of-two denominator.

  1. Example

    a = FoscTimeSignature(#[7,12]);
    a.hasNonPowerOfTwoDenominator.postln;
    true
  2. Example

    a = FoscTimeSignature(#[3,4]);
    a.hasNonPowerOfTwoDenominator.postln;
    false


hide

Is true when time signature should not appear in output (but should still determine effective time signature).

  1. Example

    a = FoscStaff(FoscLeafMaker().(#[60,62,64,65], [1/4]));
    m = FoscTimeSignature(#[4,4]);
    a[0].attach(m);
    m = FoscTimeSignature(#[2,4], hide: true);
    a[2].attach(m);
    a.format;
    \new Staff {
        \time 4/4
        c'4
        d'4
        e'4
        f'4
    }
    a.show;

  2. !!!TODO: bug: result should be [[4,4],[4,4],[2,4],[2,4]]

    FIXME: ERROR: Message byLeaf not understood.

    iterate(a).byLeaf.do { |leaf|
        FoscInspection(leaf).effectiveIndicator(FoscTimeSignature).pair.postln;
    };


impliedProlation

Gets implied prolation of time signature.

  1. Implied prolation of time signature with power-of-two denominator.

    a = FoscTimeSignature(#[3,8]);
    a.impliedProlation.postcs;
    FoscMultiplier(1, 1)
  2. Implied prolation of time signature with non-power-of-two denominator.

    a = FoscTimeSignature(#[7,12]);
    a.impliedProlation.postcs;
    FoscMultiplier(2, 3)


numerator

Gets numerator of time signature.

  1. Example

    a = FoscTimeSignature(#[3,8]);
    a.numerator.postln;
    3


pair

Gets numerator / denominator pair corresponding to time signature.

  1. Example

    a = FoscTimeSignature(#[3,8]);
    a.pair.postln;
    [ 3, 8 ]


parameter

Is true.

  1. Example

    a = FoscTimeSignature(#[3,8]);
    a.parameter.postln;
    true


partial

Gets duration of pick-up to time signature.

  1. Example

    a = FoscTimeSignature(#[3,8]);
    a.partial.postln;


tweaks

Tweaks are not implemented on time signature.

The LilyPond \time command refuses tweaks.

Override the LilyPond TimeSignature grob instead.


Instance Methods: Special Methods


add

!!!TODO: incomplete

Adds time signature to timeSignature.

Returns new time signature.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([7, 8]);
    c = a + b;
    c.pair.postln;
    [ 13, 8 ]


copy

Copies time signature.


==

Is true when arg is a time signature with numerator and denominator equal to this time signature. Also true when arg is a tuple with first and second elements equal to numerator and denominator of this time signature. Otherwise false.

Returns true or false.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([3, 4]);
    c = FoscTimeSignature([4, 4]);
    d = FoscDuration([3, 4]);
    (a == b).postln;
    true
    (a == c).postln;
    false
    (a == d).postln;
    false


format

Formats time signature.

  1. Example

    a = FoscTimeSignature([3, 8]);
    a.format.postln;
    \time 3/8


>=

Is true when duration of time signature is greater than or equal to duration of arg. Otherwise false.

Returns true or false.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([2, 4]);
    (a >= b).postln;
    true
    (b >= a).postln;
    false


>

Is true when duration of time signature is greater than duration of arg. Otherwise false.

Returns true or false.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([2, 4]);
    (a > b).postln;
    true
    (b > a).postln;
    false


<=

Is true when duration of time signature is less than or equal to duration of arg. Otherwise false.

Returns true or false.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([2, 4]);
    (a <= b).postln;
    false
    (b <= a).postln;
    true
    a <= 3; // FIXME: ERROR: Message 'duration' not understood.


<

Is true when duration of time signature is less than duration of arg. Otherwise false.

Returns booelan.

  1. Example

    a = FoscTimeSignature([3, 4]);
    b = FoscTimeSignature([2, 4]);
    (a < b).postln;
    false
    (b < a).postln;
    true


(abjad:

radd)

!!!TODO: see FoscFraction:performBinaryOpOnSimpleNumber


str

Gets string representation of time signature.

  1. Example

    a = FoscTimeSignature([3, 4]);
    a.str;
    3/4


Instance Methods


withPowerOfTwoDenominator

Makes new time signature equivalent to current time signature with power-of-two denominator.

Returns new time signature.


Instance Methods: Display


inspect

  1. Example

    FoscTimeSignature([7, 16]).inspect;
    FoscTimeSignature.new