_______________________________________________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 FellowIrish World Academy of Music and DanceUniversity of Limerick
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users