866 lines
31 KiB
TypeScript
866 lines
31 KiB
TypeScript
import type { CsoundReference } from './types'
|
|
|
|
// Signal Modifiers:Panning and Spatialization
|
|
export const signalModifiersPanningAndSpatialization: CsoundReference[] = [
|
|
{
|
|
name: 'bformdec1',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Decodes an ambisonic B format signal into loudspeaker specific signals.',
|
|
syntax: 'ao1, ao2 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4, ao5 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4, ao5, ao6, ao7, ao8 = bformdec1(isetup, aw, ax, ay, az \\\n [, ar, as, at, au, av [, abk, al, am, an, ao, ap, aq]])\n aout[] = bformdec1(isetup, abform[])',
|
|
example: '--8<-- "examples/bformenc1-modern.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'isetup',
|
|
description: 'loudspeaker setup. There are five supported setups:',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Ambisonics']
|
|
},
|
|
{
|
|
name: 'bformdec2',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Decodes an Ambisonics B format signal into loudspeaker specific signals, with dual--band decoding and near--field compensation.',
|
|
syntax: 'aout[] = bformdec2(isetup, abform[], [idecoder, idistance, ifreq, imix, \\\n ifilel, ifiler])',
|
|
parameters: [
|
|
{
|
|
name: 'isetup',
|
|
description: 'loudspeaker setup. There are currently 8 supported setups, the first five are backwards compatible with [bformdec1](../opcodes/bformdec1.md):',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'idecoder',
|
|
description: 'optional (default 0), select the type of decoder',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'idistance',
|
|
description: 'optional (default 1 meter), select the distance (in meters) to the loudspeaker (radius if regular configuration)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifreq',
|
|
description: 'optional (default 400 Hz), frequency cut (Hz) of the band splitting filter (only has an effect if _idecoder_=0)*',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imix',
|
|
description: 'optional (default 0), type of mix of the velocity and energy decoders\' outputs',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'abform',
|
|
description: 'input signal array in the B format',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Ambisonics']
|
|
},
|
|
{
|
|
name: 'bformenc1',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Codes a signal into the ambisonic B format.',
|
|
syntax: 'aw, ax, ay, az = bformenc1(asig, kalpha, kbeta)\n aw, ax, ay, az, ar, as, at, au, av = bformenc1(asig, kalpha, kbeta)\n aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq = bformenc1(\\\n asig, kalpha, kbeta)\n aarray[] = bformenc1(asig, kalpha, kbeta)',
|
|
example: '--8<-- "examples/bformenc1-modern.csd"',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'aarray',
|
|
description: 'output array to hold cells of the B format.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'asig',
|
|
description: 'input signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kalpha',
|
|
description: 'azimuth angle in degrees (anticlockwise).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kbeta',
|
|
description: 'altitude angle in degrees.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Ambisonics']
|
|
},
|
|
{
|
|
name: 'hrtfearly',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Generates 3D binaural audio with high-fidelity early reflections in a parametric room using a Phase Truncation algorithm.',
|
|
syntax: 'aleft, aright, irt60low, irt60high, imfp = hrtfearly(asrc, ksrcx, ksrcy, ksrcz, \\\n klstnrx, klstnry, klstnrz, ifilel, ifiler, idefroom [,ifade, isr, iorder, \\\n ithreed, kheadrot, iroomx, iroomy, iroomz, iwallhigh, iwalllow, \\\n iwallgain1, iwallgain2, iwallgain3, ifloorhigh, ifloorlow, ifloorgain1, \\\n ifloorgain2, ifloorgain3, iceilinghigh, iceilinglow, iceilinggain1, \\\n iceilinggain2, iceilinggain3])',
|
|
example: '--8<-- "examples/hrtfearly.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'idefroom',
|
|
description: 'default room, medium (1: 10*10*3), small (2: 3*4*3) or large (3: 20*25*7). Wall details (high coef, low coef, gain1, gain2, gain3): .3, .1, .75, .95, .9. Floor: .6, .1, .95, .6, .35. Ceiling: .2, .1, 1, 1, 1. If 0 is entered, optional room parameters will be read.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifade',
|
|
description: 'optional, number of processing buffers for phase change crossfade (default 8). Legal range is 1-24. See [hrtfmove](../opcodes/hrtfmove.md).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'isr',
|
|
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iorder',
|
|
description: 'optional, order of images processed: higher order: more reflections. Defaults to 1, legal range: 0-4.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ithreed',
|
|
description: 'optional, process image sources in three dimensions (1) or two (0: default).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iroomx',
|
|
description: 'optional, x room size in metres, will be read if no valid default room is entered (all below parameters behave similarly). Minimum room size is 2\\*2\\*2.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iroomy',
|
|
description: 'optional, y room size.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iroomz',
|
|
description: 'optional, z room size.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iwallhigh',
|
|
description: 'optional, high frequency wall absorption coefficient (all 4 walls are assumed identical). Absorption coefficients will affect reverb time output.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iwalllow',
|
|
description: 'optional, low frequency wall absorption coefficient.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iwallgain1',
|
|
description: 'optional, gain on filter centred at 250 Hz (all filters have a Q implying 4 octaves).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iwallgain2',
|
|
description: 'optional, as above, centred on 1000 Hz.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iwallgain3',
|
|
description: 'optional, as above, centred on 4000 Hz.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifloorhigh',
|
|
description: 'as above for floor.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifloorlow',
|
|
description: 'as above for floor.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifloorgain1',
|
|
description: 'as above for floor.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifloorgain2',
|
|
description: 'as above for floor.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifloorgain3',
|
|
description: 'as above for floor.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iceilinghigh',
|
|
description: 'as above for ceiling.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iceilinglow',
|
|
description: 'as above for ceiling.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iceilinggain1',
|
|
description: 'as above for ceiling.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iceilinggain2',
|
|
description: 'as above for ceiling.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iceilinggain3',
|
|
description: 'as above for ceiling.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kheadrot',
|
|
description: 'optional, angular value for head rotation.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'asrc',
|
|
description: 'Input/source signal.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization']
|
|
},
|
|
{
|
|
name: 'hrtfer',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Creates 3D audio for two speakers. Output is binaural (headphone) 3D audio.',
|
|
syntax: 'aleft, aright = hrtfer(asig, kaz, kelev, "HRTFcompact")',
|
|
example: '--8<-- "examples/hrtfer.csd"',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kAz',
|
|
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kElev',
|
|
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions under horizontal.',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization']
|
|
},
|
|
{
|
|
name: 'hrtfmove',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Generates dynamic 3d binaural audio for headphones using magnitude interpolation and phase truncation.',
|
|
syntax: 'aleft, aright = hrtfmove(asrc, kAz, kElev, ifilel, ifiler [, imode, ifade, isr])',
|
|
example: '--8<-- "examples/hrtfmove.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imode',
|
|
description: 'optional, default 0 for phase truncation, 1 for minimum phase',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifade',
|
|
description: 'optional, number of processing buffers for phase change crossfade (default 8). Legal range is 1-24. A low value is recommended for complex sources (4 or less: a higher value may make the crossfade audible), a higher value (8 or more: a lower value may make the inconsistency when the filter changes phase values audible) for narrowband sources. Does not effect minimum phase processing.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'isr',
|
|
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kAz',
|
|
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kElev',
|
|
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
|
|
},
|
|
{
|
|
name: 'hrtfmove2',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Generates dynamic 3d binaural audio for headphones using a Woodworth based spherical head model with improved low frequency phase accuracy.',
|
|
syntax: 'aleft, aright = hrtfmove2(asrc, kAz, kElev, ifilel, ifiler [,ioverlap, iradius, isr])',
|
|
example: '--8<-- "examples/hrtfmove2.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ioverlap',
|
|
description: 'optional, number of overlaps for STFT processing (default 4). See STFT section of manual.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iradius',
|
|
description: 'optional, head radius used for phase spectra calculation in centimeters (default 9.0)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'isr',
|
|
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'asrc',
|
|
description: 'Input/source signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kAz',
|
|
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kElev',
|
|
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
|
|
},
|
|
{
|
|
name: 'hrtfreverb',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'A binaural, dynamic FDN based diffuse-field reverberator. The opcode works independently as an efficient, flexible reverberator.',
|
|
syntax: 'aleft, aright, idel = hrtfreverb(asrc, ilowrt60, ihighrt60, ifilel, ifiler \\\n [,isr, imfp, iorder])',
|
|
example: '--8<-- "examples/hrtfearly.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'ilowrt60',
|
|
description: 'low frequency reverb time.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ihighrt60',
|
|
description: 'high frequency reverb time.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'isr',
|
|
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imfp',
|
|
description: 'optional, mean free path, defaults to that of a medium room. If used with [hrtfearly](../opcodes/hrtfearly.md), the mean free path of the room can be used to calculate the appropriate delay for the later reverb. Legal range: the mean free path of the smallest room allowed by hrtfearly (0.003876) 1.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iorder',
|
|
description: 'optional, order of early reflection processing. If used with [hrtfearly](../opcodes/hrtfearly.md), the order of early reflections can be used to calculate the appropriate delay on the later reverb.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'asrc',
|
|
description: 'Input/source signal.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization']
|
|
},
|
|
{
|
|
name: 'hrtfstat',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Generates static 3d binaural audio for headphones using a Woodworth based spherical head model with improved low frequency phase accuracy.',
|
|
syntax: 'aleft, aright = hrtfstat(asrc, iAz, iElev, ifilel, ifiler [,iradius, isr])',
|
|
example: '--8<-- "examples/hrtfstat.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'iAz',
|
|
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iElev',
|
|
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifilel',
|
|
description: 'left HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifiler',
|
|
description: 'right HRTF spectral data file',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iradius',
|
|
description: 'optional, head radius used for phase spectra calculation in centimeters (default 9.0)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'isr',
|
|
description: 'optional (default 44.1kHz). Legal values are 44100, 48000 and 96000.',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
|
|
},
|
|
{
|
|
name: 'locsend',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Distributes the audio signals of a previous [locsig](../opcodes/locsig.md) opcode.',
|
|
syntax: 'a1, a2 = locsend()\n a1, a2, a3, a4 = locsend()',
|
|
example: 'asig some audio signal\n kdegree line 0, p3, 360\n kdistance line 1, p3, 10\n a1, a2, a3, a4 locsig asig, kdegree, kdistance, .1\n ar1, ar2, ar3, ar4 locsend\n ga1 = ga1+ar1\n ga2 = ga2+ar2\n ga3 = ga3+ar3\n ga4 = ga4+ar4\n outq a1, a2, a3, a4\nendin\n\ninstr 99 ; reverb instrument\n a1 reverb2 ga1, 2.5, .5\n a2 reverb2 ga2, 2.5, .5\n a3 reverb2 ga3, 2.5, .5\n a4 reverb2 ga4, 2.5, .5\n outq a1, a2, a3, a4\n ga1=0\n ga2=0\n ga3=0\n ga4=0',
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'locsig',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Takes an input signal and distributes between 2 or 4 channels.',
|
|
syntax: 'a1, a2 = locsig(asig, kdegree, kdistance, kreverbsend)\n a1, a2, a3, a4 = locsig(asig, kdegree, kdistance, kreverbsend)',
|
|
example: '--8<-- "examples/locsig_quad.csd"',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kdegree',
|
|
description: 'value between 0 and 360 for placement of the signal in a 2 or 4 channel space configured as: a1=0, a2=90, a3=180, a4=270 (kdegree=45 would balanced the signal equally between a1 and a2). _locsig_ maps _kdegree_ to sin and cos functions to derive the signal balances (e.g.: asig=1, kdegree=45, a1=a2=.707).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kdistance',
|
|
description: 'value >= 1 used to attenuate the signal and to calculate reverb level to simulate distance cues. As _kdistance_ gets larger the sound should get softer and somewhat more reverberant (assuming the use of _locsend_ in this case).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kreverbsend',
|
|
description: 'the percentage of the direct signal that will be factored along with the distance and degree values to derive signal amounts that can be sent to a reverb unit such as _reverb_, or _reverb2_.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'ms2st',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Mid-Side to stereo Conversion with a width control.',
|
|
syntax: 'aleft,aright = ms2st(am, as, kwidth)',
|
|
example: '--8<-- "examples/ms2st.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'aleft',
|
|
description: 'left channel output.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aright',
|
|
description: 'right channel output.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'am',
|
|
description: 'mid signal input.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'as',
|
|
description: 'side signal input.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kwidth',
|
|
description: 'stereo width (0 to 1). At 0, no side signal is output, and at 1 no mid signal is present. A value of 0.5 restores a stereo to MS conversion (st2ms) exactly.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'pan',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Distribute an audio signal amongst four channels with localization control.',
|
|
syntax: 'a1, a2, a3, a4 = pan(asig, kx, ky, ifn [, imode] [, ioffset])',
|
|
example: '--8<-- "examples/pan.csd"',
|
|
rates: ['a-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: 'function table number of a stored pattern describing the amplitude growth in a speaker channel as sound moves towards it from an adjacent speaker. Requires extended guard-point.',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'pan2',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Distribute an audio signal across two channels with a choice of methods.',
|
|
syntax: 'a1, a2 = pan2(asig, xp [, imode])\n aouts[] = pan2(asig, xp [, imode])',
|
|
example: '--8<-- "examples/pan2.csd"',
|
|
rates: ['a-rate'],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'space',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Distributes an input signal among 4 channels using cartesian coordinates.',
|
|
syntax: 'a1, a2, a3, a4 = space(asig, ifn, ktime, kreverbsend, kx, ky)',
|
|
example: '--8<-- "examples/space_quad.csd"',
|
|
rates: ['a-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: 'number of the stored function created using [Gen28](../scoregens/gen28.md). This function generator reads a text file which contains sets of three values representing the xy coordinates and a time-tag for when the signal should be placed at that location. The file should look like:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'asig',
|
|
description: 'input audio signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'ktime',
|
|
description: 'index into the table containing the xy coordinates. If used like:',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kreverbsend',
|
|
description: 'the percentage of the direct signal that will be factored along with the distance as derived from the xy coordinates to calculate signal amounts that can be sent to reverb units such as _reverb_, or _reverb2_.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kx',
|
|
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the xy coordinates to localize the signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'ky',
|
|
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the xy coordinates to localize the signal.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'spat3d',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Positions the input sound in a 3D space and allows moving the sound at k-rate.',
|
|
syntax: 'aW, aX, aY, aZ = spat3d(ain, kX, kY, kZ, idist, ift, imode, imdel, iovr [, istor])',
|
|
example: '--8<-- "examples/spat3d_stereo.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'idist',
|
|
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ift',
|
|
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imode',
|
|
description: 'Output mode',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imdel',
|
|
description: 'Maximum delay time for spat3d in seconds. This has to be longer than the delay time of the latest reflection (depends on room dimensions, sound source distance, and recursion depth; using this formula gives a safe (although somewhat overestimated) value:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iovr',
|
|
description: 'Oversample ratio for spat3d (1 to 8). Setting it higher improves quality at the expense of memory and CPU usage. The recommended value is 2.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'aW',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aX',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aY',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aZ',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'ain',
|
|
description: 'Input signal',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kX',
|
|
description: 'Sound source coordinates (in meters)',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kY',
|
|
description: 'Sound source coordinates (in meters)',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kZ',
|
|
description: 'Sound source coordinates (in meters)',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
|
|
},
|
|
{
|
|
name: 'spat3di',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Positions the input sound in a 3D space with the sound source position set at i-time.',
|
|
syntax: 'aW, aX, aY, aZ = spat3di(ain, iX, iY, iZ, idist, ift, imode [, istor])',
|
|
parameters: [
|
|
{
|
|
name: 'iX',
|
|
description: 'Sound source X coordinate in meters (positive: right, negative: left)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iY',
|
|
description: 'Sound source Y coordinate in meters (positive: front, negative: back)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iZ',
|
|
description: 'Sound source Z coordinate in meters (positive: up, negative: down)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'idist',
|
|
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ift',
|
|
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imode',
|
|
description: 'Output mode',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ain',
|
|
description: 'Input signal',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aW',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aX',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aY',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aZ',
|
|
description: 'Output signals',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
|
|
},
|
|
{
|
|
name: 'spat3dt',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Can be used to render an impulse response for a 3D space at i-time.',
|
|
syntax: 'spat3dt(ioutft, iX, iY, iZ, idist, ift, imode, irlen [, iftnocl])',
|
|
example: '--8<-- "examples/spat3dt.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'ioutft',
|
|
description: 'Output ftable number for spat3dt. W, X, Y, and Z outputs are written interleaved to this table. If the table is too short, output will be truncated.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iX',
|
|
description: 'Sound source X coordinate in meters (positive: right, negative: left)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iY',
|
|
description: 'Sound source Y coordinate in meters (positive: front, negative: back)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iZ',
|
|
description: 'Sound source Z coordinate in meters (positive: up, negative: down)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'idist',
|
|
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ift',
|
|
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'imode',
|
|
description: 'Output mode',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'irlen',
|
|
description: 'Impulse response length of echoes (in seconds). Depending on filter parameters, values around 0.005-0.01 are suitable for most uses (higher values result in more accurate output, but slower rendering)',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
|
|
},
|
|
{
|
|
name: 'spdist',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Calculates distance values from xy coordinates.',
|
|
syntax: 'k1 = spdist(ifn, ktime, kx, ky)',
|
|
example: '--8<-- "examples/spdist.csd"',
|
|
rates: ['i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: 'number of the stored function created using [Gen28](../scoregens/gen28.md). This function generator reads a text file which contains sets of three values representing the xy coordinates and a time-tag for when the signal should be placed at that location. The file should look like:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ktime',
|
|
description: 'index into the table containing the xy coordinates. If used like:',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kx',
|
|
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the XY coordinates to localize the signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'ky',
|
|
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the XY coordinates to localize the signal.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'spsend',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Generates output signals based on a previously defined [space](../opcodes/space.md) opcode.',
|
|
syntax: 'a1, a2, a3, a4 = spsend()',
|
|
example: '--8<-- "examples/spsend.csd"',
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
{
|
|
name: 'st2ms',
|
|
type: 'opcode',
|
|
category: 'Signal Modifiers:Panning and Spatialization',
|
|
description: 'Stereo to Mid-Side Conversion.',
|
|
syntax: 'am,as = st2ms(aleft,aright)',
|
|
example: '--8<-- "examples/st2ms.csd"',
|
|
parameters: [
|
|
{
|
|
name: 'am',
|
|
description: 'mid signal output.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'as',
|
|
description: 'side signal output.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aleft',
|
|
description: 'left channel input.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aright',
|
|
description: 'right channel input.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
|
|
},
|
|
]
|