vps

vps — Shapes a phase signal according to a two-dimensional vector.

Description

Vector phase shaping modifies a phase input value by mapping an input, in the range [0, 1) according to a non-linear function consisting of two piecewise linear segments joined at an inflection point. This is defined by the vector [kd, kv], where kd is in the range [0, 1) and kv can have any value.

Syntax

avp vps aph,kd,kv

Performance

avp -- output phase.

aph -- input phase (as produced by phasor).

kd -- horizontal vector component.

aph -- vertical vector component.

Examples

Here is an example of the use of the vps opcode. It uses the file vps.csd.

Example 1201. Example of the vps opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
-o dac -d
</CsOptions>
<CsInstruments>
0dbfs = 1
nchnls=1
ksmps = 1

instr 1
 kd = oscili:k(0.5,2) + 0.5
 kv = oscili:k(0.5,1.5) + 0.5
 aph = vps(phasor(p5),kd,kv)
 asig = p4*tablei:a(aph,-1,1,0.25,1)
 out(linenr(asig,0.1,0.1,0.01))
endin

</CsInstruments>
<CsScore>

i 1 0 10 0.5 110 


</CsScore>
</CsoundSynthesizer>


Credits

Author: Victor Lazzarini
July 2020