changeset 216:b251e1ab953d matrix_opaque_immutable

Update syntheticstream
author Chris Cannam
date Sat, 11 May 2013 11:58:18 +0100
parents c4f4e8def0aa
children 26111c11d8e4
files yetilab/stream/syntheticstream.yeti yetilab/stream/test/audiofile_reference.yeti
diffstat 2 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/yetilab/stream/syntheticstream.yeti	Sat May 11 11:46:44 2013 +0100
+++ b/yetilab/stream/syntheticstream.yeti	Sat May 11 11:58:18 2013 +0100
@@ -2,10 +2,9 @@
 module yetilab.stream.syntheticstream;
 
 ch = load yetilab.stream.channels;
-vec = load yetilab.block.fvector;
-block = load yetilab.block.block;
+vec = load yetilab.block.vector;
 
-load yetilab.block.blocktype;
+load yetilab.block.vectortype;
 load yetilab.stream.streamtype;
 
 generated sampleRate generator =
@@ -18,12 +17,12 @@
         get available () = Infinite (),
         get finished? () = false,
         read count = ch.deinterleaved 1
-           (result = vec.zeros count;
+           (result = new double[count];
             for [0..count-1] do i:
                 result[i] := generator (position + i)
             done;
             position := position + count;
-            block.block result),
+            vec.vector result),
         close = \(),
     });
 
@@ -37,7 +36,7 @@
     generated rate \0;
 
 precalculated rate data =
-   (n = block.length data;
+   (n = vec.length data;
     var position = 0;
     {
         get position () = position,
@@ -47,7 +46,7 @@
         get finished? () = not (n > position),
         read count = ch.deinterleaved 1
            (rc = min count (n - position);
-            result = block.rangeOf position rc data;
+            result = vec.rangeOf position rc data;
             position := position + rc;
             result),
         close = \(),
@@ -55,7 +54,7 @@
 
 {
     generated is number -> (number -> number) -> stream, 
-    precalculated is number -> block -> stream,
+    precalculated is number -> vector -> stream,
     sinusoid is number -> number -> stream, 
     whiteNoise is number -> stream,
     silent is number -> stream,
--- a/yetilab/stream/test/audiofile_reference.yeti	Sat May 11 11:46:44 2013 +0100
+++ b/yetilab/stream/test/audiofile_reference.yeti	Sat May 11 11:58:18 2013 +0100
@@ -3,7 +3,6 @@
 
 syn = load yetilab.stream.syntheticstream;
 filt = load yetilab.stream.filter;
-vec = load yetilab.block.fvector;
 block = load yetilab.block.block;
 
 pulseChannel rate =