[chuck-users] Array of SndBufs at different rates

Mario Buoninfante mario.buoninfante at gmail.com
Fri Jan 10 13:51:27 EST 2020


you can also find more info here:
https://en.flossmanuals.net/chuck/_full/#arrays

On Fri, 10 Jan 2020 at 12:28, Matthew.Noone <Matthew.Noone at ul.ie> wrote:

> Hi all,
> I'm trying to figure out the easiest way to setup an array of the same
> SndBuf playing at different rates.
>
> I'm using a Gong sample.  Playing that back at different rates to make
> basic melodic patterns.
>
> I can make a random function but I don't know who I can set an array of
> rates which I can then randomise.
>
> Any ideas?
>
> Here is my existing code with random function. (I tried writing an array
> at the start but not sure how to call that?)
>
> Sorry for such an easy question...
> MJ
>
> //Sndbuf
>
>
> //4 => int gongs;
>
> //[.25, 0.5, 1.0, .25] @=> float rates[];//array of possible rates
> (changing will change harmony)
>
>
> //program
>
> SndBuf mySound => Delay d => JCRev rev => Gain g => dac;
>
>
> 0.8 => rev.mix;
>
>
> //delay and rev setup
>
>
> d => Gain feedback => d;
>
>
>
>
> while (true)
>
> {
>
>     .02 => g.gain;
>
>     me.dir()+"Samples/MotherGong.wav" =>mySound.read;
>
>
>
>
>
>
>
>     0 =>mySound.pos;
>
>     Math.random2f ( 20.1, 22.01 ) => mySound.rate;
>
>     Math.random2f( 0.3, 0.5) ::second => d.max;
>
>     Math.random2( 30, 70) ::ms =>d.delay;
>
>
>
>     Math.random2f( 0.3, .8) => feedback.gain;
>
>
>
>     0.50 ::second => now;
>
>
>
>
>
>
>
> }
>
>
> Dr. Matthew James Noone
> *Sarode Artist & Irish Research Council Postdoctoral Fellow*
> *Irish World Academy of Music and Dance*
> *University of Limerick*
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200110/01e375b5/attachment-0001.html>


More information about the chuck-users mailing list