PD help
Martin Naef
EMAIL HIDDEN
Tue Nov 15 16:40:22 CET 2011
On 15.11.2011 16:27, Marc Nostromo [M-.-n] wrote:
> I'm trying to do some basic stuff in Pd and it turns hairy. Right now
> I'm recieving a continuous signal that I restrict to 0 and 1's so my
> stream now looks like
>
> 00000111100010010011111100000000
>
> I would like to send a midi note on only when there's a change 0->1 &
> 1->0. Any idea on how to achieve that ?
It's been a while since I did this kind of thing in Max, but I remember
I had a similar issue when I wanted to filter out excessive data.
My idea would go along those lines:
Use a comparison operator that outputs a bang when left value != right value
The bang triggers your midi
The same bang also triggers an update of the right value in the
comparator (in a sort of feedback loop)
This works nicely because most operators only output when the left input
has changed, not the right one (or the other way around...). Otherwise,
a set X message usually works as well (it only sets the value, but
doesn't trigger)
How to store the last value to update the comparator? Use a value object
that receives your input data, but prefix the data message with a SET so
the value object doesn't output whenever it changes. Trigger the value
instead with the output of the comparator.
Does that help? It's hard to describe without having Max running in
front of me...
Martin
More information about the music-bar
mailing list