Esempio n. 1
0
def fromSong(song, cut=util.CUT, p=None):
    p = Probability()
    p.addSong(song, cut)
    h = []
    for part in song.parts:
        if len(part.flat) > cut:
            h.append(calculate(part, p))
    return h
Esempio n. 2
0
def main():
    filename = sys.argv[1] if len(sys.argv) > 1 else util.FAKE_FILE
    song = converter.parse(filename)
    p = Probability()
    p.addSong(song)

    h = fromSong(song, p=p)
    print(h)
    log.info("%d parts.", len(h))

    h = mean(p)
    print(h)