How to: Working in Quad and submitting as First-Order Ambisonics for Listening in Binaural via Homework Factory

Overview

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 interaural loudness and timing difference (ILD 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 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. 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 mixed to stereo 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 with a Tascam quad soundcard and you are listening via headphones, 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

Or if you are executing chuck from the command line use

chuck --channels:4 DacBeeps.ck

Add the shred and adjust speaker levels for reasonable balance. 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

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:

dac.chan(0)
dac.chan(1)
dac.chan(2)
dac.chan(3)

Note: A good way to pan in ChucK is to shred the DBAP4.ck file and pass through a portion of a wav file that you would like to pan in 4 channel space with this file: DBAP4_ex.ck, 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).

Conversion to 1st order Ambisonics (FOA)

This section details the steps necessary to convert four audio signals (channels Left, Right, Right-rear, Left-rear) into an ambisonic encoded signal (components W, X, Y, Z). Ambisonics is a format useful for storing audio signals in a format that is agnostic to the playback speaker configuration. We will listen to your final submission through headphones by decoding your ambisonic file with a binaural renderer with the Web audio Omnitone toolbox (same as Youtube now supports).

  1. Download this quadBeeps2foa.ck chuck script
  2. You will have to modify directory, basename and time variables to have Chuck write to the correct locations for the right length of time.
  3. Run the script by shreding it in miniAudicle and waiting for it to complete, or
  4. Run the script faster-than-real-time with an incantation such as:
  5. chuck -s -o4 --srate:48000 quadBeeps2foa.ck
  6. After writing the W, X, Y, and Z components as mono files, we need to combine them into a single, interleaved 4-channel file. You can do this using the cross-platform utility SOX using the following command:
  7. sox -M <your-input-base-file-name>*.wav <your-output-file-name>.wav
  8. Test this html template and download it (e.g., "save link as"). Modify it allow the omnitone toolbox's web audio function calls to work with your ambisonic file

Converting individual .wav files to FOA

Instead of synthesizing beeps, this section describes reading in 4 (mono) .wav files as SndBuf's.

  1. Download this quadSlates2foa.ck chuck script
  2. You will have to modify it to find your input files (as well as modify output variables and time as decribed abov).
  3. Run the script by shreding it in miniAudicle and waiting for it to complete, or
  4. Run the script faster-than-real-time with an incantation such as:
  5. chuck -s -o4 --srate:48000 quadSlates2foa.ck
  6. Again, use sox to combine the output into a 4-channel ambisonic file (see the details above and in the end of the .ck file)
  7. Test this html template and download it (e.g., "save link as"). Modify it allow the omnitone toolbox's web audio function calls to work with your ambisonic file