wavesjs / waves-ui

A library to display and edit audio data and timeseries data in the browser.
http://wavesjs.github.io/waves-ui/
BSD 3-Clause "New" or "Revised" License
122 stars 16 forks source link

Add "snap to grid" option #15

Open echo66 opened 9 years ago

echo66 commented 9 years ago

When dealing with music production (e.g.: MIDI tracks) and some types of music annotation tasks, the segments should be snapped to a grid after editing them, unless the user/programmer says otherwise.

b-ma commented 9 years ago

Actually, it's a matter of writing a TimelineState to handle that, the function which generate the data for grid (es6/axis/grid-axis-generator.js) could be passed to this State, then the data of the segment would have to be modified to snap to the grid before updating the shapes. I really think you don't have to write a new SegmentBehavior to achieve this.

While this State would be interesting to have, it's not in the pipeline yet as we don't really have a real use case for that, but if you need this State for your application and you are in the mood to write a proposal it would be interesting to see it.