Tinkering around with an old project of mine, I decided to experimentally add some audio panning. That involves picking a value between -100 and 100, from left to right speaker, for the sound/channel/etc. After fooling around with it a bit, I got this to work:
Play sample Coin
Set pan of sample Coin to
Min(100, Max(-100, ((X( "Standard Coin" )-X( "Screen Center Marker" ))*ScreenWidthRatio( "(System) Status and Score" ))/1000))
I have a tiny invisible dot that's always centered on the screen, which I put in for other reasons. So I subtract the item's X by the center of the screen, and multiply that by the ratio of half of the screen width, 320. (I've been thinking about switching to widescreen, or even maybe offering a toggle, so I didn't want to just hardcode .625. I also had to do the divide at the end because I can't actually keep a decimal value in an Alterable Value, so I had to use 625 then move the decimal after.)
This works, and I'm very happy for that. The only thing is, it seems to (or maybe MMF just does in general) seem to bias sides very quickly, so I'd like to weight the range so that items roughly in the middle of the screen default to 0, or a low separation, but then the separation ramps up to -100 increasingly quickly the closer an item is to the left, and the reverse. Unfortunately, I'm really rusty, and I've completely forgotten how to do this mathematically.
I think what I'm looking for is a Bell Curve, but I'm not really sure about that, and I'm not really sure how to modify y = 1/(e^x²) (or -y possibly in this case) to adjust how much of the middle flattens out to 0, or even exactly which numbers I should plug where. I've done a bit of searching on the subject, but right now I've got myself a bit jumbled, and I could be barking up the wrong tree. Any suggestions?
Edit, y = 1/(e^-x²) is actually much closer to what I hope to replicate. Plug that into WolframAlpha to see what I mean.