Unipolar to bipolar with a centre "dead spot"


#1

Hi
I'm sure I'm being really thick here. I am trying to make a small modification to the k-rate unipolar to bipolar converter. I'm using a single pot to send +ve and -ve CV to a filter and wanted a "dead zone" in the middle where nothing gets sent.
I thought this would work:

knob = (inlet_i-(1<<26))<<1;
(knob<3 && knob>-3) ? outlet_o=0 : outlet_o=knob;

knob is declared as a float. The first line is taken directly from the unipolar to bipolar object.
I get exactly the same behaviour as the original object.... no dead zone
Any help much appreciated!
Paul


#2

I would declare knob as an integer and then shift the 3 so that it translates to a 3 on the dial.

As in:

knob<(3<<21)

Hope that makes sense!


#3

Hi
You are a genius! It's because of the integer arithmetic that axo uses. I was thinking the numbers in the object were those as displayed in the disp objects. My bad!
Cheers!!!
Paul