Diff from Gradually change TempoClock tempo [ accelerando / decelerando ] by Tom Dugovic (30 Jan'22 19:49) to Re: [improved] Gradually change TempoClock tempo [ accelerando / decelerando ] [extension] by tom.dugovic (13 Apr'22 02:50)

name
Re: [improved] Gradually change TempoClock tempo [ accelerando / decelerando ] [extension]
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.
code
// Put =this in your extensions directory + TempoClock(120/60).pe { grmanent_(trdue); ( ~change_clock_tTempo_ = {|clock, tnewTempo, beats=4, quant=1| if(beats.do <=1, {|beat| var this.tempo_(newTempo); = be },{ var st.lartTinmexp(0, bea= this-1, clock.tnempo, xteTimpoeOnGrid(quant); clock this.schedAbs(clockthis.nextBar + bTimeOnGrid(quant), { "New this.prRecurseGradualTempo: ".post; (stnepwTempo*60).post;, " BPM".posbeatlns); clock.tempo_(stepTempo}); }); }; nprRecurseGradualTempo {|final; }; PTempo, beatsRemaindeing| if(\beatsRemaining <= 0, { \oc this.tempo_(finavlTe, 4,mpo); \dur, 0.5 }, { \deg var stepTe,mpo Ps= 1.lineqxp((0..7), beatsRemainf) )ing, this.play(tempo, quafint: 4alTempo); ); ~c thangis.te_clmpock_(stepTempo); this.valusched(t1, 200/60, 16);{ ~c thangis.prRe_curseGradualock_tTempo.v(finaluTe(tmpo, 50/60,beatsRemaining-1); 8 }); t.tempo*60 }); } }
category tags
code fork, tempo, accelerando, decelerando
ancestors
1-5fG