rsc3/doc/help/ugen/fft/pv-mag-above.help.scrbl

47 lines
1.1 KiB
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(pv-mag-above buffer threshold)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Pass only bands where the magnitude is above `threshold'. This
value is not normalized and is therefore dependant on the buffer
size.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3
(lambda (fd)
(async fd (b-alloc 10 2048 1))
(async fd (b-alloc 11 2048 1))
(async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
(x (mouse-x kr 1 100 0 0.1))
(y (mouse-y kr 0 1 0 0.1))
(c1 (fft* 10 a))
(c2 (pv-copy c1 11))
(c3 (pv-mag-below c1 x))
(c4 (pv-mag-above c2 x)))
(audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2)))
(f2 (mul-add (sin-osc kr f1 0) 100 800))
(s (sin-osc ar f2 0))
(x (mouse-x kr 1 1024 0 0.1))
(y (mouse-y kr 0 1 0 0.1))
(c1 (fft* 10 s))
(c2 (pv-copy c1 11))
(c3 (pv-mag-below c1 x))
(c4 (pv-mag-above c2 x)))
(audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00