[PD] Rotary controllers in PD?

Frank Barknecht fbar at footils.org
Mon Sep 10 10:28:49 CEST 2007


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]

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__




More information about the Pd-list mailing list