Easy Hard Clip (Max Value) of Accumulator

Software questions and issues with the FV-1

Moderator: frank

Post Reply
thegrinch
Posts: 3
Joined: Tue Jun 27, 2017 8:07 pm

Easy Hard Clip (Max Value) of Accumulator

Post by thegrinch »

Hi, I am looking for a way to easily clip the accumulator at a maximum value (e.g. if(accum > .5){accum = .5}; kind of thing). The MAXX instruction does this nicely for clipping the accumulator to a minimum value, but there is not an accompanying MINX instruction (would have been nice!).

I'd imagine people have found the fastest way to do this by this point, so I wanted to ask for y'all's solutions to the problem. Trying to keep the instruction count required to accomplish this as low as possible.

Thanks!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

If 0.5 is the actual desired clip value and the value is in ACC then try something like:

sof -2.0,0
sof -0.5,0
Frank Thomson
Experimental Noize
thegrinch
Posts: 3
Joined: Tue Jun 27, 2017 8:07 pm

Post by thegrinch »

Okay. I assume that is using the fact that the maximum range of the accumulator is +.9999389 to -1.0?
Post Reply