Mercurial > hg > silvet
comparison 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 |
comparison
equal
deleted
inserted
replaced
11:f268212ac499 | 12:0f6db1895e1c |
---|---|
1 | |
2 program silvet; | |
3 | |
4 { prepareTimeFrequency } = load timefreq; | |
5 { loadTemplates } = load templates; | |
6 | |
7 mat = load may.matrix; | |
8 vec = load may.vector; | |
9 | |
10 templates = loadTemplates (); | |
11 | |
12 eprintln "we have \(length (keys templates)) instruments:"; | |
13 for (sort (keys templates)) eprintln; | |
14 eprintln ""; | |
15 | |
16 columns = prepareTimeFrequency "test.wav"; | |
17 | |
18 chunkSize = 100; | |
19 height = if empty? columns then 0 else vec.length (head columns) fi; | |
20 | |
21 chunkify cols = | |
22 if empty? cols then [] | |
23 else | |
24 (mat.resizedTo { rows = chunkSize, columns = height } | |
25 (mat.fromColumns (take chunkSize cols))) | |
26 :. \(chunkify (drop chunkSize cols)); | |
27 fi; | |
28 | |
29 chunks = chunkify columns; | |
30 | |
31 eprintln "we have \(length chunks) chunks of size \(mat.size (head chunks))"; | |
32 |