How? De Bruijn Sequences.
This is a script that will produce a de Bruijn sequence as an ABC music file.
Usage:
python de_bruijn_seq.py <k> <key> <notes>
Example: generate an exercise containing all 3-mers that can be formed from a pentatonic scale.
python de_bruijn_seq.py 3 C C D E G A c
Then, eg, paste the result into the ABC Convert-A-Matic.
Result: exercise.pdf
Turning some dials up to eleven: eleven.mp3 twelve.mp3