1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 09:39:42 +02:00
2015-04-07 22:10:17 -05:00

24 lines
700 B
Plaintext

(TONEV-ALG
(NAME "tonev")
(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz"))
(INTERNAL-SCALING s1)
(ALWAYS-SCALE hz)
(START (MAX s1 hz))
(TERMINATE (MIN s1 hz))
(LOGICAL-STOP (MIN s1))
(STATE ("double" "scale1" "s1->scale")
("double" "c2" "0.0")
("double" "c1" "0.0")
("double" "prev" "0.0;
hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))"))
(SAMPLE-RATE (MAX s1))
(STEP-FUNCTION hz)
(DEPENDS ("b" "hz" "2.0 - cos(hz)" TEMP "register double")
("c2" "hz" "b - sqrt((b * b) - 1.0)")
("c1" "hz" "(1.0 - c2) * scale1"))
(CONSTANT "c1" "c2" "b" "scale1")
(FORCE-INTO-REGISTER scale1)
(INNER-LOOP "output = (sample_type) (prev = c1 * s1 + c2 * prev)")
)