summaryrefslogtreecommitdiff
path: root/tran/quantize.alg
diff options
context:
space:
mode:
authorSteve M. Robbins <smr@debian.org>2011-10-22 04:54:51 +0200
committerSteve M. Robbins <smr@debian.org>2011-10-22 04:54:51 +0200
commitdd657ad3f1428b026486db3ec36691df17ddf515 (patch)
tree6ffb465595479fb5a76c1a6ea3ec992abaa8c1c1 /tran/quantize.alg
Import nyquist_3.05.orig.tar.gz
[dgit import orig nyquist_3.05.orig.tar.gz]
Diffstat (limited to 'tran/quantize.alg')
-rw-r--r--tran/quantize.alg11
1 files changed, 11 insertions, 0 deletions
diff --git a/tran/quantize.alg b/tran/quantize.alg
new file mode 100644
index 0000000..fc268bd
--- /dev/null
+++ b/tran/quantize.alg
@@ -0,0 +1,11 @@
+(QUANTIZE-ALG
+ (NAME "quantize")
+ (ARGUMENTS ("sound_type" "s1") ("long" "steps"))
+ (INTERNAL-SCALING s1)
+ (START (MIN s1))
+ (STATE ("double" "factor" "s1->scale * steps; scale_factor = (sample_type) (1.0 / steps);"))
+ (INNER-LOOP "register long xx = (long) (s1 * factor); output = (float) xx;")
+ (TERMINATE (MIN s1))
+ (CONSTANT "factor")
+ (LOGICAL-STOP (MIN s1))
+)