[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] pkey resolution



There's a distinction between operators that get promoted into patterns, e.g.

Pkey(\x) + 1 turns into Pbinop('+', Pkey(x), 1)

... and other operations that have to be done as a function. Env.new().asArray instantiates an object, then converts it into an array, which is very different from the way a math operator applied to a pattern turns into a unary, binary or n-ary op pattern.

hjh


On Jul 26, 2009, at 7:28 AM, Tim Blechmann wrote:

hi all,

i have some troubles accessing event keys via Pkey, when generating an
envelope:

p = Pbind(
\a, Pwhite(1, 10, inf),
\b, Pwhite(1, 10, inf),
\c, Env.new([0, 1, 0],
                    [Pkey(\a), Pkey(\b)]
                   ).asArray
\c2, Pfunc({|e| Env.new([0, 1, 0],
[e[\a], e[\b]]).asArray}, {})
).asStream;

in this case, Pkey isn't resolving the symbols for \c. in order to
resolve the symbols, i need to wrap it into a Pfunc pattern (like \c2).

i am curious, why is this the case?


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman