-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
My MIDI controller is an M-Audio Axiom 49. It has 8 "rotary controllers" which can output continuous controller messages. This may be my way out of the 4-bit hole, and allow me to control parameters in PD with finer than 128 discreet steps.
Are there any externals or internals in PD to handle these things? The Axiom manual states that each rotary controller can be configured in one of these ways:
2's complement from 64/Relative (Binary Offset)
2's Complement from 0 / relative (2's Complement)
Sign Magnitude / Relative (Signed Bit)
Sign Magnitude / Relative (Signed Bit 2)
Single Value Increment/Decrement
RPN Increment/Decrement Message
NRPN Increment/Decrement Message
I tried each of these and peeked at the MIDI stream to see what they do, and also at the output of PD's ctlin to see what might emerge. The "sign magnitude" and "2's complement" ones look pretty promising: they indicate which direction (up/down) and how fast you spin the thing.
Now, to turn those numbers into a float between -1 and 0 that I can use for controlling various parameters in PD. However, I'm getting old and lazy. I'm convinced that *someone* must have already solved this problem, and created an abstraction for using rotary controllers in PD. Google turned up hours worth of fascinating clicking, having nothing to do with what I was looking for.
So if anyone can point me to an example patch or docs for using rotary controllers in any of the above formats, in PD,, please let me know.
Hallo, Ken Restivo hat gesagt: // Ken Restivo wrote:
2's complement from 64/Relative (Binary Offset) 2's Complement from 0 / relative (2's Complement) Sign Magnitude / Relative (Signed Bit) Sign Magnitude / Relative (Signed Bit 2) Single Value Increment/Decrement
What does "Single Value Increment/Decrement" do? Sounds interesting as well and may save some work.
RPN Increment/Decrement Message NRPN Increment/Decrement Message
I tried each of these and peeked at the MIDI stream to see what they do, and also at the output of PD's ctlin to see what might emerge. The "sign magnitude" and "2's complement" ones look pretty promising: they indicate which direction (up/down) and how fast you spin the thing.
Assuming you get -1 and 1 for down and up and any positive number for speed, you can multiply both numbers to get a stream of single numbers. Then you just accumulate these numbers using the standard accumulator idiom:
| [+ ]x[f ] | [0\
(See the counting.pd tutorial that I posted on this list several times for details.)
Now, to turn those numbers into a float between -1 and 0 that I can use for controlling various parameters in PD.
I don't think this makes sense: What should 0 and -1 indicate? The rotary controller doesn't have any left and right borders that could be mapped to be -1 and 0. And I also don't think, mapping -1 to min and 0 to max speed makes sense either.
Frank Barknecht _ ______footils.org_ __goto10.org__
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, Sep 09, 2007 at 12:52:54PM +0200, Frank Barknecht wrote:
Hallo, Ken Restivo hat gesagt: // Ken Restivo wrote:
2's complement from 64/Relative (Binary Offset) 2's Complement from 0 / relative (2's Complement) Sign Magnitude / Relative (Signed Bit) Sign Magnitude / Relative (Signed Bit 2) Single Value Increment/Decrement
What does "Single Value Increment/Decrement" do? Sounds interesting as well and may save some work.
That one outputs one number for each step you turn it up, and a different number for each step that you turn it down. The faster you turn it, the faster those numbers come flying in to ctlin, but the numbers themselves do not change.
RPN Increment/Decrement Message NRPN Increment/Decrement Message
I tried each of these and peeked at the MIDI stream to see what they do, and also at the output of PD's ctlin to see what might emerge. The "sign magnitude" and "2's complement" ones look pretty promising: they indicate which direction (up/down) and how fast you spin the thing.
Assuming you get -1 and 1 for down and up and any positive number for speed, you can multiply both numbers to get a stream of single numbers. Then you just accumulate these numbers using the standard
What I actually get with the 2's complements and sign magnitude ones, is a single bit that tells me direction (up or down), and a 6-bit number that tells me basically the velocity at which I spun the knob.
accumulator idiom:
| [+ ]x[f ] | [0\
(See the counting.pd tutorial that I posted on this list several times for details.)
Thanks, will try.
Now, to turn those numbers into a float between -1 and 0 that I can use for controlling various parameters in PD.
I don't think this makes sense: What should 0 and -1 indicate? The rotary controller doesn't have any left and right borders that could be mapped to be -1 and 0. And I also don't think, mapping -1 to min and 0 to max speed makes sense either.
I wasn't being clear. Only some of the parameters I want to control have a range between -1 and 1. Others have different ranges (i.e. from 0 to Nyquist frequency, etc.). My point being, I'm eager to find a way to use these rotary controllers, to break out of the limitation of having to divide whatever range I am faced with, into 128 measly discrete steps.
Hallo, Ken Restivo hat gesagt: // Ken Restivo wrote:
On Sun, Sep 09, 2007 at 12:52:54PM +0200, Frank Barknecht wrote:
Hallo, Ken Restivo hat gesagt: // Ken Restivo wrote:
2's complement from 64/Relative (Binary Offset) 2's Complement from 0 / relative (2's Complement) Sign Magnitude / Relative (Signed Bit) Sign Magnitude / Relative (Signed Bit 2) Single Value Increment/Decrement
What does "Single Value Increment/Decrement" do? Sounds interesting as well and may save some work.
That one outputs one number for each step you turn it up, and a different number for each step that you turn it down. The faster you turn it, the faster those numbers come flying in to ctlin, but the numbers themselves do not change.
Cool, then I would use this setting for interfacing with Pd, using the accumulator approach I already mentioned. It's very easy then. You wouldn't even need to make a single number out of the input data, just accumulate the two numbers you get from the controller, but change them to be -1 and 1 for simplicity of the calculations.
What you get then is a single number that would grow by 1 every time you turn the controller one step right, and that would shrink by 1 every time you turn the controller one step left. Don't worry about it being in steps, that's how the controllers work, they are not completely analog, but still give quantized values.
Then you can do various things to that growing and shrinking number: You could use [clip] to clip it between two borders, or use [mod] or [%] to make it wrap around (note the difference both objects have when dealing with negative numbers). If you use for example [clip 0 1000] and want to get a number in the range 0-1 you just divide by 1000 and so on.
You can also put this into a little abstraction to make patching quicker:
[inlet] [inlet] | / | [clip 0 $1] | / [/ $1] | [outlet]
Frank Barknecht _ ______footils.org_ __goto10.org__