FoaAudition: table of contents
Filter:
Classes (extension) | Libraries > Ambisonic Toolkit > FOA > Utilities

FoaAudition : Object
ExtensionExtension

Audition FOA recordings, panning planewaves, diffuse soundfields, and transforms.

Description

An interface for auditioning FOA recordings and panning PinkNoise planewaves & diffuse soundfields. FOA transforms can be can also be auditioned by manually setting a transform matrix or more conveniently through FoaXformDisplay.

NOTE: This will boot the Server if it's not already booted.

Class Methods

FoaAudition.new(outbus: 0, matrixFadeTime: 0.1, xformMatrix, inbus, addAction, target, server, initCond, initGUI: true)

Arguments:

outbus

A bus number to which you send the FOA output. This is likely the input bus number of your decoder.

matrixFadeTime

(Optional) The crossfade time between transform matrices if the audition matrix is changed. This is used primarily by FoaXformDisplay.

xformMatrix

Optionally provide a transform matrix through which the B-Format signal will play.1 The default is an identity matrix, i.e. an unchanged soundfield.

inbus

Optionally provide the bus number for the soundfield input module to read in (when set to "inbus"). This can be changed in the GUI as well.

addAction

Optionally provide an addAction for placing the FoaAudition's Group in a particular place in the Node Tree. Default is \addToTail. one of the following Symbols:

\addToHead(the default) add at the head of the group specified by target
\addToTailadd at the tail of the group specified by target
\addAfteradd immediately after target in its server's node order
\addBeforeadd immediately before target in its server's node order
\addReplacereplace target and take its place in its server's node order

NOTE: A Synth is not a valid target for \addToHead and \addToTail.
target

Optionally, FoaAudition's Group is placed according to the addAction relative to the target.

server

Optionally provide a Server on which Buffers are loaded and the Group is played.

initCond

Optionally a Condition that is signalled once this has allocated all of it's resources.

initGUI

A Boolean for whether the gui is immediately displayed. .gui can also be called after the instance is created.

Inherited class methods

Undocumented class methods

FoaAudition.auditionSynthDefs

FoaAudition.loadSynths(server)

Instance Methods

.outbus

.outbus = busnum

Get/set the output Bus

.mul = mul

Set the amplitude scalar.2

.gui(show: true)

Create a gui for the auditioning system, if not already created when initialized.

Arguments:

show

A boolean indicating whether the gui is assigned to a window. If false, the gui elements are created without being assigned to a window, but .ui.view will return the view so it can be placed in a custom layout.

.free

Free all the resources.

.group

Get the Group containing all the Synths. Can be useful to use as a target to achieve proper node order for routing into and from the audition system.

.gMul

Get the global amplitude scalar used by all of the playback Synths.

.inbus

.inbus = busnum

Get/set the input Bus used by the Synth that reads in a 4-channel audio bus to play through the auditioning system.

.soundfileBuf

Get the soundfile Buffer currently loaded for playback.

.loadSoundfile(soundfilePath, loadCondition)

Load a new sound file of FOA b-format material for playback. Must be 3 (pantophonic) or 4 (periphonic) channels. This also frees any previously loaded soundfile Buffer.

.matrixFader

Get the instance of FoaMatrixFade used internally. Useful for chaning the transform matrix manually, changing the matrix crossfade time, etc.

Inherited instance methods

Examples

s.boot

// create a bus to play your b-format to
~foaBus = s.audioBusAllocator.alloc(4)

a = FoaAudition(outbus: ~foaBus);

// If you aren't already playing through a decoder,
// make one now:

// select a decoder of your choice
~decoder = FoaDecoderKernel.newSpherical

(
SynthDef(\decoder_spherical, { arg outbus = 0, inbus;
    // ReplaceOut here in case you'be selected a
    // hardware out for the auditioner
    ReplaceOut.ar( outbus,
        FoaDecode.ar(
            In.ar( inbus, 4 ),
            ~decoder
        )
    )
}).send(s);
)

// Note: this assumes you've already opened the
// "Audition" window (thus the auditioning synths are on the
// node tree). So place your decoder after your the
// audition synth group:

x = Synth(\decoder_spherical, [\inbus, a.outbus], a.group, \addAfter);

// Now play your sound in the Audition window by
// pressing the "play" icon on the relevant tab.
// The above illustration under Description shows
// the GUI state for auditioning a PinkNoise Planewave.

// Just close the window to clean up when you're done, or use .free
a.free

// free your decoder kernels
~decoder.free
// and your decoder synth
x.free
// and your foa bus
s.audioBusAllocator.free(~foaBus)

[1] - Provide the matrix by using the FoaXformerMatrix: -matrix method.
[2] - You may wish to review the discussion found here.