spats.lib

This library contains a collection of tools for sound spatialization. Its official prefix is sp.

References


(sp.)panner

A simple linear stereo panner. panner is a standard Faust function.

Usage

_ : panner(g) : _,_

Where:

  • g: the panning (0-1)

(sp.)constantPowerPan

Apply the constant power pan rule to a stereo signal. The channels are not respatialized. Their gains are simply adjusted. A pan of 0 preserves the left channel and silences the right channel. A pan of 1 has the opposite effect. A pan value of 0.5 applies a gain of 0.5 to both channels.

Usage

_,_ : constantPowerPan(p) : _,_

Where:

  • p: the panning (0-1)

(sp.)spat

GMEM SPAT: n-outputs spatializer. spat is a standard Faust function.

Usage

_ : spat(N,r,d) : si.bus(N)

Where:

  • N: number of outputs (a constant numerical expression)
  • r: rotation (between 0 et 1)
  • d: distance of the source (between 0 et 1)

(sp.)wfs

Wave Field Synthesis algorithm for multiple sound sources. Implementation generalized starting from Pierre Lecomte version.

Usage

wfs(xref, yref, zref, speakersDist, nSources, nSpeakers, inGain, xs, ys, zs) : si.bus(nSpeakers)

Where:

  • xref: x-coordinate of the reference listening point
  • yref: y-coordinate of the reference listening point
  • zref: z-coordinate of the reference listening point
  • speakersDist: distance between speakers
  • nSources: number of sound sources
  • nSpeakers: number of speakers
  • inGain: input gain (0-1) as a function of the source index
  • xs: x-coordinate of the sound source as a function of the source index
  • ys: y-coordinate of the sound source as a function of the source index
  • zs: z-coordinate of the sound source as a function of the source index

(sp.)wfs_ui

Wave Field Synthesis algorithm for multiple sound sources with a built-in UI.

Usage

wfs_ui(xref, yref, zref, speakersDist, nSources, nSpeaker) : si.bus(nSpeakers)

Where:

  • xref: x-coordinate of the reference listening point
  • yref: y-coordinate of the reference listening point
  • zref: z-coordinate of the reference listening point
  • speakersDist: distance between speakers
  • nSources: number of sound sources
  • nSpeakers: number of speakers

Example test program

// Distance between speakers in meters
speakersDist = 0.0783;  

// Reference listening point (central position for WFS)
xref = 0;
yref = 1;
zref = 0;

Spatialize 4 sound sources on 16 speakers
process = wfs_ui(xref,yref,zref,speakersDist,4,16);

(sp.)stereoize

Transform an arbitrary processor p into a stereo processor with 2 inputs and 2 outputs.

Usage

_,_ : stereoize(p) : _,_

Where:

  • p: the arbitrary processor