Skip to content

Improve Curve API #1607

@jaredjj3

Description

@jaredjj3

In stringsync/vexml#201, I'm using vexflow to draw slurs encoded in MusicXML. I have a few asks for the Curve API.

  1. Fix the types. Curve objects can be partial, but the constructor forces you to specify Note instead of Note | undefined.

  2. Allow me to specify the curve opening direction. Otherwise, I have to mimic the calculation that vexflow does to figure out the direction of the opening, and my implementation will know too much about how vexflow works. Maybe a property in CurveOptions like openingDirection?: 'up' | 'down' | undefined.

  3. Make vexflow dynamically calculate cps when not provided one in CurveOptions. Currently, it will just use the default cps that the Curve constructor sets. As I was migrating slurs from StaveTie, I thought it would be a similar experience where Curve would just mostly work. However, I had no idea how cps were control points that influenced the shape of the curve until I opened up the Curve implementation and studied it. It probably would be a good experience for vexflow users to not have to calculate control points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions