Returns a FoscRhythm.
Rhythm
| duration | |
| durations | |
| improperParentage | |
| offsets | |
| parentageRatios | A sequence describing the relative durations of the nodes in a node’s improper parentage. |
| prolation | Prolation of rhythm tree node. |
| prolations | Prolations of rhythm tree node. |
| properParentage | |
| startOffset | The starting offset of a node in a rhythm-tree relative to the root. |
| stopOffset | The stopping offset of a node in a rhythm-tree relative to the root. |
| doesNotUnderstand | Delegate to FoscRhythmMixin. |
| value |
| == | |
| != | |
| illustrate | Illustrates FoscRhythm. |
| inspect | |
| show |
Example
a = FoscRhythm(1/4, #[-2, 2]);
a.value.items.collect { |each| each.format }[0];\scaleDurations #'(1 . 1) {
r8
c'8
}Example
a = FoscRhythm(1/4, #[-2, 3]);
a.value.items.collect { |each| each.format }[0];\times 4/5 {
r8
c'8.
}a.show;
Can be nested.
a = FoscRhythm(3/16, [1, -2, FoscRhythm(2, #[1, 2, 4])]);
a.show;
Ircam-style rhythm-tree syntax.
a = FoscRhythm(1/4, #[1, -2, [2, [1, 2, 4]]]);
a.show;
DEPRECATED
Floats are interpreted as ties.
a = FoscRhythm(3/16, [1, 2, [2, [2.0, -3]]]);
a.show;ERROR: FoscRhythm::new: bad value: 2.0.Example
a = FoscRhythm([3, 4], [1, 2, 2, 1, 1]);
a.duration.cs;FoscDuration(3, 4)Example
b = FoscRhythm(4, [-3, 2]);
a = FoscRhythm([3, 4], [1, 2, b]);
a.duration.cs;
b.duration.cs;FoscDuration(3, 7)Example
a = FoscRhythm(4/4, #[-3, 2, 2]);
a.durations;[ FoscDuration(3, 7), FoscDuration(2, 7), FoscDuration(2, 7) ]Example
a = FoscRhythm(1/4, #[1, 2, [2, [2, -3]]]);
a.durations;[ FoscDuration(1, 20), FoscDuration(1, 10), FoscDuration(1, 25), FoscDuration(3, 50) ]Example
b = FoscRhythm(4, [-3, 2]);
a = FoscRhythm([3, 4], [1, 2, b]);
a.improperParentage;
b.improperParentage;
b.items.last.improperParentage;[ FoscRhythmLeaf.new, FoscRhythm.new, FoscRhythm.new ]Example
a = FoscRhythm(4/4, #[-3, 2, 2]);
a.offsets;[ FoscOffset(0, 1), FoscOffset(3, 7), FoscOffset(5, 7), FoscOffset(1, 1) ]Example
a = FoscRhythm(1/4, #[1, 2, [2, [2, -3]]]);
a.offsets[ FoscOffset(0, 1), FoscOffset(1, 20), FoscOffset(3, 20), FoscOffset(19, 100), FoscOffset(1, 4) ]A sequence describing the relative durations of the nodes in a node’s improper parentage.
The first item in the sequence is the preprolatedDuration of the root node, and subsequent items are pairs of the preprolated duration of the next node in the parentage and the total preprolated_duration of that node and its siblings.
Returns array.
Prolation of rhythm tree node.
Returns multiplier.
Example
b = FoscRhythm(4, #[-3, 2]);
a = FoscRhythm(3/4, [1, 2, b]);
a.prolation.cs;FoscMultiplier(1, 1)
b.prolation.cs;FoscMultiplier(3, 28)Prolations of rhythm tree node.
Returns array.
Example
b = FoscRhythm(4, #[-3, 2]);
a = FoscRhythm(3/4, [1, 2, b]);
a.prolations;[ FoscMultiplier(1, 1) ]
b.prolations;[ FoscMultiplier(1, 1), FoscMultiplier(3, 28) ]Example
b = FoscRhythm(4, #[-3, 2]);
a = FoscRhythm(3/4, [1, 2, b]);
a.properParentage;[ ]
b.properParentage;[ FoscRhythm.new ]The starting offset of a node in a rhythm-tree relative to the root.
Returns a FoscOffset.
Example
a = FoscRhythm(1, #[1, [1, [1, 1]], [1, [1, 1]]]);
b = [];
a.do { |node| b = b.add("".padLeft(node.depth, "\t") ++ node.startOffset.cs) };
b.join("\n");FoscOffset(0, 1)
FoscOffset(0, 1)
FoscOffset(1, 3)
FoscOffset(1, 3)
FoscOffset(1, 2)
FoscOffset(2, 3)
FoscOffset(2, 3)
FoscOffset(5, 6)The stopping offset of a node in a rhythm-tree relative to the root.
Returns a FoscOffset.
Example
a = FoscRhythm(1, #[1, [1, [1, 1]], [1, [1, 1]]]);
b = [];
a.do { |node| b = b.add("".padLeft(node.depth, "\t") ++ node.stopOffset.cs) };
b.join("\n");FoscOffset(1, 1)
FoscOffset(1, 3)
FoscOffset(2, 3)
FoscOffset(1, 2)
FoscOffset(2, 3)
FoscOffset(1, 1)
FoscOffset(5, 6)
FoscOffset(1, 1)Delegate to FoscRhythmMixin.
Example
a = FoscRhythm(FoscDuration(2, 4), [-2, 5]);
b = FoscRhythm(FoscDuration(2, 4), [-2, 5]);
c = FoscRhythm(FoscDuration(2, 4), [2, 5]);
a == b; // truetrue
a == c; // falsefalseExample
a = FoscRhythm(FoscDuration(2, 4), [-2, 5]);
b = FoscRhythm(FoscDuration(2, 4), [-2, 5]);
c = FoscRhythm(FoscDuration(2, 4), [2, 5]);
a != b; // falsefalse
a != c; // truetrueIllustrates FoscRhythm.
Returns LilyPond file.
Example
a = FoscRhythm(2/4, #[-2, [2, [-2, 3]], 3]);
a.inspect;1/2
2
2
2
3
3Example
a = FoscRhythm(3/8, #[-2, 2, 3]);
a.show;
Example
a = FoscRhythm(3/16, [1, -2, FoscRhythm(2, #[1, 2, 4])]);
a.show;