Motivation
We already have Music21Object.seconds that returns the duration of the object in seconds. I hope that we can have a function that returns the object's position relative to a stream it belongs to. It is useful in the following scenarios:
- Developing audio synthesizers that takes Music21 stream as input.
- Handling a stream with a lot of objects. A
.getOffsetBySiteInSeconds will avoid cumulative error in summing the .seconds duration of all objects.
Feature summary
Add a method, .getOffsetBySiteInSeconds, that returns the position relative to a user-given stream it belongs to.
Proposed implementation
Optionally, describe the implementation or the interface, in code or pseudocode.
Like how .seconds is implemented
Intent
Motivation
We already have
Music21Object.secondsthat returns the duration of the object in seconds. I hope that we can have a function that returns the object's position relative to a stream it belongs to. It is useful in the following scenarios:.getOffsetBySiteInSecondswill avoid cumulative error in summing the.secondsduration of all objects.Feature summary
Add a method,
.getOffsetBySiteInSeconds, that returns the position relative to a user-given stream it belongs to.Proposed implementation
Like how
.secondsis implementedIntent