view yeti/silvet.yeti @ 12:0f6db1895e1c

Prepare the ground for cqt and templates
author Chris Cannam
date Fri, 21 Mar 2014 17:14:44 +0000
parents
children e15bc63cb146
line wrap: on
line source

program silvet;

{ prepareTimeFrequency } = load timefreq;
{ loadTemplates } = load templates;

mat = load may.matrix;
vec = load may.vector;

templates = loadTemplates ();

eprintln "we have \(length (keys templates)) instruments:";
for (sort (keys templates)) eprintln;
eprintln "";

columns = prepareTimeFrequency "test.wav";

chunkSize = 100;
height = if empty? columns then 0 else vec.length (head columns) fi;

chunkify cols = 
    if empty? cols then []
    else
       (mat.resizedTo { rows = chunkSize, columns = height }
           (mat.fromColumns (take chunkSize cols)))
        :. \(chunkify (drop chunkSize cols));
    fi;

chunks = chunkify columns;

eprintln "we have \(length chunks) chunks of size \(mat.size (head chunks))";