Author: dandersen

Voice Roles, Part I

This module explores the roles of the different parts in four-voice Baroque counterpoint. This module uses the music21 library. J. S. Bach’s chorales are often used as a model for musical textures with four voices. The voices are perceived as independent from one another through the unique roles they take on in the composition. By […]

Viewing Notation

This brief tutorial module explains how to view notation in the music21 environment. After you install music21, you must configure it for your system. As part of this process, you must install or specify a software program to display notation in the MusicXML format. The instructions for this configuration process are included as part of […]

Key Signatures

This module explores the relationship between keys and key signatures. In musical notation, different musical keys are represented by patterns of sharps and flats on the staff called key signatures. The relationship between keys and key signatures is illustrated through a diagram called the circle of fifths: In the circle of fifths above, major keys […]

Markov Melodies

This module will show you how to make music using Markov chains. If you’re not familiar with Markov chains, this page gives a great, interactive introduction. The basic idea is that we can input melodies of a certain style, and our model will output similar melodies that reflect that style. First, start up Python and […]

Transposition Functions

This module builds on the Transposition module by illustrating how to create transposition-related functions. In the previous module, we covered how to identify how two melodies were related by transposition. In this module, we’ll create a few transposition-related functions. Let’s start out with a function to transpose a given melody. We’ll use the motif from […]

If Statements (Python)

This tutorial module covers conditional if…else statements in Python. In Python, we use if to determine whether a certain condition has been satisfied. The if statement establishing the condition is aligned to the left, and the operation dependent on the condition is indented: We can use the keyword “elif” (short for “else if”) to add […]

Skips and Steps and Style (and Chords)

This module builds on the previous Skips and Steps and Style module. In the previous module, we counted the skips and steps in Maple Leaf Rag, a piano composition by Scott Joplin from the late nineteenth century. Here’s a summary of our work so far (see the previous module for the code for the count_skipstep […]

Finding Examples

This module will help you find musical examples to study or use in the classroom. This page gives an overview of the files included in the music21 corpus. Click here for help importing files, or click here once you have a file imported to extract specific parts. MusicXML is an emerging standard for digital notation […]

Skips and Steps and Style

This module explores the prevalence of melodic skips and styles in different styles of music. It builds directly on the techniques covered in the Skips and Steps module. In the previous module, we established that melodic steps are significantly more prevalent than skips in the Kyrie of the Pope Marcellus Mass: While in the previous […]

Skips and Steps

The module introduces the concept of melodic skips and steps. This module uses the music21 library. Skips and steps refer to the distance, or interval, between two notes in a melody. Most melodies are made up of a combination of steps (short distances or small intervals) and skips (large distances or wide intervals). Many musical […]