October 1, 2013

CorpusDB: Corpus-based Processing for Python/SuperCollider

Available at http://github.com/kitefishlabs/CorpusDB. This is the Python implementation, intended to mirror CBPSC as much as possible.


Installation and use

The gist...

`anchorpath = os.path.expanduser("~/.../corpusdb/examples/1_simple_analysis\")
corpus = corpusdb.CorpusDB(anchorpath)

# create the full path and add the sound file
f = os.path.join(anchorpath, 'snd', '24940__vexst__amen.wav')
node = corpus.add_sound_file(filename=os.path.basename(f), tratio=1)

# a Node object is returned, in this case a Sampler Node, which has a sound file ID
sfid = node.sfid

# pass the full path, the ID, and the transposition ratio to the analysis function
corpus.analyze_sound_file(os.path.basename(f), sfid, tratio=1)
powers, mfccs = corpus.get_raw_metadata(sfid)
cut_list = findCutPoints(mfccs, powers)
for i, frame in enumerate(cutlist[:-1]):corpus.addsoundfileunit(sfid, onset=(frame0.04), dur=((cutlist[i+1]-frame)0.04))
# segment

# finalize internal data structures

Note that the findCutPoints function is not shown, but this is an algorithm that should take raw MFCC frame data and return a list of time points where segments begin.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket