How to: Binaural Mixdown


True binaural recording uses stereo mics pointed outwards from inside your ears to capture as closely as possible the exact sound pressure waves entering your ear canals. The binaural technique captures filter (transfer function) differences caused by body parts shadowing and reflecting sounds arriving from various directions: the ear flaps (pinnae), head, shoulders, etc. Played back over headphones or earbuds,binaural preserves the IID and ITD cues which are basic to sound localization.

In this part of the assignment, we'll use four channels of sound (giving you a much wider plane of possible locations for your sound sources - essentially, two in front of your listener and two behind, as in the quad speaker setups at CCRMA) and process those quad signals into a stereo binaural file for posting to the homework factory.

Testing the Quad Stations

Before you jump into the world of 4-channel sound system, you'll need to have a channel test tool for sanity's sake, and equipment that has more than two output channels. Its recommended that you find time to use the CCRMA stations, as they are setup to handle multichannel, while your laptop is likely only setup for two. NOTE: If you are 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 this hassle of downloading and setting up additional softwares, please use one of the CCRMA stations with the quad system.

In this section, we set up a quick test to make sure we're hearing all four channels. At a quad station with a 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 in miniAudicle. In miniAudicle preferences, set output channels to 4.

Preferences > Audio > Output Channels > 4

Adjust speaker levels for reasonable balance and add the shred. You should get one beep for speaker 1, two beeps for speaker 2, etc. up to four. When your'e hearing that, congratulations! You are now working in a world of multichannel.

Working in Multichannel

Using the code from lab, you can now send sounds not only from left to right and from right to left, but pan from behind your left shoulder to in front of your left shoulder, or diagonally across your body. (Again, if you're using the quad stations, you'll be able to experience this spatialization fully; if you are using the house heapdhones, and sending sound from channel 1 to channel 3, the sound won't pan at all because they will be sent to the same headphone.) Conceptualize at least one part of your composition such that you're taking advantage of the four possible audio outs. You can address each of these channels by using:


Note: A good way to pan in ChucK is to shred the file and pass through a portion of a wav file that you would like to pan between 2-4 channels with this file:, in which the third to last line, p.setPosition(Math.sin(t),0) can be changed to p.setPosition(Math.sin(t),Math.cos(t)) to send your sound in a circle around all four speakers (for example).

Preparing for Binaural Mixdown

In the next section, we will be using code that converts four mono .wav files to two stereo files by mixing them down to binaural. So, your radio play needs to be exported into four .wav files. Modify the "write to a file" code from previous assignments to output to four different .wav files. i.e. four of these with a naming convention of 'chan0','chan1', etc.:

dac.chan(0) => WvOut chan0 => blackhole;
me.Sourcedir() + "/chan0.wav" => string _capture0;
_capture0 => chan0.wavFilename;

Follow that code at the end of the file with the following for each WvOut object:


Stereo Conversion via Binaural

This section details the steps necessary to take your four mono .wav files and mix them down to stereo.
  1. Download and Once you add the file into the miniAudicle Virtual Machine, you do not need to create instances of it. It works as a singletone that handles all the binaural processing for you. Also note that you can shred (add/remove, "+"/"-") repeatedly, but you can only shred once, else the miniAudicle's console will complain that "class/type 'Binaural' is already defined in namespace 'global'", and you have to restart miniAudicle., however, reads in the four mono .wav files from your composition.
  2. IMPORTANT: You need to download and extract impulse responses (8 wave files, compressed), and move the "ir" folder to the same directory with source code! Alternatively, for a different sounding room you could use an impulse response taken from the CCRMA stage. If you use it, be sure to change the instances of ballroom to stage in the file.
  3. Change the file paths in so that they point to your four mono .wav files. Shred and then shred to hear it come out of 4 “psuedo speakers” in your headphones.
  4. Substitute your individual mono sound files for file paths in, and shred it after shredding the file.