gausstrig

gausstrig — Random impulses around a certain frequency.

Description

Generates random impulses around a certain frequency.

Syntax

ares gausstrig kamp, kcps, kdev [, imode] [, ifrst1]
kres gausstrig kamp, kcps, kdev [, imode] [, ifrst1]

Initialization

imode (optional, default=0) -- imode > 0 means better frequency modulation. If the frequency changes, the delay before the next impulse is calculed again. With the default mode we have the classic behavior of the GaussTrig ugen in SuperCollider, where the frequency modulation is bypassed during the delay time that precedes the next impulse.

ifrst1 (optional, default=0) -- ifrst1 > 0 changes the original behavior of the GuassTrig ugen. By default, it always generates an impulse in the very beginning. Otherwise, the first impulse appearance is random and depends on kcps and kdev parameters.

Performance

kamp -- amplitude.

kcps -- the mean frequency over which random impulses are distributed.

kdev -- random deviation from mean (0 <= dev < 1).

Examples

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

Example 410. Example of the gausstrig opcode.

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 oscil.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

instr 1

kdev line 0, p3, 0.9
seed 20120125
aimp gausstrig 0.5, 10, kdev
aenv filter2 aimp, 1, 1, 0.993, 0.993
anoi fractalnoise 0.2, 1.7
al   = anoi*aenv
ar   delay al, 0.02
outs al, ar

endin
</CsInstruments>
<CsScore>
i1 0 10
e
</CsScore>
</CsoundSynthesizer>


Here is an example of the gausstrig opcode with imode = 1. It uses the file gausstrig-2.csd.

Example 411. Example of the gausstrig opcode with imode = 1.

<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 oscil.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

instr 1

kfrq0 oscil 8, 0.25, 1
ktrig metro 1
kfrq  samphold kfrq0+8, ktrig 
seed  20120125
aimp  gausstrig 0.5, kfrq, 0.5, 1
aenv  filter2 aimp, 1, 1, 0.993, 0.993
anoi  fractalnoise 0.2, 1.7
al    = anoi*aenv
ar    delay al, 0.02
outs  al, ar

endin
</CsInstruments>
<CsScore>
f1 0 8192 10 1
i1 0 16
e
</CsScore>
</CsoundSynthesizer>


See Also

dust dust2 mpulse

Credits

Based on Bhob Rainey's GaussTrig ugen (SuperCollider)
Author: Tito Latini
January 2012
Modification: Gleb Rogozinsky
March 2015

New in Csound version 5.16