vexpseg

vexpseg — Vectorial envelope generator

Description

Generate exponential vectorial segments

Syntax

vexpseg  ifnout, ielements, ifn1, idur1, ifn2 [, idur2, ifn3 [...]]

Initialization

ifnout - number of table hosting output vectorial signal

ifn1 - starting vector

ifn2, ifn3,etc. - vector after idurx seconds

idur1 - duration in seconds of first segment.

idur2, idur3, etc. - duration in seconds of subsequent segments.

ielements - number of elements of vectors.

Performance

These opcodes are similar to linseg and expseg, but operate with vectorial signals instead of with scalar signals.

Output is a vectorial control signal hosted by ifnout (that must be previously allocated), while each break-point of the envelope is actually a vector of values. All break-points must contain the same number of elements (ielements).

All these operators are designed to be used together with other opcodes that operate with vectorial signals such as>, vcella, adsynt, adsynt2, etc.

Example

Here is an example of the vexpseg opcode. It uses the files vexpseg.csd.

Example 1180. Example of the vexpseg opcode.

<CsoundSynthesizer>
<CsOptions>
-odac -B441 -b441
</CsOptions>
<CsInstruments>


sr=44100
ksmps=10
nchnls=2

gilen init 32

gitable1 ftgen 0, 0, gilen, 10, 1
gitable2 ftgen 0, 0, gilen, 10, 1

gitable3 ftgen 0, 0, gilen, -7, 30, gilen, 35
gitable4 ftgen 0, 0, gilen, -7, 400, gilen, 450
gitable5 ftgen 0, 0, gilen, -7, 5000, gilen, 5500

instr 1
vcopy gitable2, gitable1, gilen
turnoff
endin

instr 2
vexpseg gitable2, 16, gitable3, 2, gitable4, 2, gitable5
endin

instr 3
kcount init 0
if kcount < 16 then
	kval table kcount, gitable2
	printk 0,kval
	kcount = kcount +1
else
turnoff
endif

endin


</CsInstruments>
<CsScore>
i1 0 1
s
i2 0 10
i3 0 1
i3 1 1
i3 1.5 1
i3 2 1
i3 2.5 1
i3 3 1
i3 3.5 1
i3 4 1
i3 4.5 1

</CsScore>
</CsoundSynthesizer>


Credits

Written by Gabriel Maldonado.

Example by Andres Cabrera.

New in Csound 5 (Previously available only on CsoundAV)