packages feed

hsc3-0.5: Help/Server/s_newargs.help.lhs

/s_newargs create a new synth

string - synth definition name
int    - synth ID
int    - add action (0,1,2, 3 or 4 see below)
int    - add target ID
[
  int|string - a control index or name
  int        - number of sequential controls to change (M)
  [
    float - a control value
  ] * M
] * N

Note: this command is inherently problematic when used with 
graphs generated by hsc3 since, as a rule, it is not possible
to fix the ordering of control variables.

> let { ks n is = let { js = (Nothing : map Just [1..])
>                     ; f (i,j) = Control KR (maybe n ((n ++) . show) j) i }
>                 in mce (reverse (map f (zip is js)))
>     ; f = ks "f" [1,2,3,4]
>     ; g = out 0 (mix (sinOsc AR f 0 * 0.1))
>     ; fs = [440, 450, 600, 700]
>     ; a fd = do { async fd (d_recv (synthdef "g" g))
>                 ; send fd (s_newargs "g" (-1) AddToTail 1 [("f", fs)]) } }
> in do { print g
>       ; withSC3 a }

> s_newargs "g" (-1) AddToTail 1 [("f", [440, 450, 600, 700])]