Returns a FoscMeter.
FoscMeter
Meter models a common practice understanding of beats and other levels of rhythmic organization structured as a tree. Meter structure corresponds to the monotonically increasing sequence of factors in the numerator of a given time signature. Successively deeper levels of the tree divide time by successive factors.
| fitMeters | Finds the best-matching sequence of meters for the offsets contained in argument. |
| decreaseDurationsMonotonically | Is true when meter divides large primes into collections of 2 and 3 that decrease monotonically. Otherwise false. |
| denominator | Gets denominator of meter. |
| depthwiseOffsetInventory | Gets depthwise offset inventory of meter. |
| duration | Gets duration of meter. |
| impliedTimeSignature | Gets implied time signature of meter. |
| isCompound | Is true when meter is compound. |
| isSimple | Is true when meter is simple. Otherwise false. |
| numerator | Gets numerator of meter. |
| pair | Gets numerator and denominator pair. |
| preferredBoundaryDepth | Gets preferred boundary depth of meter. Used by rewriteMeter method. |
| rootNode | Gets root node of meter. |
| == | Is true when argument is a meter with an rtm format equal to that of this meter. Otherwise false. |
| format | Formats meter. |
| hash | Hashes meter. |
| inspect | |
| iter | Iterates meter. |
| str | !!!TODO: make identical to abjad. |
| generateOffsetKernelToDenominator | Generates a dictionary of all offsets in a meter up to denominator. |
Example
FoscMeter(FoscTimeSignature([5, 4])).inspect;FoscMeter.newExample
FoscMeter(FoscDuration(5, 4)).inspect;FoscMeter.newExample
FoscMeter(FoscFraction(5, 4)).inspect;FoscMeter.newExample
FoscMeter([5, 4]).inspect;FoscMeter.newExample
FoscMeter(FoscRhythm([5, 4], [2, 3])).inspect;FoscMeter.newExample
FoscMeter(FoscRhythm([5, 4], [1, [7, [3, 2, 2]], 2])).inspect;FoscMeter.newExample
FoscMeter([5, 4], increaseMonotonic: true).inspect;FoscMeter.newExample
a = FoscMeter([5,4]);
a.inspect;FoscMeter.new
a.increaseMonotonic;false
a.denominator;4
a.numerator;5
a.preferredBoundaryDepth.isNil;true
a.rootNode;FoscRhythm.newFinds the best-matching sequence of meters for the offsets contained in argument.
Coerces offsets from argument via MetricAccentKernel.count_offsets().
Coerces Meters from meters via MeterList.
Returns array.
Is true when meter divides large primes into collections of 2 and 3 that decrease monotonically. Otherwise false.
Example
FoscMeter([7, 8], decreaseDurationsMonotonically: true).inspect;
FoscMeter([7, 8], decreaseDurationsMonotonically: false).inspect;FoscMeter.newGets denominator of meter.
Example
FoscMeter([7, 8]).denominator;8Gets depthwise offset inventory of meter.
Returns array.
Example
a = FoscMeter([7, 4]);
a.depthwiseOffsetInventory.do { |offsets, i|
Post << i << nl;
offsets.do { |each| Post.space << each.pair << nl };
};Gets duration of meter.
Example
m = FoscMeter([7, 4]);
m.duration.inspect;ObjectInspector.newGets implied time signature of meter.
Example
m = FoscMeter([4, 4]);
m.impliedTimeSignature.inspect;FoscTimeSignature.newIs true when meter is compound.
Compound meters are defined as those equal with a numerator divisible by 3 but not equal 3.
Example
FoscMeter([3, 4]).isCompound;false
FoscMeter([4, 8]).isCompound;false
FoscMeter([6, 8]).isCompound;true
FoscMeter([15, 32]).isCompound;trueIs true when meter is simple. Otherwise false.
Simple meters are defined as those equal with a numerator not divisible by 3.
Meters with numerator equal to 3 are also defined as simple.
Example
FoscMeter([3, 4]).isSimple;true
FoscMeter([4, 8]).isSimple;true
FoscMeter([6, 8]).isSimple;false
FoscMeter([15, 32]).isSimple;falseGets numerator of meter.
Returns positive integer.
Example
m = FoscMeter([7, 4]);
m.numerator;7Gets numerator and denominator pair.
Example
FoscMeter([7, 8]).pair;[ 7, 8 ]Gets preferred boundary depth of meter. Used by rewriteMeter method.
Returns integer or nil.
Example
m = FoscMeter([4, 4]);
m.preferredBoundaryDepth;Example
m = FoscMeter([4, 4], preferredBoundaryDepth: 2);
m.preferredBoundaryDepth;2Gets root node of meter.
Returns rhythm tree node.
Example
m = FoscMeter([7, 4]);
m.rootNode;FoscRhythm.newIs true when argument is a meter with an rtm format equal to that of this meter. Otherwise false.
Returns true or false.
Formats meter.
Returns string.
Gets storage format of 7/4:
a = FoscMeter(#[7,4]);
a.format;7/4Hashes meter.
Returns integer.
Example
a = FoscMeter(#[7,4]);
a.inspect;FoscMeter.newExample
a = FoscMeter(#[7,4], increaseMonotonic: true);
a.inspect;FoscMeter.newIterates meter.
Yields pairs.
!!!TODO: make identical to abjad.
Gets string representation of meter.
Returns string.
Example
FoscMeter([7, 4]).str;7/4Generates a dictionary of all offsets in a meter up to denominator.
Keys are the offsets and the values are the normalized weights of those offsets.
This is useful for testing how strongly a collection of offsets responds to a given meter.
Returns dictionary.