Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Re: [improved] Gradually change TempoClock tempo [ accelerando / decelerando ] [extension]
name
code content
// Put this in your extensions directory + TempoClock { gradualTempo_ {|newTempo, beats=4, quant=1| if(beats <=1, { this.tempo_(newTempo); },{ var startTime = this.nextTimeOnGrid(quant); this.schedAbs(this.nextTimeOnGrid(quant), { this.prRecurseGradualTempo(newTempo, beats); }); }); } prRecurseGradualTempo {|finalTempo, beatsRemaining| if(beatsRemaining <= 0, { this.tempo_(finalTempo); }, { var stepTempo = 1.linexp(0, beatsRemaining, this.tempo, finalTempo); this.tempo_(stepTempo); this.sched(1, { this.prRecurseGradualTempo(finalTempo, beatsRemaining-1); }); }); } }
code description
This gradually changes the tempo of a TempoClock, each beat of a specified number of beats, and starting at the next bar. Personally, I was not able to heavily distinguish between `.linlin` and `.linexp` for reasonable musical tempos. There may be a mathematically smoother way of handling this at the control rate. This function does not gracefully handle multiple simultaneous invocations.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change