Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parsing essentia yaml export - find . -name "*.yaml" -exec node conv.js {} \;
yaml = require('js-yaml');
fs = require('fs');
try {
var doc = yaml.safeLoad(fs.readFileSync(process.argv[2], 'utf8'));
var nLine = process.argv[2] + ','
+ doc.metadata.audio_properties.length + ','
+ doc.rhythm.bpm + ','
+ doc.tonal.chords_changes_rate + ','
+ doc.tonal.tuning_frequency + ','
+ doc.tonal.chords_key + ','
+ doc.tonal.chords_scale
+ "\n";
console.log("parsing " + process.argv[2] + "done...");
fs.appendFile('1.csv', nLine, function (err) {
console.log(err);
});
console.log("writing " + process.argv[2] + "done, goodbye!");
} catch (e) {
console.log(e);
}
/**
* CSV file contains
* CSV file contains Nom,Duree,Bpm,Chords_changes_rate,Tuning_frequency,Chords_key,Chords_scale
*
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.