added initial rsc3 scribble doc file
This commit is contained in:
parent
290ace54ed
commit
6f26f0a709
1 changed files with 61 additions and 0 deletions
61
rsc3/rsc3.scrbl
Normal file
61
rsc3/rsc3.scrbl
Normal file
|
@ -0,0 +1,61 @@
|
|||
#lang scribble/doc
|
||||
|
||||
@(require scribble/manual
|
||||
scribble/bnf)
|
||||
|
||||
@title{@bold{rsc3}: SuperCollider client library}
|
||||
|
||||
@author[(author+email "Mustafa Khafateh" "mushk45@gmail.com")]
|
||||
|
||||
@(require (for-label "main.rkt"))
|
||||
|
||||
@defmodule[rsc3]{This collection provides means to work with the SuperCollider
|
||||
synthesis server
|
||||
|
||||
|
||||
@defproc[(audition [ugen ugen?]) ()]{
|
||||
|
||||
Plays sound generated by the ugen. This creates a synthdef,
|
||||
sends it to the server using the name "anonymous" and group 1, and creates a new synth.
|
||||
|
||||
Example:
|
||||
@racketblock[
|
||||
;; play sin wave
|
||||
(audition (out 0 (mul (sin-osc ar 440 0) 0.1)))
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@section{Sending commands to the server}
|
||||
|
||||
Most functions that send messages to the server do so by accepting a file descriptor type as the first argument.
|
||||
This function is passed to with-udp-sc3 or with-tcp-sc3, which call the function on a socket of a specific type.
|
||||
|
||||
|
||||
@defproc[(with-udp-sc3 [func procedure?]) b]{
|
||||
func should be a function that takes a file descriptor (reset is an example of such a function).
|
||||
with-udp-sc3 opens a udp socket, calls func on that socket, closes the socket, and returns the return value of func.
|
||||
|
||||
|
||||
}
|
||||
|
||||
Example:
|
||||
@racketblock[
|
||||
(with-udp-sc3 reset)
|
||||
]
|
||||
|
||||
@racketblock[
|
||||
(define (play-ugen ugen)
|
||||
(with-udp-sc3 (lambda (fd)
|
||||
(play fd ugen))))
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@section{Reporting Bugs}
|
||||
|
||||
For Heaven's sake, report lots of bugs!
|
Loading…
Reference in a new issue