Redo backend on how animations are generated (adding Note On + Note Off, generated oscillation functions, ADSR, etc..)
One major disadvantage over the current result is the number of keyframes (points) on the graph. I want a more systematic approach instead of evaluating and adding each current FCurve and keyframing it to the target each frame (the current method for all evaluations in MIDIAniamtor).
I'm trying to develop an algorithm that will take the note on and note off FCurves for an object and create a composite curve, similar to how MIDIAnimator works now, only with Note On support.
The current evaluation method:

reference curve being this:

This is (sort of) the desired result, but when the graphs overlap, the keyframes should add together to produce a new composite curve.

I'm looking for some more input and knowledge on how to do this. Specifically how to take lists of keyframes and combine them together to make composite curves as shown in the first image.
For the most part, I have figured it out with commit 79194dbb97a7c13788b9fa1001b962ec257d5068. I'd still like intersections between graphs to be accounted for, but that'll require calculating them (possibly using a sweep line algorithm?)
I believe dampened oscillations and ADSR will be enabled for a later update. Not important at this moment.