Courses mixing computation and the arts or humanities are usually marketed as “applied.” Students take what they learn in computer science and use it to discover something new about music, literature, or history. But what if the application actually happens in reverse? What if taking a Python-based music class teaches and reinforces fundamental computation and CS skills?
For over a decade, I taught just such a course using the open-source Python toolkit music21. Students wrote Python code to compose their own pieces and to study music ranging from Bach to today’s pop. (And, of course, part of this talk will show how you can too!)
Python’s ease of use and its ecosystem of interactive tools, including Jupyter, make it possible to hear music and see musical notes immediately, turning code and choices of algorithms into results students can understand and revise on the spot. Solving musical problems such as building chords or locating key changes gives life and meaning to abstract concepts such as breadth-first search and divide-and-conquer strategies. Composition and coding with recursion become two sides of the same coin. Ideas that once felt abstract or fuzzy become concrete and experienced.
By sharing how Python and music, including music21, can create reusable classroom patterns, this talk will give teachers and learners, including self-learners in any area, the confidence and skill to use applied Python projects as paths to a deeper understanding of algorithms and computer science.