# HG changeset patch # User Chris Cannam # Date 1368269898 -3600 # Node ID b251e1ab953d54d14199670df2d93d14d7eb1c6e # Parent c4f4e8def0aa64e61c532001d569e854c3d90a58 Update syntheticstream diff -r c4f4e8def0aa -r b251e1ab953d yetilab/stream/syntheticstream.yeti --- 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, diff -r c4f4e8def0aa -r b251e1ab953d yetilab/stream/test/audiofile_reference.yeti --- 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 =