Skip to content

Instantly share code, notes, and snippets.

@tatecarson
Created November 18, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatecarson/feeba9e8f48b998e7e02a3391429fb41 to your computer and use it in GitHub Desktop.
Save tatecarson/feeba9e8f48b998e7e02a3391429fb41 to your computer and use it in GitHub Desktop.
(
{
~files.do{|filename,i|
[i, filename].postln;
e = SCMIRAudioFile(filename, [[MFCC, 13], [Chromagram, 12]]);
e.extractFeatures();
e.extractOnsets();
e.save(~scmirPath ++ (filename.splitext[0].basename++".scmirZ"));
}
}.fork;
)
(//laod data
~loadAnalysis = {
~onsets = Dictionary.new;
PathName(~scmirPath).entries.do{
arg subfolder;
~onsets.add(
subfolder.folderName.asSymbol ->
Array.fill(
subfolder.entries.size,
{
arg i;
SCMIRAudioFile.newFromZ(subfolder.entries[i].fullPath);
}
)
);
};
};
~loadAnalysis.()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment