We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Piano Roll: Synchronously manipulating sampleRate
Page Index Toggle Pages: 1
Piano Roll: Synchronously manipulating sampleRate (Read 940 times)
Piano Roll: Synchronously manipulating sampleRate
Nov 19th, 2009, 4:46pm
 
http://www.vimeo.com/7526719

I'm writing an application that will act as a piano roll / musical sequencer. I'd like the application to generate audio by manipulating the sample rate of a specified sound file in order to change pitch.

For things like vibrato or portamento (slides), sample rate would have to be changed rather quickly. With Minim, I've tried using threads to set sample rate when a "playhead" passes certain points (essentially changing sample rate every frame for vibrato and slides). Of course, this maintains no semblance of musicality, the amounts of time for which notes are played are completely arbitrary .. I'm guessing that's just too expensive an operation to be performing every frame.

I'm looking for a good strategy to "buffer" this manipulated sample data, as it seems foolish to try and generate it in "real time". In the future I'd like to do so for multiple tracks. Any guidance on the subject would be appreciated (is Minim the right library to use for this  Should I be writing my own Oscillator that reads ahead from an AudioSample)
Re: Piano Roll: Synchronously manipulating sampleRate
Reply #1 - Dec 23rd, 2009, 6:18am
 
Hi George,

the Beads library (beadsproject.net) offers a sample player that can have its playback rate controlled by another audio device at audio rate, so you can easily do varispeed sample playback and vibrato effects. You can also lock your sample to a clock (improved version of this coming soon).  

The library is still not very well documented, but there are examples that demonstrate this effect, and I'd be happy to help if you're stuck.

Cheers,

Ollie
Page Index Toggle Pages: 1