view yeti/templates.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

module templates;

vec = load may.vector;

// Load instrument templates

instruments = [
    "bassoon",
    "cello",
    "clarinet",
    "flute",
    "guitar",
    "horn",
    "oboe",
    "tenorsax",
    "violin",
    "piano-maps-SptkBGCl"
];

loadTemplates () = mapIntoHash id
    do instrument:
        readFile "../data/\(instrument).csv" "UTF-8"
            do istr:
                array
                   (map do line:
                        vec.fromList (map number (strSplit "," line))
                   done (istr.lines ()));
            done;
    done instruments;

{
    loadTemplates
}