changed some names. added name param to slider
This commit is contained in:
parent
b3236c87fd
commit
b808668687
3 changed files with 15 additions and 9 deletions
|
@ -47,7 +47,7 @@ The purpose of playing notes on different tracks is we can have different filter
|
||||||
You can either use a preset instrument or define your own instrument
|
You can either use a preset instrument or define your own instrument
|
||||||
|
|
||||||
;; this uses the piano preset
|
;; this uses the piano preset
|
||||||
(define my-piano (make-instrument 'piano))
|
(define my-piano (preset-instrument 'piano))
|
||||||
|
|
||||||
;; create a custom instrument
|
;; create a custom instrument
|
||||||
;; can use oscilators and envelopes
|
;; can use oscilators and envelopes
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
(require (prefix-in gui: racket/gui))
|
(require (prefix-in gui: racket/gui))
|
||||||
|
|
||||||
(define frame (new gui:frame% [label "Example"]))
|
(define frame (new gui:frame% [label "Sliders"]))
|
||||||
|
|
||||||
;; parent should be a frame
|
;; parent should be a frame
|
||||||
(new gui:slider% [parent frame]
|
(new gui:slider% [parent frame]
|
||||||
|
@ -20,16 +20,16 @@
|
||||||
|
|
||||||
(gui:send frame show #t)
|
(gui:send frame show #t)
|
||||||
|
|
||||||
|
|
||||||
;; hypothetical usage
|
;; hypothetical usage
|
||||||
#;(add-filter track2 (lpf #:resonance .3
|
#;(add-filter track2 (lpf #:resonance .3
|
||||||
#:cutoff (slider 300 800 500)))
|
#:cutoff (slider 300 800 500)))
|
||||||
|
|
||||||
(define (slider min-n max-n init)
|
(define (slider name min-n max-n init)
|
||||||
|
;; TODO - determine available bus
|
||||||
(define bus-id 16)
|
(define bus-id 16)
|
||||||
|
|
||||||
(new gui:slider% [parent frame]
|
(new gui:slider% [parent frame]
|
||||||
[label "amp"]
|
[label name]
|
||||||
[min-value min-n]
|
[min-value min-n]
|
||||||
[max-value max-n]
|
[max-value max-n]
|
||||||
[init-value init]
|
[init-value init]
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
(define sin-instrument
|
(define sin-instrument
|
||||||
(letc ([bus 0]
|
(letc ([bus 0]
|
||||||
[freq 440])
|
[freq 440])
|
||||||
(out bus (mul (slider 100 800 200) (sin-osc ar freq 0)))))
|
(out bus (mul (slider "amplitude" 100 800 200) (sin-osc ar freq 0)))))
|
||||||
|
|
||||||
(define saw-instrument
|
(define saw-instrument
|
||||||
(letc ([bus 0]
|
(letc ([bus 0]
|
||||||
|
@ -76,8 +76,7 @@
|
||||||
|
|
||||||
;; setup
|
;; setup
|
||||||
;; show osc messages on server
|
;; show osc messages on server
|
||||||
(with-sc3 (lambda (fd)
|
(send-msg (dump-osc 1))
|
||||||
(send fd (dump-osc 1))))
|
|
||||||
(with-sc3 reset)
|
(with-sc3 reset)
|
||||||
|
|
||||||
;; send synthdefs
|
;; send synthdefs
|
||||||
|
@ -117,7 +116,7 @@
|
||||||
|
|
||||||
;; example:
|
;; example:
|
||||||
|
|
||||||
; (note-on my-sin 500 1)
|
(note-on my-sin 500 1)
|
||||||
|
|
||||||
; (note-off my-sin)
|
; (note-off my-sin)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
### Installation/setup
|
### Installation/setup
|
||||||
|
|
||||||
|
|
||||||
|
scsynth in
|
||||||
|
/Volumes/SuperCollider/SuperCollider/SuperCollider.app/Contents/Resources/scsynth
|
||||||
|
|
||||||
|
or /Applications/...
|
||||||
|
|
||||||
|
|
||||||
#### Ubuntu 12.10
|
#### Ubuntu 12.10
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue