Hi I've got a breakbeat that I chopped up at every 16note. Now I'd like to play these samples one after another. Could set up 16 sndbuf's each connected to the dac, but wouldn't that be inefficient? I'm thinking it might be smarter to load the samples into an array and play a different one on each pass, but is this possible. Or whould there be a really bright way to go about this? -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Hi Atte, You could use one sndbuf! Instead of starting the sndbuf at 0 (measured in samples) for each chunk you could just start the sample at different points. If you know that your sample is exactly 16 beats then you can divide the sample by sixteen and you can do everything from there. mysample.samples() / 16 => int 16th; // play the 5th sixteenth note // 0-15 instead of 1-16 4*16th => mysample.pos; 16th::samps => now; To play the whole file you would do the classic: 0=> mysample.pos; mysample.samples()::samps => now; Please forgive me if I have made a syntax error. I am on a machine without ChucK. I hope this helps! Any other ideas? --art On 25-Jun-06, at 3:58 PM, Atte André Jensen wrote:
Hi
I've got a breakbeat that I chopped up at every 16note. Now I'd like to play these samples one after another. Could set up 16 sndbuf's each connected to the dac, but wouldn't that be inefficient?
I'm thinking it might be smarter to load the samples into an array and play a different one on each pass, but is this possible.
Or whould there be a really bright way to go about this?
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/ compositions _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Have a look at the breakbeat chopping joypad patch I posted a while back, that one does something like this (for 32 chops, I think). I still mean to upload it to the Wiki but time has been it's characteristic self for me lately. I could resend it to anyone interested, it should be in the archive as well. I did quite a lot of stuff with resequencing wave files, in ChucK in the past months so if you get stuck do give a shout. Kas.
Adam Tindale wrote:
// play the 5th sixteenth note // 0-15 instead of 1-16 4*16th => mysample.pos; 16th::samps => now;
I ended up with something similar. The thing is I doesn't just want to play the breakbeat, but also change it's feeling. I can now do something like: breakBeat beat; beat.load("samples/de_la_soul.wav"); [0,-1,14744,24389,29338,-1,44053,-1,58552,-1,73045,-1,87780,-1,102496,-1] @=> beat.start_points; beat.play(); These "sample points" are the placement (in samples) where the beats start. Because I have events spit out every 32th note, the above will sync perfectly to what-ever else I have running and will sync to me tapping on D2 on the keyboard. Nice. Chuck surely rocks! It's such a pleasure to work in. -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
participants (3)
-
Adam Tindale
-
Atte André Jensen
-
Kassen