First time here? Check out the FAQ!
x

Dynamically changing arrays (and arrays size!) in InputOutputCharacteristic

0 votes
189 views

Hi,

I am trying to change arrays dynamically in InputOutputCharacteristic (example attached). I don't understand the error message. Is there a way to solve the problem?

 

asked Feb 1, 2016 in Capytalk & Smalltalk by malcolm-braff (Practitioner) (770 points)

1 Answer

+3 votes

In the InputOutputCharacteristic, InValues and OutValues fields, the individual elements of the array can be changing while the Sound is running; however, the number of elements in the Array can change only at compile time.

In the Capytalk true:false: message, each argument must be an EventExpression that evaluates to a single value, not to a data structure like an Array.  For example, where you have:

 {!Fader true: {?Array1} false: {?Array2}}

you could instead have a true:false: expression for each element of the array (but not a true:false expression that selects one of two Arrays).

To switch between two InputOutputCharacteristics with different sized Arrays, you could construct a MultiGrid where, for example,  Track1 has the OscillatorTimeIndex and you feed the output of Track1 to a submix.

The submix could then be used as the input to Track2 in which you have several different InputOutputCharacteristics, each with different numbers of Array elements.

Then you could switch instantly between them, without any interruption of the audio signal (and the Oscillator TimeIndex) would be shared.

answered Feb 7, 2016 by ssc (Savant) (115,600 points)
This is one of the most advanced capabilities of Kyma, to be able to 'hot swap' code structures without disturbing the overall execution of the code
...