cienicera / Koji

The First Onchain Generative Music Library. Deployed on Starknet
9 stars 11 forks source link

VelocityCurve implementation #33

Closed caseywescott closed 9 months ago

caseywescott commented 10 months ago

Here is the initial implementation of Velocity Curve. It's a breakpoint pattern of arrays of 'time' & 'level' pairs, like an envelope. The main function is getlevelattime which returns the linearly interpolated at a specified time index for use in edit_dynamics. There are also some transfomation functions that will come in handy as well. A part of me wonders if this should be an abstract Envelope or Breakpoint struct so that they could be used for velocity changes as well as pitch or time changes etc.

Pull Request type

Please check the type of change your PR introduces:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

-

-

Does this introduce a breaking change?

Other information