Hi,
I had my first good, solid 3-hour stint with pd
yesterday. I've got to say -- it is, to me, a much more creative
experience that programming in a traditional environment.
Here's my current goal:
I'm trying to enhance the functionality of 2
simultaneous M-Audio Oxygen8s by making the pitch-wheel of each a
"meta-controller" - in other words, I want to use the pitch wheel of
each to control how the unit controls things.
When I "bump the top" of the pitch-wheel range, I
want the MIDI Channel for that Oxygen8 to increase by one, and when I "bump
the bottom" of the pitch-wheel range, I want the MIDI Channel for that Oxygen8
to decrease by one.
Also, the units must act completely independently
of one another.
Here's what I've done so far to attain the
goal:
Created a subpatch that uses [ctlin],
[notein], and [bendin] to take in all the MIDI events I'm interested in, from
all physical controllers. Packed all this data, 7 integers
worth, into "midiBall" and sent it out. So far so good.
The main patch allows selection of the MIDI
channels that the initial data for each physical controller comes from.
(By default each physical controller transmits on channel 1, so that makes the
Ctrl1 listen channel "1" and the Ctrl2 listen channel "17"). Still coming
along great...
Here's where I run into trouble:
Created a subpatch to handle the incrementing and
decrementing of send MIDI channel, per controller, via the pitch wheels.
The pitchwheel has a control threshold: If the value is under 2000 then
send a "minus1" to the send channel amount for that controller. If the
value is over 14000 then send a "plus1".
The problem is, though, that I only want to send a
single "plus1" for the entire duration of time that the pitch bend value exceeds
14000. The pitch bend should not be eligible to send another "plus1" until
the value goes back below the threshold of 14000 and returns above it
again.
In effect, what's happening now is that the pitch
bend "bumps the top", but it increments the channel value 5, 10, 100 times
(since the threshold is past everytime the wheel value registers) when I
only want it to increment the value once.
As far as I can tell, here's the problem boiled
down:
I need to construct a logical mechanism that has a
threshold. If the threshold is passed, a *single* message is sent, and
another "passed threshold" message is not sent until the threshold is "unpassed"
and then crossed once again.
Thanks in advance for any insight, and thanks for
reading!!
rs