Referring to this part of the related Q&A:
For example, in the Sound being replicated, you could do something like:
(!osc_count ge: ?VoiceNumber) true: !osc_value false: 0
to provide a default value (or to turn off the output of a Sound) when too few values were supplied.
Could I construct the hot value !osc_value with a user-supplied string in the place of 'value', by using the asHotValue command/technique as outlined on p.220 of "Kyma X Revealed!"?
For example, create a function (i.e. myFaderMaker) that constructs a hot value based on a supplied string that's available pre-compilation, and store the result of a call to that in a variable, which is then supplied to the above example code, in place of !osc_value.
Something like this:
| myFaderMaker oscValue |
myFaderMaker := [:str | ('osc_', str) asHotValue].
oscValue := myFaderMaker value: myArbitraryOSCAddress
then, in the sound being replicated, do something like:
(!osc_count ge: ?VoiceNumber) true: oscValue false: 0
...as long as oscValue is still in scope!
Next, in a SoundToGlobalController external to the replicator, assign incoming consecutive osc-values to an EventVariable array, and output the entire array as the GeneratedEvent (which could then be used to directly populate a sequencer field with values, for example):
| anArray, myFaderMaker2 |
myFaderMaker2 := [:str :num | ('osc_', str, '__', (num printString)) asHotValue].
anArray := EventVariable new size: oscCountMaxValue.
1 to: oscCountMaxValue do: [ :i |
(anArray @< i) <+ (myFaderMaker2 value: myArbitraryOSCAddress value: i) ].
"replace this line with an expression that truncates anArray to the size of !osc_count ??"
anArray.
This inspires a few related questions:
[1] In the above code example:
Is there a way to, at the Capytalk update rate (necessarily), truncate anArray to the size of !osc_count, or similarly, copy those values to a new array? If so, could a version of this example be made without use of the replicator, by referring to the osc hotValues directly using an approach like in 'myFaderMaker2' above... provided that the resulting array count does not exceed !osc_count, or otherwise could somehow be made to "stop" at that hotValue-supplied index value?
[2] Where might one best place a 'mini-code-library' of predefined blocks, to make them available to the rest of the sound?
I have some more questions mulling around my brain, but these are the basics that should lead me to figure the rest out on my own. Thank you!