gogins / csound-extended

Extensions for Csound including algorithmic composition, Android app, and WebAssembly.
GNU Lesser General Public License v2.1
40 stars 1 forks source link

Inconsistent handling of negative durations in Event and Score #193

Closed gogins closed 2 years ago

gogins commented 2 years ago

Make it so that if duration is negative, the onset of the duration is made the new onset (start time) of the note, and the note still has the same absolute duration.

Logically, it should still be possible to NOT do this.

gogins commented 2 years ago

There should be something like a fix_negative_duration method that is used everywhere, and an option not to use it.

gogins commented 2 years ago

As the [] operator is not virtual with respect to Eigen::VectorXd, it would potentially be inconsistent to call correct_negative_duration from there. Consequently, I will call it from the Score class.

gogins commented 2 years ago

I have done this as far as I can see. There may still be potential inconsistencies, whenever an Event iterator is used to transform the Events.