mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-28 16:23:49 +01:00
Move library tree where it belongs
This commit is contained in:
17
lib-src/libnyquist/nyquist/tran/congen.alg
Normal file
17
lib-src/libnyquist/nyquist/tran/congen.alg
Normal file
@@ -0,0 +1,17 @@
|
||||
(CONGEN
|
||||
(NAME "congen")
|
||||
(ARGUMENTS ("sound_type" "sndin") ("double" "risetime") ("double" "falltime"))
|
||||
(START (MIN sndin))
|
||||
(STATE ("double" "value" "0")
|
||||
("double" "rise_factor" "exp(log(0.5) / (sndin->sr * risetime))")
|
||||
("double" "fall_factor" "exp(log(0.5) / (sndin->sr * falltime))"))
|
||||
(CONSTANT "fall_factor" "rise_factor")
|
||||
(ALWAYS-SCALE sndin)
|
||||
(TERMINATE (MIN sndin))
|
||||
(INNER-LOOP " sample_type current = sndin;
|
||||
if (current > value) {
|
||||
value = current - (current - value) * rise_factor;
|
||||
} else {
|
||||
value = current - (current - value) * fall_factor;
|
||||
}
|
||||
output = (sample_type) value;"))
|
||||
Reference in New Issue
Block a user