Order of execution

Experimenting is a valid way of learning, sure. What I meant was, you actually ran into this situation before (“Sadly there is no way to mute individual lines to get to the bottom of this” @ Chains of reassignment), where you tried to use a signal as an input to something else, but the signal hadn’t been prepared. It’s the same thing. If you’re using a signal input, there must be a signal to input.

So, in the first example here, either you expected it to work, or you expected it to fail. If you expected it to fail, then you already understand the principle (and you already know the answer – so, you could start to have a bit more confidence).

If you expected it to work, then it suggests to me that you might be under-generalizing from the experimental results – seeing the earlier question and this question as distinct, separate situations when in fact they are variants of the same principle. This is a tricky thing – nobody knows, at the beginning, how much to generalize findings. From where I sit, it looks to me like you tend to view the results of your experiments as small-scale ideas when, often, they point to broader principles – IMO, you could afford to generalize a bit more.

For instance, if you use patterns later on, eventually you’ll find Pkey, which allows reuse of previously calculated values:

// this is ok
p = Pbind(
    \a, Pwhite(1, 10, inf),
    \b, Pkey(\a) * 2
);

// this will throw an error when played
p = Pbind(
    \b, Pkey(\a) * 2,
    \a, Pwhite(1, 10, inf)
);

The surface appearance is different but it’s the same principle.

hjh