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 » Wed Sep 06, 2017 10:28 am

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: 991
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank » Wed Sep 06, 2017 11:22 am

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 » Sun Sep 10, 2017 11:09 am

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

Post Reply