Is this the 'right' way to do a log curve? [Yes]

Hi
my maths game is weak - is this the ‘correct’ way to do a log curve on a line ramp? Looking to create some bell/sine shapes on amp LFOs. Is there a native function in Sonic Pi that does it for us?

foo = line(0,1.0,steps: 8)
puts foo

8.times do
  tick
  amp = foo.look**0.95 #curve exponent < 1.0
  puts amp
  sleep 0.25
end

[EDIT] this is fine - I’m aware that many synth opts have an env_curve parameter, so I’ll do a bit more tutorial diving. Apologies for the noise.

Thanks
PD-Pi

I dont know the “correct” way, but perhaps you can use something from these posts

Basic log

@Amiika translated functions from https://easings.net/ to Sonic Pi here
Little fading library

2 Likes

Ah, easing functions, takes me back to my old MaxMSP days!