select

patterntools.select(indices=None, inverted=None)

Makes pattern that matches indices.

Selects index 2:

>>> pattern = patterntools.select([2])
>>> print(format(pattern))
patterntools.Pattern(
    indices=[2],
    )

Selects indices 2, 3 and 5:

>>> pattern = patterntools.select([2, 3, 5])
>>> print(format(pattern))
patterntools.Pattern(
    indices=[2, 3, 5],
    )

Returns pattern.