changeset 62:11933d198ad0

Merge
author Chris Cannam
date Fri, 11 Jan 2013 16:48:19 +0000
parents 6ce0ffdc7b00 (current diff) bf25c6d663d2 (diff)
children c4d74b8e1f13
files vamp.yeti
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/vamp.yeti	Fri Jan 11 16:38:56 2013 +0000
+++ b/vamp.yeti	Fri Jan 11 16:48:19 2013 +0000
@@ -122,7 +122,7 @@
     get preferredStepSize () = p#getPreferredStepSize(),
     get minChannelCount () = p#getMinChannelCount(),
     get maxChannelCount () = p#getMaxChannelCount(),
-    initialise { channels, blocksize, hop } = p#initialise(channels, blocksize, hop),
+    initialise { channels, blocksize, hop } = p#initialise(channels, hop, blocksize),
     reset () = p#reset(),
     get outputs () = array (map outputDescriptor p#getOutputDescriptors()),
     process blocks time is 'a -> ~RealTime -> 'b = 
@@ -133,9 +133,6 @@
 
 featuresFromSet outputNo f = if outputNo in f then f[outputNo] else [] fi;
 
-converted outputNo fl =
-    map (featuresFromSet outputNo) fl;
-
 outputNumberByName p name =
    (outputs = p.outputs;
     index (head (find ((== name) . (.identifier)) outputs)) outputs);
@@ -155,17 +152,21 @@
             [rf]);
     esac;
 
+converted { p, sampleRate, hop } outputNo fl =
+    map (featuresFromSet outputNo) fl;
+
 process key output stream =
    (p = loadPlugin stream.sampleRate key;
     blockSize = p.preferredBlockSize;
     hop = p.preferredStepSize;
     outputNo = outputNumberByName p output;
-    if p.initialise { channels = 1, blocksize = blockSize, hop } then
-        converted outputNo
-           (processed
-            { p, sampleRate = stream.sampleRate, hop } 
-            (fr.frames { framesize = blockSize, hop } stream)
-            0);
+    params = {
+        p,
+        sampleRate = stream.sampleRate, channels = 1,
+        framesize = blockSize, blocksize = blockSize, hop
+    };
+    if p.initialise params then
+        converted params outputNo(processed params (fr.frames params stream) 0);
         // If processing completed successfully, then p is disposed by
         // processed and stream is closed by the framer
     else