rsc3/oregano/examples/instrument-example.rkt

44 lines
782 B
Racket
Raw Permalink Normal View History

#lang racket
(require oregano)
2014-05-29 05:41:53 +00:00
(display "start\n")
2014-05-22 17:39:35 +00:00
(define my-note (play-note "sin-inst" 440))
(sleep 1)
;; stop playing note
(note-off my-note)
2014-05-29 05:41:53 +00:00
(display "end note1\n")
(define my-note2 (play-note "saw-inst" 880))
(sleep 2)
(note-off my-note2)
(display "end note2\n")
(sleep 1)
2014-05-29 05:41:53 +00:00
(define my-note3 (play-note "sin-inst" 500))
(sleep 1)
;; stop playing note
(note-off my-note3)
2014-05-29 05:41:53 +00:00
#;(
2014-05-22 17:39:35 +00:00
(define my-note2 (make-note "sin-inst" 880))
(note-on my-note2)
(sleep 1)
(note-off my-note2)
2014-05-29 05:41:53 +00:00
)
2014-05-22 18:09:24 +00:00
2014-05-29 05:41:53 +00:00
#|
2014-05-22 18:09:24 +00:00
(make-instrument "my-inst" ([freq 500] [mod 20])
(mul (sin-osc ar mod 0)
(sin-osc ar freq 0)))
(define weird-note (play-note "my-inst" 440))
(param-slider "change frequency" 1 100 40
(lambda (val)
(set-note-param weird-note "mod" val)))
2014-05-29 05:41:53 +00:00
(show-gui)
|#