Skip to content

Feature request: .getOffsetBySiteInSeconds in Music21Object #1771

@oxygen-dioxide

Description

@oxygen-dioxide

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

  • I plan on implementing this myself.
  • I am willing to pay to have this feature added.
  • I am starting a discussion with the hope that community members will volunteer their time to create this. I understand that individuals work on features of interest to them and that this feature may never be implemented.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions