First time here? Check out the FAQ!
x

Why does the "Element or Array...?" dialog pop up all the time?

0 votes
314 views

Hi,

I'm using the StepSequencer sound and using a bit of smallTalk in its parameters to generate a bunch of faders etc. I think in the usual way. And every time I compile the sound I get a dialog popping up asking me:

"Does ... represent an element in the array or the array itself?"

The expressions causing the problems are:

StepSequencer:

    KEYDOWNS:  {(1 to: ?Steps) collect: [:i | !On_ suffix: i]}
    KEYPITCHES: {(1 to: ?Steps) collect: [:i | (!Pitch_ suffix: i) + (!Octave * 12) + 60]}

What am I doing wrong?

 

asked May 5, 2017 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (15,840 points)

2 Answers

+1 vote
You should try to pass such Collections, from a Script. Kyma will ask the same question but it will make more sense in a way.

Before the Sequencer, make a script

(inputs at: 1) "or the exact name of the sound at the input"

start: 0 s

gates: ( 1 to: ?Steps collect: [:i | !On_ suffix: i] )

and so on.

then reference ?gates in the KeyDowns field

 

This way, you only need to tell the Sequencer once for it to disambiguate between an element or an array and you can tweak the code in the Script object
answered May 7, 2017 by cristian-vogel (Master) (8,410 points)
Thanks Cristian!

Putting the array creation in a script seems to help, but if I edit anything in the StepSequencer sound, even if it's not one of the array parameters it still pops up the dialog asking about array elements. Seeing as I now have 5 of these arrays (gates, pitches, velocities, midi controller 1 and pitch bends) it's still a bit maddening.

I'm struggling trying to get this pattern to work for the ExtraValues field, see my related question:

http://kyma.symbolicsound.com/qa/2432/construct-eventvalues-extravalues-parameter-stepsequencer
0 votes
The reason it is asking is because there is a single element in an Array field and that element is being identified as "lifted" or "unbound" due to the variable ?Steps.  The reason the question comes up is actually for a simpler case: the case when you have a single variable in the field (which could represent an Array or could represent a single element in an Array).

If you don't really need ?Steps to be a variable, you could use a constant in its place and it will no longer trigger the question each time.
answered May 8, 2017 by ssc (Savant) (126,620 points)
...