hi, sorry about this stupid question, but i can't seem to find any documentation on how to use chuck to process audio files, i.e. open a wav, aiff, whatever and run it through some filters. is this possible??? thx - jochen
Hi Jochen, Check out the SndBuf ugen--its a wrapper around Erik de Castro Lopo's libsndfile, so it can handle a ton of (non-compressed) formats, including WAV and AIFF. See examples of usage here: http://chuck.cs.princeton.edu/doc/examples/basic/sndbuf.ck http://chuck.cs.princeton.edu/doc/examples/basic/valueat.ck Is that what you were looking for? spencer On Jan 19, 2007, at 5:13 PM, jochen lists wrote:
hi, sorry about this stupid question, but i can't seem to find any documentation on how to use chuck to process audio files, i.e. open a wav, aiff, whatever and run it through some filters. is this possible??? thx - jochen
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
hi yes, that is exactly what i was looking for. not sure why i didnt find that the first time around... thanks!!! also thanks to David powers for the example code! can't wait to start to use this stuff live! - jochen On Jan 19, 2007, at 5:56 PM, Spencer Salazar wrote:
Hi Jochen, Check out the SndBuf ugen--its a wrapper around Erik de Castro Lopo's libsndfile, so it can handle a ton of (non-compressed) formats, including WAV and AIFF. See examples of usage here: http://chuck.cs.princeton.edu/doc/examples/basic/sndbuf.ck http://chuck.cs.princeton.edu/doc/examples/basic/valueat.ck
Is that what you were looking for?
spencer
On Jan 19, 2007, at 5:13 PM, jochen lists wrote:
hi, sorry about this stupid question, but i can't seem to find any documentation on how to use chuck to process audio files, i.e. open a wav, aiff, whatever and run it through some filters. is this possible??? thx - jochen
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hello... Use the SndBuf class to play a sample:
http://chuck.cs.princeton.edu/doc/program/ugen_full.html#sndbuf
Here's the example code from ChucK docs*:
// the patch
SndBuf buf => dac;
// load the file
"../data/snare.wav" => buf.read;
// time loop
while( true )
{
0 => buf.pos;
Std.rand2f(.2,.9) => buf.gain;
Std.rand2f(.5,1.5) => buf.rate;
100::ms => now;
}
*But note, that code is changing the gain and rate of the sample
randomly - you would want a rate of 1.0 to just play the file at
original speed/pitch.
Anyway, you can just plug SndBuf it into a filter, set the filter ...
and there you go!
Oh and use WvOut to record ChucK output to a file:
http://chuck.cs.princeton.edu/doc/program/ugen_full.html#WvOut
"This class provides output support for various audio file formats.
It also serves as a base class for "realtime" streaming
subclasses... WvOut writes samples to an audio file... WvOut currently
supports WAV, AIFF, AIFC, SND (AU), MAT-file (Matlab), and STK RAW
file formats."
Hope that helps.
~David
On 1/19/07, jochen lists
hi, sorry about this stupid question, but i can't seem to find any documentation on how to use chuck to process audio files, i.e. open a wav, aiff, whatever and run it through some filters. is this possible??? thx - jochen
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (3)
-
David Powers
-
jochen lists
-
Spencer Salazar