cl-patterns-study/setting-up-cl-collider.lisp

29 lines
868 B
Common Lisp

;; https://defaultxr.github.io/cl-collider-tutorial/02-getting-started.html
(ql:quickload :cl-collider)
(in-package :sc-user)
(setf *s* (make-external-server "localhost" :port 4444))
(server-boot *s*) ; already in use
;;; https://defaultxr.github.io/cl-collider-tutorial/03-make-a-sound.html
(proxy :foo (sin-osc.ar 440 0 0.2)) ; no error, but hear no sound
;; opened QjackCtl, connected Graph SuperCollider to Air by Aftershokz left
(proxy :foo (sin-osc.ar 300 0 0.2))
(proxy :foo (saw.ar 300 0.2))
(proxy :foo (saw.ar (sin-osc.kr 0.5 0 150 300) 0.2))
(proxy :foo (saw.ar (mouse-y.kr 20 10000 :exponential) 0.2))
(proxy :foo ())
(defsynth drum ((freq 3000))
(let* ((env (env-gen.ar (perc 0.001 0.1) :act :free))
(sig (lpf.ar (white-noise.ar) (* freq env))))
(out.ar 0 (pan2.ar sig 0 0.2))))
(synth 'drum :freq 3000)