GENquadbezier

"quadbezier" — Generate a table with values from a quadratic Bézier function.

Description

Plugin gen in quadbezier.

This subroutine creates an ftable from segments constructed by paths traced by the quadratic Bézier function.

Syntax

f # time size "quadbezier" y1 cx1 cy1 x2 y2 [cx2 cy2 x3 y3 ...]

Initialization

x2, x3, etc. -- Locations in table at which to attain the following y value. Must be in increasing order. It is assumed that x1 equals 0. If the last value is less than size, then the rest will be set to zero. Should not be negative.

y1, y2, y3, etc. -- Breakpoint values attained at the location specified by the preceding x value.

cx1, cx2, cx3, etc. -- Virtual x coordinates for the different control points. cx[n] can be equal to but not less than x[n] and equal to but not greater than x[n+1]. Should not be negative but can be zero.

cy1, cy2, cy3, etc. -- Virtual y coordinates for the different control points.

Examples

Here is a simple example of the GENquadbezier routine. It uses the file genquadbezier.csd.

Example 1319. Example of the GENquadbezierroutine.

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

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o quadbezier.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1
kndx phasor 1/p3
kenv tablei kndx, p4, 1
asig poscil kenv, 440, 1
     outs asig, asig
  
endin

</CsInstruments>
<CsScore>
f 1 0 32768 10 1
f 2 0 1024 "quadbezier" 0 140 0.61 324 0.53 338 0.27 449 0.32 571 0.08 675 0.5 873 0.47 1024 0
f 3 0 1024 "quadbezier" 0 92 0.04 94 0.25 177 0.58 373 0.39 537 0.15 675 0.5 910 0.68 1024 0
f 4 0 1024 "quadbezier" 0 196 0.68 537 0.71 873 0.7 1024 0

i 1 0 4 2
i 1 4 4 3
i 1 8 4 4
</CsScore>

</CsoundSynthesizer>


These are the diagrams of the envelopes drawn by the GENquadbezier routine, as used in the example above:

f 2 0 1024 "quadbezier" 0 140 0.61 324 0.53 338 0.27 449 0.32 571 0.08 675 0.5 873 0.47 1024 0

f 2 0 1024 "quadbezier" 0 140 0.61 324 0.53 338 0.27 449 0.32 571 0.08 675 0.5 873 0.47 1024 0

f 3 0 1024 "quadbezier" 0 92 0.04 94 0.25 177 0.58 373 0.39 537 0.15 675 0.5 910 0.68 1024 0

f 3 0 1024 "quadbezier" 0 92 0.04 94 0.25 177 0.58 373 0.39 537 0.15 675 0.5 910 0.68 1024 0

f 4 0 1024 "quadbezier" 0 196 0.68 537 0.71 873 0.7 1024 0

f 4 0 1024 "quadbezier" 0 196 0.68 537 0.71 873 0.7 1024 0

See also

For references, check the comments in the source code.

Credits

Written by Guillermo Senna

2016