Placing objects along a curve based on peaks of another curve

Hello,

I have a path curve and an F curve (animation curve)
I would like to place an object on the path curve, every time the fcurve crosses a certain value.

The red curve is the F curve. The black curve is the path curve, I want to place a mesh on the path curve, for every peak on the F curve.
Despite the relative length of the curves, the placement should behave as if they are same length, so if there is a bump in the exact middle of the F curve then the object will be placed in the exact middle of the path curve.

Ideally I would like if there was a script I could run to do this and then this script would look at these two curves, crunch the numbers and then call a python function MyFunction(positionOnPathCurve, FcurvePeakHeight) for every peak in the F curve, so then I could easily put my own code there and spawn the objects at those locations and do the other stuff I want.

I know this is quite complicated and I’m not even sure if this is possible to do with scripting in blender, but I figured it was worth a shot trying to ask anyway.

Thanks!