Mercurial > hg > silvet
view testdata/scripts/convert_svout.yeti @ 339:bcfdaa708992 livemode
Threshold of 5 is definitely better than threshold 6 for piano... but I'm still unpersuaded about the advantages of even lower thresholds -- need to go over this again
author | Chris Cannam |
---|---|
date | Tue, 30 Jun 2015 09:38:12 +0100 |
parents | 51c18a17404a |
children |
line wrap: on
line source
// Convert CSV file exported by Sonic Visualiser: // // onset,midinote,duration,level,label // // into lab file like those output from the test scripts: // // onset offset frequency program convert_svout; usage () = eprintln "\nUsage: convert_svout file.csv\n"; toFrequency m = 440 * Math#pow(2.0, (m - 69) / 12.0); convert f = (str = openInFile f "UTF-8"; for (str.lines ()) do line: case list (strSplit "," line) of onset::midinote::duration::_: println "\(onset)\t\((number onset) + (number duration))\t\(toFrequency (number midinote))"; _: failWith "badly formed line: \(line)"; esac; done; str.close ()); case (list _argv) of file::[]: convert file; _: usage (); esac;