Skip to main content

hoaencode

hoaencode(
@azimuth 0
@elevation 0
@distance 1
@order 1
@coordtype 'aed'
@dimension '3D'
@angleunit 0
@envtimeunit 0
) -> llll

Generates an audio process operation for panning the input buffer and encode it as a higher-order ambisonic buffer.


Arguments

  • @azimuth [int/float/llll]: Azimuth or X coordinate, either as a single number, or envelope. (default: 0).
  • @elevation [int/float/llll]: Elevation or y coordinate, either as a single number, or envelope. (default: 0).
  • @distance [int/float/llll]: Distance or Z coordinate, either as a single number, or envelope. (default: 1).
  • @order [int]: Ambisonics order. (default: 1).
  • @coordtype [symbol]: Input coordinate type (default: 'aed').
    • 'aed': Azimuth, elevation, and distance; or spherical coordinates.
    • 'xyz': Cartesian coordinates.
    • 'azr': Azimuth, Z, axial radius; or cylindrical coordinates.
  • @dimension [symbol]: Dimensionality of ambisonics (default: '3D').
    • '2D': 2-dimensional.
    • '3D': 3-dimensional.
  • @angleunit [int]: Unit for angles (default: 0).
    • 0: Radians
    • 1: Degrees
    • 2: Turns
  • @envtimeunit [int]: Unit for time values inside envelopes/bpfs. (default: 0).
    • 0: Milliseconds
    • 1: Samples
    • 2: Duration ratio
    • 3: Milliseconds difference
    • 4: Samples difference

Output

Higher-order ambisonics encoding operation [llll]


Usage

hoaencode is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = hoaencode(); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after hoaencode process')