The FOA examples found here show a limited set of the ATK's functionality, but illustrate how to work with the library when using SynthDefs and Synths, and a single decoder that reads an Ambisonic signal through audio bus routing. Additionally, examples for Non-Realtime (NRT) processing are found in this guide.
FoaPanB encodes a monophonic input to a First Order Ambisonic signal (B-format), as a planewave. PanB is the SuperCollider inbuilt equivalent.
This first example encodes a PinkNoise source as a planewave and decodes to stereo.
Encodes a monophonic input as an omnidirectional soundfield, then re-image via two transforms using the FoaTransform UGen wrapper.
Encode a planewave, and route to a single decoder:
In this example we're working with a B-format sound file. As the source is already encoded, an encoding stage is not needed. For audition, a binaural (HRTF) decoder is used. This decoder takes a subjectID as an argument. It would be wise to experiment with various subjectIDs to discover which suits your own head.
Ambisonic UHJ is the stereo compatible Ambisonic format, and a suitable Ambisonic B-format signal can be retrieved from UHJ encoded signals.1
Here we will encode (transcode, actually!) a UHJ Stereo file to B-format. For audition, a binaural (HRTF) decoder is used. This decoder takes a subjectID as an argument. It would be wise to experiment with various subjectIDs to discover which suits your own head. suits your own head.
In many cases, examples using Score are often trickier due to the need for the use of bundles. Since the Kernels2 also pass in hardcoded buffer IDs, we need to make sure those are referenced, as well.
The example below decodes a B-format input file to Stereo Ambisonic UHJ using the ATK's FoaDecoderKernel: *newUHJ decoder.
The Composer's Toolkit (Ctk) quark offers a convenient model for working in a score based paradigm in both Realtime and Non-Realtime.
The example here, as above, decodes a B-format input file to Stereo Ambisonic UHJ using the ATK's FoaDecoderKernel: *newUHJ decoder.
And, this example uses both a Kernel Encoder and Decoder. First an Ambisonic UHJ soundfile is encode to B-format. Then, it is decoded using the ATK's binaural (HRTF) decoder decoder.