# HG changeset patch # User Chris Cannam # Date 1363641844 0 # Node ID ef650ce77237170fa2a4ecfda6f076bee84687a5 # Parent a52cb6cd7a024ac055b03e4cde5794748de58076 Start trying to adapt grids diff -r a52cb6cd7a02 -r ef650ce77237 vamp.yeti --- a/vamp.yeti Mon Mar 18 10:06:35 2013 +0000 +++ b/vamp.yeti Mon Mar 18 21:24:04 2013 +0000 @@ -129,7 +129,8 @@ fi; _: Curve (); esac; - elif od#sampleType != OutputDescriptor$SampleType#VariableSampleRate then + elif od#hasFixedBinCount and + od#sampleType != OutputDescriptor$SampleType#VariableSampleRate then Grid (); else Unknown (); diff -r a52cb6cd7a02 -r ef650ce77237 vamppost.yeti --- a/vamppost.yeti Mon Mar 18 10:06:35 2013 +0000 +++ b/vamppost.yeti Mon Mar 18 21:24:04 2013 +0000 @@ -1,5 +1,7 @@ module vamppost; +fmat = load fmatrix; + fillOneSamplePerStep config features = (fill' n pending features = case pending of @@ -42,12 +44,33 @@ concat features; esac; -structure type features = +structureGrid binCount features = + if empty? features then + fmat.constMatrix binCount 0 0; + else + fmat.generate + do row col: + features[col].values[row]; + done binCount (length features); + fi; + +structure data = + (type = data.output.inferredStructure; + features = + case type of + Grid (): concat data.features; + _: fillTimestamps data; + esac; + binCount = + case data.output.binCount of + Fixed n: n; + _: 0; + esac; case type of Curve (): // No duration, one value Curve features; Grid (): // No duration, >1 value, not variable rate - Grid features; + Grid (structureGrid binCount (array features)); Instants (): // Zero-valued features Instants features; Notes (): // Duration, at least one value (pitch or freq) @@ -58,13 +81,12 @@ Segmentation features; Unknown (): // Other Unknown features; - esac; + esac); postprocess data = case data of OK data: - filled = fillTimestamps data; - structure data.output.inferredStructure filled; + structure data; Error e: Error e; esac;