rsc3/doc/help/ugen/information/buf-frames.help.scrbl

29 lines
476 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(buf-frames rate bufnum)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Current duration of buffer.
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-read 0 "/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 ((p (phasor ar 0 (buf-rate-scale kr 0) 0 (buf-frames kr 0) 0)))
(audition (out 0 (buf-rd 1 ar 0 p 0 2))))
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 ((p (k2a (mouse-x kr 0 (buf-frames kr 0) 0 0.1))))
(audition (out 0 (buf-rd 1 ar 0 p 0 2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00