Before you jump into the world of 4-channel sound system, you'll need to have a channel test tool for sanity's sake. The “Slate” program consists of your voice saying. “front left, front right, rear left, rear right” or something to that effect. It's for testing the 4-channel stations (each time you start working).
NOTE: If you're considering using your laptop for your homework, see wiki for instructions using the quad system, which includes a link to download drivers if you're using your laptop. Laptops will also need audacity, qjackctl, sox, and miniAudicle. If you do not want to go through the hassle of downloading and setting up additional softwares, please use one of the CCRMA stations with the Quad system. Additionally, if using your laptop, you will also need to modify some of the file paths used in the provided chuck files. For more about laptop requirements, see below.
At a quad station with house linux computer (or laptop where you hear all four channels, even if they are via headphones) launch jack and prepare its setup to be connected to the appropriate soundcard. You can launch the control panel for Jack with the following command in terminal:
qjackctl &
NOTE: If you're working at a house linux computer via headphones on a Delta soundcard, you will still hear all four channels but they will be "hard-panned" left and right.
Hit start. You're good if the GUI starts showing a changing computer status (otherwise, you will get a complaint popup). Sound is now live.
Download and open DacBeeps.ck in miniAudicle. In miniAudicle preferences, set output channels to 4.
Preferences > Audio > Output Channels > 4
Adjust speaker levels for reasonable balance. If this is your first miniAudicle experience, you need to “start virtual machine” and then hit “add shred” ('+' icon). If a channel is missing, that will need to be fixed before proceeding. Quit miniAudicle.
Create a directory (new folder) for your work and plug in your mic into the first channel of the soundcard. Use audacity to record your voice as you name each loudspeaker in the quad setup. Check that audacity's preferences are set so that it is connecting its audio via jack and recording to a mono file. Remember to set your record quality to 48kHz / 16bit. Adjust the mic level knob to see good levels when you speak. Check for a strong level in the file but take care to avoid clipping. Save it as “Slates.wav” by exporting it into your new directory. Check that it's sounding good.
NOTE: Please do not use a built-in laptop microphone or built-in laptop audio input.
Two preliminary versions in ChucK will get you to the final version of the program:
SndBuf snd0 => dac.chan(0); // connect a sndBuf to 1st speaker "slates.wav" => snd0.read; // load sound (modify path for your system) 1::day => now; // stall for 1 daySave as a file called slates.ck.
... // copy first 2 lines from above code-block to have 1st speaker as channel 0 SndBuf snd1 => dac.chan(1); // 2nd speaker as channel 1 "slates.wav" => snd1.read; // read the same file for channel 1 // repeat for 3rd and 4th speakers ... 1::day => now; // stall for 1 dayYou can overwrite slates.ck with this new code.
snd0.gain(0.0); // mute by reducing gain to 0.0
// loop the following block while (true) { snd0.gain(1.0); // unmute snd0 by setting gain to 1.0 snd0.pos(28000); // play from position 28000 samples 63750::samp => now; // stall for length of utterance snd0.gain(0.0); // mute snd0 500::ms => now; // stall for half second // ...do next channels... }HINT: These positions and lengths in samples can be measured directly in Audacity by right-clicking on the time measures that show at the bottom of the app. Set the format to read in samples.
// connecting sound sources to input of binaural mixer mySndBuf0 => Binaural4.input[0]; mySndBuf1 => Binaural4.input[1]; mySndBuf2 => Binaural4.input[2]; mySndBuf3 => Binaural4.input[3];
... // MODIFY THIS: files will be written into current directory "/doc/220a/" => string myPath; (now / 1000::ms) $ int => Std.itoa => string timetag; ...Note that the produced files are pseudo-sequentially numbered so you will not have dupliacates unless you try more than 1000 times.
hoch$ sox -M /doc/220a/L_96.wav /doc/220a/R_96.wav /doc/220a/Stereo_96.wav
sudo port install soxThen follow the step above to merge your mono files into stereo. Alternatively, you can just use Audacity to interleave two mono files into one stereo file.