Pinning start & end points of a sine wave path

Is it possible to tell a drawn path that it is only allowed to be in a certain area without masking or clipping it but rather deforming it?

I want to center the beginning and end of a drawn sine path.
something like this example from sine vibes:

use gain ramps, applied to your Path y-coordinates

1 Like