[Impromptu] smooth value changes
Andrew Sorensen
andrew at moso.com.au
Wed May 12 23:15:21 GMT 2010
Hi Si,
Firstly you might be interested in "setp"
(define dls (au:make-node "aumu" "dls " "appl"))
(au:connect-node dls 0 *au:output-node* 0)
(au:update-graph)
(define loop1
(lambda (beat pitch)
(setp dls 0 (* 100 pitch) 4)
(play dls 48 80 4)
(callback (*metro* (+ beat (* 1 4))) 'loop1 (+ beat 4)
(random 0 12))))
(loop1 (*metro* 'get-beat 4) 0)
Now this works OK because our rate of change isn't to high.
We can improve the smoothness significantly by increasing the temporal recursion speed of setp (actually behind the scenes it's au:envelope-change we need to modify)
(define au:enveloped-change
(lambda (time au id scope elt envelope end-time)
(au:set-param time au id scope elt (envelope time))
(if (< time end-time)
(callback (+ time 200) 'au:enveloped-change (+ time 500) au id scope elt envelope end-time))))
(define loop2
(lambda (beat dur pitch)
(setp dls 0 (* 100 (- pitch 12)) dur)
(play dls 48 80 dur)
(callback (*metro* (+ beat (* 1 dur))) 'loop2 (+ beat dur)
(random '(1/4 1/2 1 4))
(random 0 24))))
(loop2 (*metro* 'get-beat 4) 4 0)
Of course this is linear change but you're free to write your own non-linear change function.
Cheers,
Andrew.
On 13/05/2010, at 2:00 AM, Si Mills wrote:
> Hi
>
> I seem to be working my way through all the audio programming languages in the known universe :)....I'd heard of Impromptu, but never really got around to checking it til now. I'm honestly a bit gob-smaked at how much power you are able to lever from the core audio/ audio unit system! I had no idea that this was possible, but its all clear and makes perfect sense. Having the option of using ready rolled instruments and effects will make creative ideas flow a lot more quickly. A lot to learn first.....anyhow I digress
>
> I was running a call back loop and changing the parameter of the automat synth randomly. Then it occurred to me whether there was a function to smooth or lag the parameter jumps, sort off like a low pass filter to smooth the transitions.
>
> Then to that end, hows does one achieve portamento effects on say the frequency fed to the basic oscillator?
>
> many thanks
> Si
> _______________________________________________
> Impromptu mailing list
> Impromptu at lists.moso.com.au
> http://lists.moso.com.au/mailman/listinfo/impromptu
More information about the Impromptu
mailing list