byulparan / cl-collider

A SuperCollider client for CommonLisp
Other
218 stars 23 forks source link

Example on how to get left and right channel from multiout-ugen #114

Closed bpostlethwaite closed 2 years ago

bpostlethwaite commented 2 years ago

I have a stereo signal and would like to pass left and right into balance2.ar but can't figure out how to separate the channels. In sclang it's an array index sig[0] and sig[1].

Sorry if this is the wrong venue for such questions, happy to post or go elsewhere. Thanks, really amazing lib.

defaultxr commented 2 years ago

In cl-collider it's similar but they're lists instead of arrays. So you can use either elt or nth:

(proxy :foo
       (let* ((s (sin-osc.ar (list 440 441)))
              (b (balance2.ar (elt s 0) (elt s 1))))
         (out.ar 0 b)))
bpostlethwaite commented 2 years ago

Much appreciated, thank you