def pc2key(c, pitches):
    """
    Given a pitch class vector, C, return the KEY associated.
    """
    key = 0
    for i, p in enumerate(pitches):
        if c[p-1] < c[p]:
            key += 1<<i
    return key