Skip to content

Instantly share code, notes, and snippets.

@josephwilk
Last active December 28, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephwilk/7511216 to your computer and use it in GitHub Desktop.
Save josephwilk/7511216 to your computer and use it in GitHub Desktop.
(use 'overtone.live)
(def harp-s (sample (freesound-path 27130)))
(def dub-s (sample (freesound-path 185943)))
(defsynth skipping-sequencer
"Plays a single channel audio buffer."
[buf 0 rate 1 out-bus 0 beat-cnt-bus 0 beat-trg-bus 0 start-point 0 bar-trg 0 loop? 0 vol 1.0]
(out out-bus (* vol (scaled-play-buf 1 buf rate bar-trg start-point loop?))))
(def x (skipping-sequencer :buf (to-sc-id dub-s)
:loop? true
:out-bus 0))
(ctl x :bar-trg 0)
(ctl x :start-point 0)
;; Start @ 4000
(ctl x :start-point 4000)
(ctl x :bar-trg 1)
;;Jump playback to 20000
(ctl x :start-point 2000) ;; Set time
(ctl x :bar-trg 0) ;; fire trigger
(ctl x :bar-trg 1)
;; This works a little bit better
(do
(ctl x :start-point 2000) ;; Set time
(ctl x :bar-trg 0) ;; fire trigger
(Thread/sleep 200) ;; Sleep... to give it time to detect change???
(ctl x :bar-trg 1) ;; Fire
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment