Forums > MaxMSP

Newbie Question: edge~ and >=~

October 18, 2008 | 8:36 pm

I was reading the LFO tutorial, by gtaylor, and wondered why he used 0.5>=~ to mark the beginning of a cycle. Why doesn’t he use 0.0? I thought that a cycle begins on the o mark. Might be a stupid question but I feel that the help file and ref file doesn’t explain this so well.


October 19, 2008 | 2:59 am

Hopefully I’m looking at the same thing and you are basically referring to the "p wave_select" subpatcher. In the case of the ramp, the ramp signal is running(at that point) from -1 to 1(keep that in mind: the ramp no longer starts at 0 and goes to 1 but rather, starts from -1 and goes to 1). So a ">=~ 0.5" will detect when the ramp resets from 1 all the way down to -1 and change it’s output of a "1" to a "0" at that very point. The edge~ object below this will then output a bang from it’s right-outlet because this is the "non-zero to zero" transition to which that right-outlet of edge~ applies. It’s just one clever way of outputting the bang at the beginning of the ramp by focusing on the point-of-change(as opposed to focusing on a single value, focusing on a single-value at sample-rate when translating over to event-rate isn’t always the most accurate; Gregory’s method ensures accuracy).

Basically, he couldn’t use 0.0 because the ramp starts at -1(he also couldn’t use ">=~ -1." because then the >=~ object would output a 1 the whole entire ramp no matter what).

He could also use the "delta~" or the "change~" object but then he’d still need a "< ~ 0." object in between that and "edge~" so his method is also more efficient.

Hopefully, Gregory himself will chime in as well since my explanations can get a bit convoluted(if they are, sorry about that).


October 21, 2008 | 10:58 am

Often [>=~ 0.5] is used rather than [>=~ 0.] because if we are not sampling at the signal rate then (scheduler rate) then often the 0. sample is missed and doesn’t trigger a change.

If we check at 0.5 then there is equal change for a sample to be above or below that point. I think this is mentioned in the tutorials somewhere.


October 21, 2008 | 1:06 pm

> Basically, he couldn’t use 0.0 because the ramp starts at -1(he also couldn’t use ">=~ -1." because then the >=~ object would output a 1 the whole entire ramp no matter what).

>> If we check at 0.5 then there is equal change for a sample to be above or below that point.

Our last two interlocutors are absolutely correct,
but I always particularly appreciate being mistaken
for a clever person.


Viewing 4 posts - 1 through 4 (of 4 total)