ramping values up and down over a specified time
Hi. I am working on a music player patch that allows you to mix between two audio files, similar to a piece of DJ software.
What I am stuck on is finding a way to increase or decrease the pitch / speed by a specified percentage over a specified time in a smooth fashion. So what I basically want to do is take the pitch value which I will call 'x' and increase it by a changeable percentage 'y' over 'z' amount of time. Ideally I would like to be able to control x, y and z by a number box.
Any suggestions would be really helpful. If anyone is unsure of what I'm actually trying to replicate; it is the same as the + and - buttons you would find underneath the pitch sliders on a CDJ.
Thanks very much
I just posted a similar question.
In that instance we were talking about tempo but you could apply it to any number box for example one controlling pitch. If you want it to be in percentages you could use a scale object to make sure your ranges are between 0 - 100.
the [line~] object takes variables via a message ($1, $2 $3) where $1 is the start and the next two are destination and time; you can do your maths outside the message; maybe look at [curve~] too?
Brendan
look to gizmo~ for pitch changing, independent of speed changing. changing the sig~ will change the pitch, so you might need to fiddle a bit. You can also run the sig~ value through [!/ 1.] -- this gets the reciprocal -- then that goes into gizmo~. This will adjust speed and keep the pitch the "same", that is, transpose it to keep the original pitch.
You'll get pretty different results with the pfft~ size, the tradeoff is between response time (latency) and pitch accuracy. You'll need to fiddle a bit to decide what works best for the kind of music you're using.
Thanks for the replies!
There are some good example patches in "grizzle's" thread and yes the line~ object with a message is exactly what I was looking for. Just need to figure a way to ramp back down to the original value / tempo in one smooth sweep.
ALex
slightly OT
is [gizmo~] brilliant at independent time/pitch-shifting, or just OK?
my granulator does this REALLY well...
Brendan