[CM] Triggering incudine events with cm-incudine

Brandon Hale bthaleproductions at gmail.com
Wed May 19 12:23:21 PDT 2021


Thank you Tito for the response and for patching that into cm-incudine. 
I'd also be happy to see other examples you like to use too, if you want 
to include them. I've been learning both cm and incudine, so I would 
love to see what others do with them together.

Thanks for the help Tito,

Brandon Hale

On 5/19/21 4:51 AM, Tito Latini wrote:
> 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