[Gridflow-dev] [#expr] (was: jMax)

Mathieu Bouchard matju at artengine.ca
Sun Sep 26 16:21:14 EDT 2010


On Sun, 26 Sep 2010, Jonathan Wilkes wrote:

> For some reason, [expr] has random, which takes two arguments, but no 
> rand.

That's because it's only based on functions that are already in GridFlow, 
and there is no such random() in GridFlow. I already fudged quite a few 
things in [#expr] though, so I might be able to fudge this one. At this 
point, the only ops I can import directly into [#expr] are the ones that 
already exist in [#]. Maybe it's just easier to add 'random' to [#].

> I noticed that [#expr] (i.e., with no args) doesn't create.

With the current grammar used by [#expr], empty expression doesn't parse. 
So I just set the expression "0" as the default args of [expr] when there 
are no args at all.

> If I do [#expr max(1,3)] and send a float to the inlet it crashes Pd. 
> (Same with other functions)

[#expr] without any $f1-style variables has an empty 'inputs' array 
but try to assign to inputs[0] anyway.

> What are rem, cmp

'rem' is [expr $f1 % $f2]
'cmp' is [expr $f1<0 ? -1 : $f1>$f2]

> c2p and p2c?

They never were in. It was a mistake. Those are 'vecops', which means that 
each of them take as inputs two pairs of numbers and output one pair. But 
[#expr] doesn't support grids yet, so, it didn't make any sense whatsoever 
to include them at this point.

> Seems like this is a bigger problem, because most of the time when I use 
> send/receive, IEMGUIs, or [value] in an [expr]-less context I am also 
> using $0-foo as the most common case.

It sounds like "$0-" would make a good default prefix, then, especially 
with the number of people using it (though a few people use different 
conventions).

> So I think your reasoning for not wanting $0 "in your face" in a complex 
> formula also extends quite naturally to Pd in general. Anytime I use [s 
> $0-a] I'd rather write [s a] and have it be local by default.

Yeah, but the way Pd is made, it's too late, we can't change this, or we 
have to change pd_bind and all the externals that use receive-symbols.

Then the only way out is to make individual solutions whenever "$0-" gets 
too annoying. For example, [receives] allows you to write something like 
[r $0-a] [r $0-b] [r $0-c] as [receives $0- a b c] which outputs symbol a 
or symbol b or symbol c by the right-outlet just before outputting the 
received message by the left-outlet.

see http://gridflow.ca/help/receives-help.png

I could be making more classes like that if you want.

  _______________________________________________________________________
| Mathieu Bouchard ------------------------------ Villeray, Montréal, QC


More information about the Gridflow-dev mailing list