Post Ax7jZHQ21U3clDNvai by wolf480pl@mstdn.io
 (DIR) More posts by wolf480pl@mstdn.io
 (DIR) Post #Ax7jZFnM3nWdiyHWfQ by unfa@mastodon.social
       2025-08-13T09:56:33Z
       
       0 likes, 0 repeats
       
       So working on @liblast I have recently wanted to add some basic sound to Movers (lifts, doors, etc). I realized that making a motorized platform move with beliveable sound is not trivial. My constraints are: it has to be fully deterministic - the mover is lerping a value of `move_progress` between 0 and 1. So no smoothing over time is allowed 0 is rest position, 1 is target position (say with a simple lift it's floor 0 and floor 1 for example). It has to believably speed up and slow down.
       
 (DIR) Post #Ax7jZHQ21U3clDNvai by wolf480pl@mstdn.io
       2025-08-13T10:10:16Z
       
       0 likes, 0 repeats
       
       @unfa @liblast f = x * (1-x)?
       
 (DIR) Post #Ax7lweEFa8gA4b92GG by bloodaxe@fosstodon.org
       2025-08-13T10:36:51Z
       
       0 likes, 0 repeats
       
       @wolf480pl@unfa @liblast Man I need to fresh up on my math again... 😵
       
 (DIR) Post #Ax7mb4pS6RSU9fp8AS by wolf480pl@mstdn.io
       2025-08-13T10:44:14Z
       
       0 likes, 0 repeats
       
       @bloodaxe @unfa @liblast Just an upside-down parabolaIt's probably not the best curve for this but it's a start
       
 (DIR) Post #Ax7tC5nq2n2dcD6Prc by unfa@mastodon.social
       2025-08-13T11:16:22Z
       
       0 likes, 0 repeats
       
       @wolf480pl @liblast I have come up with a super smooth function for position based on sinus, but what would be the 1st derivative a.k.a speed?Would your curve be it? :D
       
 (DIR) Post #Ax7tC7BctpfDuHEva4 by unfa@mastodon.social
       2025-08-13T11:20:31Z
       
       0 likes, 0 repeats
       
       @wolf480pl @liblast Hold on, I think i got it:
       
 (DIR) Post #Ax7tC7sALfgw2D8tt2 by unfa@mastodon.social
       2025-08-13T11:33:09Z
       
       0 likes, 0 repeats
       
       @wolf480pl @liblast Simplified and unbounded forms - if you clamp inputs to [0,1] it should give the same results.Position: y=(sin((2x-1) * pi/2)+1)/2Speed: y=(cos((2x-1) * pi)+1)/2
       
 (DIR) Post #Ax7tC8Vry3S01Liblw by unfa@mastodon.social
       2025-08-13T11:46:12Z
       
       0 likes, 0 repeats
       
       @wolf480pl @liblast I wonder if splicing straight segments into the middle of these curves would still keep 1st and 2nd derivatives continuous...Because then these could be used to speed up. slow down but otherwise keep the middle section at "full speed".When a machine has a speed limit, it would peak at some point.Not sure how am I going to do that though...
       
 (DIR) Post #Ax7tC99DbkvTzO826a by f4grx@chaos.social
       2025-08-13T11:53:13Z
       
       0 likes, 0 repeats
       
       @unfa @wolf480pl @liblast straight segments have constant values as derivatives so the speed would have jumps.
       
 (DIR) Post #Ax7tC9iJVGzzkEY3o8 by wolf480pl@mstdn.io
       2025-08-13T11:58:05Z
       
       0 likes, 0 repeats
       
       @f4grx @unfa @liblast you can connect a straight segment to a sin though, just make sure your slope matches the derivative
       
 (DIR) Post #Ax7tGlspX1LbHffUuG by wolf480pl@mstdn.io
       2025-08-13T11:58:59Z
       
       0 likes, 0 repeats
       
       @f4grx @unfa @liblast well, 1stFor 2nd you'd need to splice it in a place where the curve has a 2nd derivative of zero. There are 2 such places.