Wednesday, June 6, 2012

Recording Sounds

 Recording Sounds: Always Great When You Start Thinking Like a Researcher

So, today I wanted to be able to record voices and other sounds using ChucK. I did not really want to record ChucK compositions because I had done that before, but I wanted to be able to use an external microphone, or just an inbuilt microphone to make the recordings. I knew I had to use adc, but to what was a supposed to chuck it to? After some deep thinking, I thought I should chuck it to dac, but then how would it record the sound? I then thought doing the following: adc => SinOsc s => dac. I gave the
sine oscillator a frequency, and wrote a program with an infinite time loop so that the recording would go on until someone stopped the program. Unfortunately, my program did not work. I later on realized it could have been because the sine oscillator produces sound, and I could not record my sounds by chucking adc to the sine oscillator. I then thought I should just chuck adc to dac. Yes, I was very right, and before I tested my program Janet called me and told me how she had found a program that does the recording. It was quite a fulfilling moment when I realized that that was exactly what I was doing. I know it is not much code, and when I look at it, it isn't anything that can make anyone hit her head against the wall, but it always brings a sense of accomplishment and pride whenever I figure out something on my own. So, this is how you record voices in chuck: The time value can be anything you want. You might want to try different times and see if they affect the recordings in any way.

Required Program

adc => dac;
while(true){
       1::ms => now;
}


To record, if you are using the command line type:
>>> chuck foo.ck rec.ck  / >>> chuck foo.ck rec-auto.ck 

If you wanna record in silence, type -s after rec.ck, or rec-auto.ck

If you are using mini-Audicale put foo.ck as the first thread, and rec.ck/rec-auto.ck as the last thread.


No comments:

Post a Comment