[CM] Triggering incudine events with cm-incudine
Tito Latini
tito.01beta at gmail.com
Wed May 19 01:51:56 PDT 2021
On Tue, May 18, 2021 at 03:48:45PM -0400, Brandon Hale wrote:
> Hello all,
>
> I am trying to figure out with cm-incudine how to trigger incudine (dsp!)
> functions with common music (process) loops. I figure there is probably a
> way built into cm-incudine to do this. I could always send midi from an
> incudine midi output to an incudine midi input to trigger a (dsp!) function,
> but this feels clunky.
I patched the extension of CM five years ago with:
(defmethod write-event ((obj function) (str incudine-stream) scoretime)
(declare (ignore str))
(at (+ (rts-now) scoretime) obj)
(values))
The side effect is the possibility to play the following example:
(in-package :scratch)
(dsp! girello (freq gain dur)
(stereo (* (envelope (make-perc .5 .5) 1 dur #'free)
(sine freq (db->linear gain)))))
(in-package :cm)
(defun harms (fund low high dur)
(let ((f (hertz fund)))
(process for i from low to high
output (lambda () (scratch::girello (* f (/ i low)) -9 dur))
wait (+ dur .1))))
(rts)
;; realtime
(sprout (harms 'c3 4 16 .25))
;; write soundfile
(incudine:bounce-to-disk ("/tmp/harms-from-cm.wav" :pad 0)
(sprout (harms 'c3 4 16 .25)))
More information about the Cmdist
mailing list