# Function 1/x

#1

I am trying to think of a way to perform the function 1/x on a signal.

So if a value of 0.5 goes into the chain, 2 comes out. Or 0.3333 in outputs a ~3.

Any ideas how to construct such a chain?

0 Likes

#2

Weird, this should be super easy, but it’s obviously not!

Is subtraction possible?

If so then you can count the number of times you need to subtract the incoming value before you reach 0.

``````1 - 0.5 = count 1
0.5 - 0.5 = count 2
``````

Seems really inefficient though and I am not even sure it is possible. I can’t think of any other way of doing it.

0 Likes

#3

Interesting idea but not sure it would meet my needs. Currently trying to create a LUT for use in a sample scanner as @Starthief described in another post. I think that might work but I was hoping to do it more “natively”.

0 Likes

#4

Yeah, that could work, though not exactly cpu friendly for such a simple operation

I think @odevices is the only one who can remedy this in a sensible way; I would love to hear of any other ideas though.

I have the feeling we are pretty much out there on our own with these things at the moment…

Has anyone else written anything in the middle layer? We would love to hear from you

0 Likes

#5

I have nothing useful to add but I would second the request for more native logic / math ops.

1 Like

#6

yes, that’s what i was asking for in my “low level units” thread.
an efficient way to do simple math and\or trigonometry on signals.
i can now do multiplication, addition, division by integers (rational vca), power^, i think subtraction if we keep a signal, put it in a mixer channel and put a bipolar vca with -1 as gain, but not really sure if that is correct…

0 Likes

#7

The sample scanner with a transfer function crafted in a spreadsheet -> Audacity worked.

I ended up with abs(1/x)/1000 for 2001 values ranging from -1.000 to 1.000. Zero had to be hand-set, obviously. Then in the 301 it has to go out to a VCA, gain = 1000.

3 Likes

#8

Wait. The rational VCA should be able to do this, shouldn’t it.

EDIT: Looks like it can’t, if the divisor is fractional. Thought I might be able to edit the control (which you can) but the result seems to indicate that internally it’s still using a divisor of 1 for fractional values.

0 Likes

#9

i did not test it like you did but i was guessing it behaved like that given that its intended use is to do perfect, integer div\mult.
maybe @odevices can make us a frac\float version?
or is it something you can try to hack in lua @Joe?

also: i’m not in front of my rig now, but is the div modulatable? i mean, we can route a signal to it?

0 Likes

#10

You can modulate the denominator but it appears to only process integers.

There’s no divide object in the middle layer that I have found, so my next “hack” was going to be to use the sample scanner as a transfer function in the middle layer. To achieve the 1/x function needed for a unit I’ve been working on.

1 Like

#11

yeah, given the course my units have taken that would be handy for me as well!

0 Likes

#12

What is this for?

0 Likes

#13

well, in my case it would be a very useful tool to implement formulas or expressions i can use on the signal

0 Likes

#14

Hehe. That is a given. I was hoping for a more specific example.

0 Likes

#15

It’s a secret a the moment, perhaps @Joe will tell you in a PM, but I warn you it’s a head wrangler

0 Likes

#16

To avoid being too specific until I’m ready, I’ll be very specific. I need it to set a gain block on a signal into Slew Limiter’s time parameter.

1 Like

#17

After working through this, by the way, I can see why there is no divide type function outside of what you can do with the rational VCA. In a system like this you would encounter trying to divide by zero all over the place, so a bit of a trap.

I think using the sample scanner with a hand made transfer function will work for my purposes here.

3 Likes

#18

Automatic gain control (AGC)?

1 Like

#19

Yes, a feedback control system.

1 Like

#20

Are bitshift and bitwise math operators available? Binary division can by performed using a “shift and subtract” method.

2 Likes