- Added "abs" function to DISCRETE_TRANSFORM

- Fixed a bug in DISCRETE_RCDISC5
This commit is contained in:
Couriersud 2009-08-08 21:28:36 +00:00
parent 890ea90e32
commit 5a0fd74a12
3 changed files with 5 additions and 2 deletions

View File

@ -833,8 +833,7 @@ static DISCRETE_STEP( dst_rcdisc5)
diff = u - node->output[0];
if(diff < 0)
//diff = diff - (diff * exp(discrete_current_context->sample_time / context->exponent0));
diff = -node->output[0] + (node->output[0] * context->exponent0);
diff = diff * context->exponent0;
node->output[0] += diff;
}
else

View File

@ -1680,6 +1680,9 @@ static DISCRETE_STEP(dst_transform)
case 'P':
dst_transform_push(trans_stack, &trans_stack_ptr, top);
break;
case 'a': /* absolute value */
top = fabs(top);
break;
case 'i': /* * -1 */
top = -top;
break;

View File

@ -1650,6 +1650,7 @@
* + - Pop two values from stack, add and push result to stack
* / - Pop two values from stack, divide and push result to stack
* * - Pop two values from stack, multiply and push result to stack
* a - Pop one value from stack, multiply -1 if less than 0 and push result to stack
* i - Pop one value from stack, multiply -1 and push result to stack
* ! - Pop one value from stack, logical invert, push result to stack
* = - Pop two values from stack, logical = and push result to stack