[chuck-users] interpolated step? (equivalent to max's line)
Lars Ullrich
mail at larsullrich.de
Fri Jul 13 17:18:56 EDT 2012
what about:
float lineInterpol(float startValue, float endValue, float percent) {
if (startValue == endValue) return startValue;
return ((1 - percent) * startValue) + (percent * endValue);
}
Am 13.07.2012 um 22:21 schrieb George Locke:
> I was worried I'd end up with s/t like Jordan's solution; can't try Kassen's suggestion till i get home, but it does look a lot cleaner.
>
> @Jordan If you want a pitch envelope, you can do s/t like this:
>
> Envelope e => Gain g => SinOsc s => dac;
> Step s=> g;
> 0 => s.sync; // binds s.freq to input from g
>
> 100 => float minFreq;
> 500 => float maxFreq;
> minFreq => s.next;
> (maxFreq-minFreq) => e.gain; // noteOn() no longer limited to 0-1 ;)
> e.noteOn();
>
>
> I learned how to do this last night for a percussion patch i'm working on.
>
>
> On Fri, Jul 13, 2012 at 3:38 PM, Kassen <signal.automatique at gmail.com> wrote:
> With the way I illustrated you should be able to write arbitrarily
> large or small values to either .value() or .target().
>
> It is only when using noteOn() and noteOff() (or whatever they were
> called) that it is forced in the 0-1 range, I believe.
>
> Yours,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
------------------------------------------------
Audio Engineer / Developer
Lars Ullrich
F: 00 49/ (0) 30 569 70 435
H: 00 49/ 0172 477 09 77
http://www.larsullrich.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120713/eb0ce75d/attachment.html>
More information about the chuck-users
mailing list