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 › ESS - Samples playback question
Page Index Toggle Pages: 1
ESS - Samples playback question (Read 928 times)
ESS - Samples playback question
Oct 25th, 2006, 8:51pm
 
Okay, this question is going to show you just how audio illiterate I am, but here it goes anyhow.

I need to do some audio analysis.  Simple enough.  But I want to use saveFrame to save out screengrabs so I can piece together the result into a quicktime and then paste in the audio (Like I used to do with Sonia until my new Intel Mac rendered jSyn useless for now).  So this means I need to do my analysis at a specified framerate instead of realtime.

I am porting over my code from Sonia and I am running into some problems.

1) With Sonia, I could say mySample.play(starttime, endtime) and play a specific portion of the total audio, but I cannot figure out how to do this with ESS aside from using cue(starttime) and trying to make it pause once endtime is reached.  Is there a way to play the audio directly from a sample array of floats?

2) Right now, I am analyzing every 1/24th of a second of audio and then getting the FFT for that 1/24th of a second.  I do that by copying over sample frames to my sample float array and then dealing with that.  But is there a different easier way I am overlooking (that could possibly solve problem #1? See my code below.

Code:

void prepareClip(){
startTime = int(myTime * sampleRate);
endTime = startTime + sampleLength;

for (int i=startTime; i<endTime; i++){
sample[i - startTime] = myChannel.samples[i];
}
myFFT.getSpectrum(sample, 0);
myTime += (1.0/float(framerate));
}


Any help would be appreciated.  Thanks.
Re: ESS - Samples playback question
Reply #1 - Oct 31st, 2006, 11:17pm
 
You can use in() and out() to set in and out points:

http://tree-axis.com/Ess/AudioChannel/AudioChannel_inM.html

http://tree-axis.com/Ess/AudioChannel/AudioChannel_outM.html

There are some FFT examples up on the site.

K
Page Index Toggle Pages: 1