-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
The definition and implementation of RhythmPattern.onsets looks wrong to me:
- the function does not take onsets but durations
- it has an off-by-one error: adding duration 1 to a rhythm should add one pulse instead of a pause plus a pulse. Adding duration zero should not add anything.
Current implementation:
RhythmPattern.onsets(1, 2, 2, 1); // => [1, 0, 1, 0, 0, 1, 0, 0, 1, 0]I recommend to add function durations and change function onsets to use positions in the ryhtm:
Expected implementation:
RhythmPattern.durations(1, 2, 2, 1); // => [1, 1, 0, 1, 0, 1]
RhythmPattern.onsets(1, 3, 6, 9); // => [1, 0, 1, 0, 0, 1, 0, 0, 1, 0]Metadata
Metadata
Assignees
Labels
No labels