Esempio n. 1
0
def absolute_pitches_permutation(cseg, psets_list):
    """Returns lists of absolute pitches permutations of a given cseg
    and a list of pitch sets permutations.

    >>> absolute_pitches_permutation(Contour([0, 1, 2]), [3, 4, 5])
    [[3, 4, 5], [3, 5, 16], [4, 15, 17], [4, 5, 15], [5, 15, 16], [5, 16, 27]]
    """

    permutted = utils.permut_list(psets_list)
    return [absolute_pitches(cseg, pset) for pset in permutted]
Esempio n. 2
0
def permut_csegs(cardinality):
    """Returns a list of possible normalized csegs of a given
    cardinality. Cseg are output as lists.

    >>> permut_csegs(3)
    [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
    """

    base = range(cardinality)
    return utils.permut_list(base)