sclagud
Exponential Lag (Deprecated).
Plugin opcode in scugens.
Exponential lag with a smoothing time for up- and down signals. DEPRECATED (renamed as
lagud )
Syntax
Modern Classic
a out = sclagud ( a in , k lagup , k lagdown [, i nitialvalue ])
k out = sclagud ( k in , k lagup , k lagdown [, i nitialvalue ])
a out sclagud a in , k lagup , k lagdown [, i nitialvalue ]
k out sclagud k in , k lagup , k lagdown [, i nitialvalue ]
Initialization
initialvalue If given, sets the internal state. Defaults to the first value passed.
ain -- input signal
klagup -- 60 dB lag time in seconds for the upgoing signal.
klagdown -- 60 dB lag time in seconds for the downgoing signal.
This is essentially the same as sc_lag except that you can supply a different 60 dB time for when the signal goes up, from when the signal goes down. This is useful for smoothing out control signals, where "fade in" should be different from "fade out".
Examples
Modern Classic
Here is an example of the sclagud opcode. It uses the file sclagud.csd .
Example of the sclagud opcode. <CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0
instr 1
x : k = randh ( 2 , 1 )
x2 : k = sclagud ( x , 1.0 , 0.1 , 1 )
printks ( "x %f x2 %f \n " , 0.1 , x , x2 )
endin
instr 2
midis : k [] = fillarray ( 60 , 65 , 60 , 65 , 60 )
len : i = lenarray ( midis )
ndx : k = int ( linseg ( 0 , len * 2 , len - 0.00000001 ))
midi : k = mtof ( midis [ ndx ])
f req : a = sclagud ( a ( midi ), 1 , 0.1 )
a 0 = oscili ( 0.7 , f req )
f req1 : k = sclagud ( midi , 1 , 0.1 )
a 1 = oscili ( 0.7 , f req1 )
out ( a 0 , a 1 )
endin
</CsInstruments>
<CsScore>
i 1 0 10
i 2 0 12
</CsScore>
</CsoundSynthesizer>
Here is an example of the sc_lagud opcode. It uses the file sc_lagud.csd .
Example of the sc_lagud opcode. <CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0
instr 1
k x = randh ( 2 , 1 )
k x2 = sc_lagud ( k x , 1.0 , 0.1 , 1 )
printks "x %f x2 %f \n " , 0.1 , k x , k x2
endin
instr 2
k midis [] fillarray 60 , 65 , 60 , 65 , 60
i len = lenarray ( k midis )
k idx = int ( linseg ( 0 , i len * 2 , i len - 0.00000001 ))
k midi = mtof ( k midis [ k idx ])
a freq = sc_lagud ( a ( k midi ), 1 , 0.1 )
a 0 = oscili ( 0.7 , a freq )
k freq = sc_lagud ( k midi , 1 , 0.1 )
a 1 = oscili ( 0.7 , k freq )
outch 1 , a 0
outch 2 , a 1
endin
</CsInstruments>
<CsScore>
i 1 0 10
i 2 0 12
</CsScore>
</CsoundSynthesizer>
See also
Standard Filters: Control signal filters
Credits
By: Eduardo Moguillansky 2017