Hello ChucK people, Been following the list for a while now but this is my first post. I am trying to create a Random Chuck Beat slicer. Basically input any loops, set the rate and set the number of slices to use and it will automatically create random breakbeats from it. The problem is when I set the playback rate to anything other then half, single, double, etc. slices stop lining up properly. Debugging messages in the code produce the expected numbers but the audio is clearly not lining up. I have many other features planed but am unable to figure out what is going on here. Is my Math wrong? Is the SndBuf object twitchy? I have only tested it on windows in the miniAudicle so far. -Jonathan 1 => float rate; 8 => int NumOfSlices; SndBuf s => dac; "C:/breaks/amenst.wav" => s.read; s.samples() => s.pos; //Don't Play on Start 0.5 => s.gain; rate => s.rate; (s.samples() / rate) / NumOfSlices => float SliceSize; SliceSize::samp => dur SliceDur; SliceDur - (now % SliceDur) => now; //Sync while(true){ (Std.rand2(0, NumOfSlices - 1) * SliceSize) $ int => int NewPos; NewPos => s.pos; SliceDur => now; }
2008/6/5 Jonathan Siemasko
Hello ChucK people, Been following the list for a while now but this is my first post. I am trying to create a Random Chuck Beat slicer. Basically input any loops, set the rate and set the number of slices to use and it will automatically create random breakbeats from it. The problem is when I set the playback rate to anything other then half, single, double, etc. slices stop lining up properly.
While I realise you are after knowing what's wrong with your code -and I'd like to help- I don't quite have the time for debugging this at the moment. BUT. I just remembered I have a beatslicer lying around that I impulsively made because I had a few hours to kill a while back. I'm not really that into breaks anymore so I doubt I'll ever get back to it and it's somewhat crude here&there but it has plenty of comments as I send it to a friend to play with already. It works by taking a wave file which it assumes already loops properly. It tries to detect volume peaks and attempts to base slices on those (not on exact fractions of the length, this is more Jazz then House). It tries not to get fooled by random volume modulations and also discards very short slices. Hope this is of some use as a starting point. If you get something good using this I'd like to hear it. Cheers, Kas.
participants (2)
-
Jonathan Siemasko
-
Kassen