1 // The following interface in an optimized version of asControlInput that
2 // flattens arrayed values and marks the outermost array of a value with $[ and $]
3 // These Chars are turning into typetags ([ and ]) in the OSC message to mark that array
4 // Inner arrays are flattened (they are not meaningful in the server context)
5 // This makes it possible to write Synth("test", [0, [[100,200,300], [0.1,0.2,0.3], [10,20,30]] ])
6 // and have all the arguments be assigned to consecutive controls in the synth.
11 var array = Array(100); // allocate a bunch of space
12 this.do { | msg | array = array.add(msg.asOSCArgArray) };
17 var array = Array(100); // allocate a bunch of space
18 this.do { | e | array = e.asOSCArgEmbeddedArray(array) };
22 asOSCArgEmbeddedArray { | array|
23 array = array.add($[);
24 this.do{ | e | array = e.asOSCArgEmbeddedArray(array) };
33 asControlInput { ^this.asArray }
34 asOSCArgEmbeddedArray { | array| ^this.asArray.asOSCArgEmbeddedArray(array) }
38 asOSCArgEmbeddedArray { | array| ^array.add(this.asControlInput) }
39 asOSCArgArray { ^this.asControlInput }
40 asOSCArgBundle { ^this.asControlInput }
41 asStringff { | size = 8 |
42 var str = this.asString;
44 str = str ++ String.fill(size - str.size, Char.space);
49 this.asStringff(size).post
58 asOSCArgEmbeddedArray { | array| ^value.asOSCArgEmbeddedArray(array) }
63 eq { arg function, adverb; ^this.composeBinaryOp('==', function, adverb) }
65 ne { arg function, adverb; ^this.composeBinaryOp('!=', function, adverb) }