Advanced Sheet Music Tutorial: Searching interval sequences

(version 08_02_2022)

This tutorial introduces the search of interval sequences based on CAMAT (Computer-Assisted Music Analysis Tool).

Working through the tutorial should enable you to search for interval sequences in your own music examples (sheet music files).

First, a note file must be selected for the search, loaded and designated with a variable name (here: 'xml_file'). We choose a composition by a composer who is famous for the use of motives: Ludwig van Beethoven. We select the first movement of the String Quartet Op. 18, No. 1.

The following command generates a search query and then displays a list of results. The interval sequence searched for is specified in semitone steps; the individual interval steps are separated by a comma.

For example: search for three tones in a sequence of two ascending major seconds (whole tones)

interval=[2, 2]

Second example: search for three tones, a major third up followed by minor second (semitone) down.

interval=[4, -1]

In the Beethoven score, we want to search for the initial motive F G F E F C. How often and where exactly does it appear in the further course of the movement? Expressed in semitones, the motive consists of the following sequence of intervals:

interval=[2, -2, -1, 1, -5]

As expected, the motif occurs most frequently with the initial note F - 14 times.

ATTENTION: -1 stands for a b-sign, 1 for a #-sign, 0 for a resolution sign, -2 for a double bb, and so on. This means:

With 'return_details=False' only the frequencies of the searched interval sequence related to different starting tones are displayed.

The output can be refined by the parameter 'return_details=true'. Then not only the frequencies are displayed, but the exact instances: in which voice, with which starting note, in which measure and at which beat (LocalOnset). The column 'Onset' refers to the order of all notes in the piece.

The motif always starts at the beginning of a bar (LocalOnset 1.0) and is never shifted to other metric positions. It would be shifted, for example, if LocalOnset were 2.0 (on the second beat) or 1.5 (on the third eighth note).

A look at the score reveals that often not the whole motive but only the first five notes of the motive occur - followed not by a fourth, but by another interval. We therefore want to look for this shortened motive with the next command:

The shortened motive - without the leap of a fourth at the end or with a different following interval - thus occurs much more frequently and with nine different starting pitches: In total, it occurs 110 times!

Task

  1. Get a detailed list of the results and find the individual motives in the score of the string quartet. How often does the motive occur with the same rhythm as the initial motive? What do you think: what other results with a different rhythm can be identified as variations of the motive? What about the interval sequences that do not start at the beginning of the bar, but at a different position in the bar?

  2. Load the sheet music file of a composition of your choice, choose a concise motive - e.g. the main theme at the beginning - and, then, check whether and how often the motive appears in the further course of the piece.