[chuck-users] Any way to use .pos passing a string?

Julien Saint-Martin julien.saintmartin at googlemail.com
Tue Jul 8 05:28:36 EDT 2014


Hi Federico,

If you want to use pos function of SndBuf object. You should use SndBuf 
object directly.
To do this, use a SndBuf array instead of a string array in your while loop.

Happy ChucKing,
Julien



On 07/07/2014 01:13, Federico Lopez wrote:
> Hi,
> I have an array of strings (p1) that contains the same names of  
> SndBuff  instances (kk sn), I would like to pass the strings of the 
> array to trigger samples and I don't know how to do it.
>
> Here is some test code:
>
> SndBuf kk => dac;
> SndBuf sn => dac;
>
> me.dir() + "/audio/kick_01.wav" => kk.read;
> me.dir() + "/audio/snare_01.wav" => sn.read;
>
> kk.samples() => kk.pos;
> sn.samples() => sn.pos;
>
> while( true )
> {
>     ["kk", "sn"] @=> string p1[];
>
>     for( 0 => int i; i < p1.cap(); i++)
>     {
>         0 => p1[i].pos; // not working
>         0.25::second => now;
>     }
> }
>
> Thanks,
>
> Federico López
>
>
>
> _______________________________________________
> 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/20140708/8a85579c/attachment.html>


More information about the chuck-users mailing list