rsc3/doc/help/ugen/binary-ops/sqr-sum.help.scrbl
2022-08-28 12:27:01 +02:00

28 lines
546 B
Racket

#lang scribble/manual
@(require (for-label racket))
@title{(sqr-sum a b)}
Square of the difference. Return the value of (a + b)**2. This is
more efficient than using separate unit generators for each
operation.
@racketblock[
(audition
(out 0 (mul (sqr-sum (f-sin-osc ar 800 0)
(f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
0.125)))
]
@racketblock[
(let ((a (f-sin-osc ar 800 0))
(b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
(audition
(out 0 (mul (mul (add a b) (add a b))
0.125))))
]