[chuck-users] recording audio input under ChucK control

Robert Poor rdpoor at gmail.com
Wed Feb 18 11:16:44 EST 2009

fellow chukka's:

I have not yet found an obvious way to record audio input under ChucK  
control.  The SndBuf.write() method is documented as "not yet  
implemented", and test code appears to confirm that it isn't  

I want to use ChucK to record snippets during a live performance using  
MIDI input to control when the recording starts, then use ChucK to  
play back processed snippets.  I *really* don't want to be switching  
apps (more specifically -- I don't want to be fiddling on a Mac  
keyboard), so I need Chuck to control it all.

So my gambit -- yet to be tested -- is to use ChucK to spawn a command  
line function to do the recording, such as:

   def void recordSnippet(string toFilename) {
     system ("sndrecord " + toFilename);

... where sndrecord is a command-line recorder (such as /Developer/ 

Questions, always questions:

- Given my constrains (real-time recording must be controlled from a  
MIDI device, not from a Mac keyboard) is this a sensible approach?   
How have other people managed this?

- in the ChucK system() call, is there a way to attach to stdin /  
stdout of a spawned process?  In this particular case, I would like to  
send it a string to stdin of the spawned process to tell it when to  
stop recording.

- Aside from the afrecord utility in Mac OS /Developer, are there  
other command-line recording apps that people use and like?


- Rob

More information about the chuck-users mailing list