506 lines
15 KiB
TypeScript
506 lines
15 KiB
TypeScript
import type { CsoundReference } from './types'
|
|
|
|
// Signal Generators:Basic Oscillators
|
|
export const signalGeneratorsBasicOscillators: CsoundReference[] = [
|
|
{
|
|
name: 'lfo',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A low frequency oscillator of various shapes.',
|
|
syntax: 'kres = lfo(kamp, kcps [, itype])\n ares = lfo(kamp, kcps [, itype])',
|
|
example: '--8<-- "examples/lfo.csd"',
|
|
rates: ['a-rate', 'k-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude of output',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency of oscillator',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscbnk',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'Mixes the output of any number of oscillators.',
|
|
syntax: 'ares = oscbnk(kcps, kamd, kfmd, kpmd, iovrlap, iseed, kl1minf, kl1maxf, \\\n kl2minf, kl2maxf, ilfomode, keqminf, keqmaxf, keqminl, keqmaxl, \\\n keqminq, keqmaxq, ieqmode, kfn [, il1fn] [, il2fn] [, ieqffn] \\\n [, ieqlfn] [, ieqqfn] [, itabl] [, ioutfn])',
|
|
example: '--8<-- "examples/oscbnk.csd"',
|
|
rates: ['a-rate', 'k-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'iovrlap',
|
|
description: 'Number of oscillator units.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iseed',
|
|
description: 'Seed value for random number generator (positive integer in the range 1 to 2147483646 (2 ^ 31 - 2)). _iseed_ <= 0 seeds from the current time.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ieqmode',
|
|
description: 'Parametric equalizer mode',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ilfomode',
|
|
description: 'LFO modulation mode, sum of:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ares',
|
|
description: 'Output signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'Oscillator frequency in Hz.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kamd',
|
|
description: 'AM depth (0 - 1).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfmd',
|
|
description: 'FM depth (in Hz).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kpmd',
|
|
description: 'Phase modulation depth.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kl1minf',
|
|
description: 'LFO1 minimum and maximum frequency in Hz.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kl1maxf',
|
|
description: 'LFO1 minimum and maximum frequency in Hz.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kl2minf',
|
|
description: 'LFO2 minimum and maximum frequency in Hz. (Note: oscillator and LFO frequencies are allowed to be zero or negative.)',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kl2maxf',
|
|
description: 'LFO2 minimum and maximum frequency in Hz. (Note: oscillator and LFO frequencies are allowed to be zero or negative.)',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqminf',
|
|
description: 'Parametric equalizer minimum and maximum frequency in Hz.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqmaxf',
|
|
description: 'Parametric equalizer minimum and maximum frequency in Hz.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqminl',
|
|
description: 'Parametric equalizer minimum and maximum level.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqmaxl',
|
|
description: 'Parametric equalizer minimum and maximum level.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqminq',
|
|
description: 'Parametric equalizer minimum and maximum Q.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'keqmaxq',
|
|
description: 'Parametric equalizer minimum and maximum Q.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfn',
|
|
description: 'Oscillator waveform table. Table number can be changed at k-rate (this is useful to select from a set of band-limited tables generated by GEN30, to avoid aliasing). The table is read with linear interpolation.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscil',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A simple oscillator without any interpolation.',
|
|
syntax: 'ares = oscil(xamp, xcps [, ifn, iphs])\n kres = oscil(kamp, kcps [, ifn, iphs])',
|
|
example: '--8<-- "examples/oscil.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: '(optional) function table number. Requires a wrap-around guard point. The table number defaults to -1 which indicates a sinewave.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscil3',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A simple oscillator with cubic interpolation.',
|
|
syntax: 'ares = oscil3(xamp, xcps [, ifn, iphs])\n kres = oscil3(kamp, kcps [, ifn, iphs])',
|
|
example: '--8<-- "examples/oscil3.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscili',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A simple oscillator with linear interpolation.',
|
|
syntax: 'ares = oscili(xamp, xcps[, ifn, iphs])\n kres = oscili(kamp, kcps[, ifn, iphs])',
|
|
example: '--8<-- "examples/oscili.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xamp',
|
|
description: 'amplitude',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xcps',
|
|
description: 'frequency in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscilikt',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A linearly interpolated oscillator that allows changing the table number at k-rate.',
|
|
syntax: 'ares = oscilikt(xamp, xcps, kfn [, iphs] [, istor])\n kres = oscilikt(kamp, kcps, kfn [, iphs] [, istor])',
|
|
example: '--8<-- "examples/oscilikt.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xamp',
|
|
description: 'amplitude.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xcps',
|
|
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfn',
|
|
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'osciliktp',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A linearly interpolated oscillator that allows allows phase modulation.',
|
|
syntax: 'ares = osciliktp(kcps, kfn, kphs [, istor])',
|
|
example: '--8<-- "examples/osciliktp.csd"',
|
|
rates: ['a-rate', 'k-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ares',
|
|
description: 'audio-rate ouptut signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfn',
|
|
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kphs',
|
|
description: 'phase (k-rate), the expected range is 0 to 1. The absolute value of the difference of the current and previous value of _kphs_ must be less than [ksmps](../opcodes/ksmps.md).',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscilikts',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A linearly interpolated oscillator with sync status that allows changing the table number at k-rate.',
|
|
syntax: 'ares = oscilikts(xamp, xcps, kfn, async, kphs [, istor])',
|
|
example: '--8<-- "examples/oscilikts.csd"',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'xamp',
|
|
description: 'amplitude.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'xcps',
|
|
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfn',
|
|
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'async',
|
|
description: 'any positive value resets the phase of _oscilikts_ to _kphs_. Zero or negative values have no effect.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kphs',
|
|
description: 'sets the phase, initially and when it is re-initialized with async.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'osciln',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'Accesses table values at a user-defined frequency.',
|
|
syntax: 'ares = osciln(kamp, ifrq, ifn, itimes)',
|
|
example: '--8<-- "examples/osciln.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifrq',
|
|
description: 'rate and number of times through the stored table.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'itimes',
|
|
description: 'rate and number of times through the stored table.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifn',
|
|
description: 'function table number.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kamp',
|
|
description: 'amplitude factor',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Table Access']
|
|
},
|
|
{
|
|
name: 'oscils',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'A simple, fast sine oscillator.',
|
|
syntax: 'ares = oscils(iamp, icps, iphs [, iflg])',
|
|
example: '--8<-- "examples/oscils.csd"',
|
|
rates: ['a-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'iamp',
|
|
description: 'output amplitude.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'icps',
|
|
description: 'frequency in Hz (may be zero or negative, however the absolute value must be less than _sr_/2).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iphs',
|
|
description: 'start phase between 0 and 1.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'iflg',
|
|
description: 'sum of the following values:',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ares',
|
|
description: 'audio output',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'oscilx',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'Same as the [osciln](../opcodes/osciln.md) opcode.',
|
|
},
|
|
{
|
|
name: 'poscil',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'High precision oscillator.',
|
|
syntax: 'ares = poscil(aamp, acps [, ifn, iphs])\n ares = poscil(aamp, kcps [, ifn, iphs])\n ares = poscil(kamp, acps [, ifn, iphs])\n ares = poscil(kamp, kcps [, ifn, iphs])\n ires = poscil(kamp, kcps [, ifn, iphs])\n kres = poscil(kamp, kcps [, ifn, iphs])',
|
|
example: '--8<-- "examples/poscil-modern.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: '(optional) function table number. This defaults to -1 which indicates a sinewave.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ares',
|
|
description: 'output signal',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kamp',
|
|
description: 'the amplitude of the output signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aamp',
|
|
description: 'the amplitude of the output signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'the frequency of the output signal in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'acps',
|
|
description: 'the frequency of the output signal in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
{
|
|
name: 'poscil3',
|
|
type: 'opcode',
|
|
category: 'Signal Generators:Basic Oscillators',
|
|
description: 'High precision oscillator with cubic interpolation.',
|
|
syntax: 'ares = poscil3(aamp, acps [, ifn, iphs])\n ares = poscil3(aamp, kcps [, ifn, iphs])\n ares = poscil3(kamp, acps [, ifn, iphs])\n ares = poscil3(kamp, kcps [, ifn, iphs])\n ires = poscil3(kamp, kcps [, ifn, iphs])\n kres = poscil3(kamp, kcps [, ifn, iphs])',
|
|
example: '--8<-- "examples/poscil3.csd"',
|
|
rates: ['a-rate', 'k-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifn',
|
|
description: '(optional) function table number. This defaults to -1 which indicates a sinewave.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ares',
|
|
description: 'output signal',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kamp',
|
|
description: 'the amplitude of the output signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'aamp',
|
|
description: 'the amplitude of the output signal.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kcps',
|
|
description: 'the frequency of the output signal in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'acps',
|
|
description: 'the frequency of the output signal in cycles per second.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Basic Oscillators']
|
|
},
|
|
]
|