Skip to content

Pattern: PFilterByKey

Filter notes based on their presence in .

IF a note is not in , None is returned instead. To compress the output and remove rests, use PCollapse.

Example output

>>> p = PFilterByKey(PSeries(0, 1), Key("C", "major"))
>>> p.nextn(16)
[0, None, 2, None, 4, 5, None, 7, None, 9, None, 11, 12, None, 14, None]