"""
tonality.py - Matrix representations of musical scores, corpara, and their tonality

Example: J. S. Bach's "Well Tempered Clavier" Books 1 and 2

2015, Michael A. Casey, Dartmouth College, Bregman Media Labs

License: 
Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
http://creativecommons.org/licenses/by-nc/4.0/
"""

import pylab as P
import numpy as np
import glob, sys, pdb
import bregman

try:
    import music21 as m21
except:
    print "Warning: music21 not installed, only loading .ascii files supported"

pc_labels = np.tile(['C','C#','D','Eb','E','F','F#','G','G#','A','Bb','B'],13)

def _report(reportStr):
    print reportStr
    sys.stdout.flush()

def extract_audio_chroma(flist, nSecs = 10, nSamps = 6):
    """
    Given a list of WAV files, extract chromagram features and stack
    Options:
        nSecs - how many seconds each sample lasts
        nSamps - how many samples to take from each file        