Callback when an animCurve is changed?

I wrote a script that gets an animCurve as input and computes the derivative. The output is another animCurve. If the user changes the original curve, the derivative would have to be updated. So my question is: Can this be automated, e.g. with scriptJob? I tried scriptJob -attributeChange for the attributes ktv, ktv[0], ktv[0].kt, ktv[0].kv, but the script is not executed when I change a key.

Other ways I could think of would be: Hack every Alias script that changes animCurves, and insert a callback. Which seems quite tedious. Or: Derive from MFnAnimCurve, and insert the callback there. Which seems tedious too, and would probably not even work. Or: Write a node plugin that computes the derivative on the fly, which would probably be the best.

Any suggestions or thoughts appreciated.

Api is the way to go, i went into this halfay about 2 incarnations of maya ago but time costrains led me to abandon the project. Hope youll fdo better than me. Any chance i could peek on the code?

Wrote you a PM.