tmhglnd / mercury

A minimal and human-readable language and environment for the live coding of algorithmic electronic music.
http://www.timohoogland.com/mercury-livecoding
GNU General Public License v3.0
304 stars 13 forks source link

Multiple arguments for OSC sends #13

Closed tmhglnd closed 4 years ago

tmhglnd commented 4 years ago

Currently the osc output does not support sending multiple arguments as an array over the same address. Ideally this would be possible, similar as to providing arguments for other functions.

ring val1 [0.25 0.5 0.75]
ring val2 [3 1 4]

new emitter osc name(myOSC) time(1/4) 
    set myOSC aMessage(val1 val2)

// emits => /myOSC/aMessage 0.25 3
            /myOSC/aMessage 0.5 1
            /myOSC/aMessage 0.75 4
            /myOSC/aMessage 0.25 3
            etc...
tmhglnd commented 4 years ago

Now implemented. The functions can support arbitrary amount of arguments and when provided a ring the value will be looked up based on the internal noteCount of the instrument time() and beat() functions.