import type { CsoundReference } from './types' // Signal Generators:Linear and Exponential Generators export const signalGeneratorsLinearAndExponentialGenerators: CsoundReference[] = [ { name: 'bpf', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Break point function with linear interpolation.', syntax: 'ky = bpf(kx, kx1, ky1, kx2, ..., kxn, kyn)\n iy = bpf(ix, ix1, iy1, ix2, ..., ixn, iyn)\n kys[] = bpf(kxs[], kx1, ky1, kx2, ..., kxn, kyn)\n iys[] = bpf(ixs[], ix1, iy1, ix2, ..., ixn, iyn)\n ky = bpf(kx, kxs[], kys[])\n iy = bpf(ix, ixs[], iys[])\n ay = bpf(ax, kx1, ky1, kx2, ..., kxn, kyn)\n ay = bpf(ax, kxs[], kys[])\n ky, kw = bpf(kx, kxs[], kys[], kws[])', example: '--8<-- "examples/bpf.csd"', parameters: [ { name: 'kx', description: 'Input value', type: 'performance' }, { name: 'kxn', description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted.', type: 'performance' }, { name: 'kyn', description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'bpfcos', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Break point function with cosine (easy-in/easy-out) interpolation.', syntax: 'ky = bpfcos(kx, kx1, ky1, kx2, ..., kxn, kyn)\n kys[] = bpfcos(kxs[], kx1, ky1, kx2, ..., kxn, kyn)\n ky = bpfcos(kx, kxs[], kys[])\n ky = bpfcos(kx, ixs[], iys[])\n ky, kz = bpfcos(kx, kxs[], kys[], kzs[])\n ky, kz = bpfcos(kx, ixs[], iys[], izs[])', example: '--8<-- "examples/bpfcos.csd"', parameters: [ { name: 'kx', description: 'Input value. Can also be an array', type: 'performance' }, { name: 'kxn', description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted', type: 'performance' }, { name: 'kyn', description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'cosseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified points with cosine interpolation.', syntax: 'ares = cosseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = cosseg(ia, idur1, ib [, idur2] [, ic] [...])', example: '--8<-- "examples/cosseg.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'cossegb', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified absolute points with cosine interpolation.', syntax: 'ares = cossegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = cossegb(ia, itim1, ib [, itim2] [, ic] [...])', example: '--8<-- "examples/cossegb.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'itim1', description: 'time in seconds of end of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'cossegr', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified points with cosine interpolation, including a release segment.', syntax: 'ares = cossegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = cossegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)', example: '--8<-- "examples/cossegr.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, { name: 'irel', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, { name: 'iz', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expcurve', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Generates a normalised exponential curve in range 0 to 1 of arbitrary steepness.', syntax: 'kout = expcurve(kindex, ksteepness)', example: '--8<-- "examples/expcurve.csd"', parameters: [ { name: 'kindex', description: 'Index value. Expected range 0 to 1.', type: 'performance' }, { name: 'ksteepness', description: 'Steepness of the generated curve. Values closer to 1.0 result in a straighter line while larger values steepen the curve.', type: 'performance' }, { name: 'kout', description: 'Scaled output.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expon', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace an exponential curve between specified points.', syntax: 'ares = expon(ia, idur, ib)\n kres = expon(ia, idur, ib)', example: '--8<-- "examples/expon.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal for exponentials.', type: 'initialization' }, { name: 'ib', description: 'value after _idur_ seconds. For exponentials, must be non-zero and must agree in sign with _ia_.', type: 'initialization' }, { name: 'idur', description: 'duration in seconds of the segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of exponential segments between specified points.', syntax: 'ares = expseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = expseg(ia, idur1, ib [, idur2] [, ic] [...])', example: '--8<-- "examples/expseg.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal for exponentials.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expsega', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'An exponential segment generator operating at a-rate.', syntax: 'ares = expsega(ia, idur1, ib [, idur2] [, ic] [...])', example: '--8<-- "examples/expsega.csd"', rates: ['a-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expsegb', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of exponential segments between specified absolute points.', syntax: 'ares = expsegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = expsegb(ia, itim1, ib [, itim2] [, ic] [...])', example: '--8<-- "examples/expsegb.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal for exponentials.', type: 'initialization' }, { name: 'itim1', description: 'time in seconds of end of first segment.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expsegba', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'An exponential segment generator operating at a-rate with absolute times.', syntax: 'ares = expsegba(ia, itim1, ib [, itim2] [, ic] [...])', example: '--8<-- "examples/expsegba.csd"', rates: ['a-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal.', type: 'initialization' }, { name: 'itim1', description: 'time in seconds at end of first segment.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'expsegr', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of exponential segments between specified points including a release segment.', syntax: 'ares = expsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = expsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)', example: '--8<-- "examples/expsegr.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value. Zero is illegal for exponentials.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, { name: 'irel', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, { name: 'iz', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'gainslider', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'An implementation of a logarithmic gain curve which is similar to the gainslider~ object from Cycling 74 Max / MSP.', syntax: 'kout = gainslider(kindex)', example: '--8<-- "examples/gainslider.csd"', parameters: [ { name: 'kindex', description: 'Index value. Nominal range from 0-127. For example a range of 0-152 will give you a range from -∞ to +18.0 dB.', type: 'performance' }, { name: 'kout', description: 'Scaled output.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'lincos', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Linear to cosine interpolation.', syntax: 'ky = lincos(kx, ky0, ky1 [, kx0, kx1 ])\n iy = lincos(ix, iy0, iy1 [, ix0, ix1 ])', example: '--8<-- "examples/lincos.csd"', parameters: [ { name: 'kx', description: 'Input signal', type: 'performance' }, { name: 'ky0', description: 'Lower limit of output range', type: 'performance' }, { name: 'ky1', description: 'Higher limit of output range', type: 'performance' }, { name: 'kx0', description: 'Lower limit of input range (default = 0)', type: 'performance' }, { name: 'kx1', description: 'Higher limit of input range (default = 1)', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'line', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a straight line between specified points.', syntax: 'ares = line(ia, idur, ib)\n kres = line(ia, idur, ib)', example: '--8<-- "examples/line.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'ib', description: 'value after _idur_ seconds.', type: 'initialization' }, { name: 'idur', description: 'duration in seconds of segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'linlin', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Linear to linear interpolation.', syntax: 'ky = linlin(kx, ky0, ky1 [, kx0, kx1 ])\n iy = linlin(ix, iy0, iy1 [, ix0, ix1 ])\n kys[] = linlin(kxs[], ky0, ky1 [, kx0, kx1 ])\n iys[] = linlin(ixs[], ky0, ky1, [ kx0, kx1 ])\n kC[] = linlin(kx, kA[], kB[] [, kx0, kx1 ])', example: '--8<-- "examples/linlin.csd"', parameters: [ { name: 'kx', description: 'Input signal', type: 'performance' }, { name: 'kx0', description: 'Lower limit of input range. _Defaults to 0_', type: 'performance' }, { name: 'kx1', description: 'Higher limit of input range. _Defaults to 1_', type: 'performance' }, { name: 'ky0', description: 'Lower limit of output range', type: 'performance' }, { name: 'ky1', description: 'Higher limit of output range', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'linseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified points.', syntax: 'ares = linseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = linseg(ia, idur1, ib [, idur2] [, ic] [...])', example: '--8<-- "examples/linseg.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'linsegb', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified absolute points.', syntax: 'ares = linsegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = linsegb(ia, itim1, ib [, itim2] [, ic] [...])', example: '--8<-- "examples/linsegb.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'itim1', description: 'time in seconds of end of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'linsegr', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Trace a series of line segments between specified points including a release segment.', syntax: 'ares = linsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = linsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)', example: '--8<-- "examples/linsegr.csd"', rates: ['a-rate', 'k-rate'], parameters: [ { name: 'ia', description: 'starting value.', type: 'initialization' }, { name: 'idur1', description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.', type: 'initialization' }, { name: 'irel', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, { name: 'iz', description: 'duration in seconds and final value of a note releasing segment.', type: 'initialization' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'logcurve', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'This opcode implements a formula for generating a normalised logarithmic curve in range 0 - 1. It is based on the Max / MSP work of Eric Singer (c) 1994.', syntax: 'kout = logcurve(kindex, ksteepness)', example: '--8<-- "examples/logcurve.csd"', parameters: [ { name: 'kindex', description: 'Index value. Expected range 0 to 1.', type: 'performance' }, { name: 'ksteepness', description: 'Steepness of the generated curve. Values closer to 1.0 result in a straighter line while larger values steepen the curve.', type: 'performance' }, { name: 'kout', description: 'Scaled output.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'loopseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Generate control signal consisting of linear segments delimited by two or more specified points.', syntax: 'ksig = loopseg(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2][...])', example: '--8<-- "examples/loopseg.csd"', parameters: [ { name: 'iphase', description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.', type: 'initialization' }, { name: 'ksig', description: 'Output signal.', type: 'performance' }, { name: 'kfreq', description: 'Repeat rate in Hz or fraction of Hz.', type: 'performance' }, { name: 'ktrig', description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'loopsegp', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Control signals based on linear segments.', syntax: 'ksig = loopsegp(kphase, kvalue0, kdur0, kvalue1 \\\n [, kdur1, ... , kdurN-1, kvalueN])', example: '--8<-- "examples/loopsegp.csd"', parameters: [ { name: 'ksig', description: 'output signal', type: 'performance' }, { name: 'kphase', description: 'point of the sequence read, expressed as a fraction of a cycle (0 to 1)', type: 'performance' }, { name: 'kvalueN', description: 'values of points', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'looptseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Generate control signal consisting of exponential or linear segments delimited by two or more specified points.', syntax: 'ksig = looptseg(kfreq, ktrig, iphase, kvalue0, ktype0, ktime0, [, kvalue1] \\\n [,ktype1] [, ktime1] [, kvalue2] [,ktype2] [, ktime2] [...] \\\n [, kvalueN] [,ktypeN] [, ktimeN])', example: '--8<-- "examples/looptseg.csd"', parameters: [ { name: 'iphase', description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.', type: 'initialization' }, { name: 'ksig', description: 'Output signal.', type: 'performance' }, { name: 'kfreq', description: 'Repeat rate in Hz or fraction of Hz.', type: 'performance' }, { name: 'ktrig', description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'loopxseg', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Generate control signal consisting of exponential segments delimited by two or more specified points.', syntax: 'ksig = loopxseg(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])', example: '--8<-- "examples/loopxseg.csd"', parameters: [ { name: 'ksig', description: 'Output signal.', type: 'performance' }, { name: 'kfreq', description: 'Repeat rate in Hz or fraction of Hz.', type: 'performance' }, { name: 'ktrig', description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.', type: 'performance' }, { name: 'iphase', description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'lpshold', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Generate control signal consisting of held segments.', syntax: 'ksig = lpshold(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])', example: '--8<-- "examples/lpshold.csd"', parameters: [ { name: 'ksig', description: 'Output signal', type: 'performance' }, { name: 'kfreq', description: 'Repeat rate in Hz or fraction of Hz', type: 'performance' }, { name: 'ktrig', description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.', type: 'performance' }, { name: 'iphase', description: 'A vaue between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'lpsholdp', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Control signals based on held segments.', syntax: 'ksig = lpsholdp(kphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])', example: '--8<-- "examples/lpsholdp.csd"', parameters: [ { name: 'ksig', description: 'output signal', type: 'performance' }, { name: 'kphase', description: 'point of the sequence read, expressed as a fraction of a cycle (0 to 1)', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'scale', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Arbitrary signal scaling.', syntax: 'kscl = scale(kinput, kmax, kmin[, kimax, kimin])', example: '--8<-- "examples/scale.csd"', parameters: [ { name: 'kin', description: 'Input value. Can originate from any k-rate source as long as that source\'s output is in range', type: 'performance' }, { name: 'kmin', description: 'Minimum value of the resultant scale operation.', type: 'performance' }, { name: 'kmax', description: 'Maximum value of the resultant scale operation.', type: 'performance' }, { name: 'kimin', description: 'Optional; Minimum of the incoming value range, defaulting to zero.', type: 'performance' }, { name: 'kimax', description: 'Optional; Maximum of the incoming value range, defaulting to one.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, { name: 'scale2', type: 'opcode', category: 'Signal Generators:Linear and Exponential Generators', description: 'Arbitrary signal scaling with optional smoothing.', syntax: 'kscl = scale2(kinput, kmin, kmax[, kimin, kimax][ihtime])', example: '--8<-- "examples/scale2.csd"', parameters: [ { name: 'kin', description: 'Input value. Can originate from any k-rate source and should be in the range _kimin_ to _kimax_. If it is larger than kimax it is treated as kimax, and if less than kimin then it is treated as kimin.', type: 'performance' }, { name: 'kmin', description: 'Minimum value of the resultant scale operation.', type: 'performance' }, { name: 'kmax', description: 'Maximum value of the resultant scale operation.', type: 'performance' }, { name: 'kimin', description: 'Optional; Minimum of the incoming value range, defaulting to zero.', type: 'performance' }, { name: 'kimax', description: 'Optional; Maximum of the incoming value range, defaulting to one.', type: 'performance' }, ], seeAlso: ['Linear and Exponential Generators'] }, ]