rsc3/doc/help/ugen/binary-ops/round-up.help.scrbl

25 lines
390 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(round-up a b)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Rounds a up to the nearest multiple of b.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((x (mouse-x kr 60 4000 0 0.1))
(f (round-up x 100)))
(audition
(out 0 (mul (sin-osc ar f 0) 0.1))))
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 ((n (line kr 24 108 6 remove-synth)))
(audition
(out 0 (mul (saw ar (midi-cps (round-up n 1))) 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00