This module explains how to search for certain patterns in a music file.

In general, patterns are structures that occur several times. In music, there are many such patterns: melodic-rhythmic motifs, accompaniment figures, rhythms, chord progressions, and so on. Many of these patterns also occur in slightly (or more) varied forms, e.g. melodic motifs on other pitches and with additional tones, or accompaniment figures with harmonic variations.

Repetition and variation are two of the fundamental structural principles of music. Of great interest, therefore, is the question of how the principles of repetition and variation come into play in a composition, a genre, or in the work of a composer. Here it can be advantageous to automatically search for and identify certain patterns as well as to list or mark them in the musical text. In this context, one also speaks of Pattern Mining. This is demonstrated in the two tutorials using two compositions by Josquin and Beethoven:

Besides searching for identical cells/patterns, there are several options for a fuzzy search:

  • Search for interval sequences or for chromatic transpositions of a melody cell.
  • Search for diatonic transpositions (within a key, i.e. individual intervals are changed).
  • Search for variations where individual tones or intervals or duration values of the melody cell are changed.
  • Search for variations where additional tones are inserted or missing.

In music21 only the first of these fuzzy search possibilities can be realized reliably, whereby the path via transpositions must be chosen. It is described in the Jupyter_SheetMusic_Advanced_Part2_Beethoven (Jupyter notebook; html preview).
A search for interval sequences is possible with the CAMAT tool in a quite simple way, see module Advanced Note Analysis with CAMAT.

The input of the search query in music21 is entered as a melody cell in an easy to learn note syntax.

The output of the search results is given as a list (voice, bar and bar position as the beginning of the pattern searched for) or is labelled in the score, which can be viewed in part in the browser as well as in full via MuseScore.

The search is of course also possible within several pieces: A narrowing of the search corpus can be made according to various criteria, including composer, genre and period.

Search possibilities for melodic motifs in different music corpora are offered by the Themefinder by David Huron as well as by Musiconn Score Search of the Bayrische StaatsBibliothek.

The research projects Jazzomat Research Projects and Dig That Lick developed tools for online searching of the same and similar patterns in jazz improvisations (the Weimar Jazz Database and the DTL1000 Dataset): Similarity Search.

  • en/advanced1.txt
  • Zuletzt geändert: 2022/01/24 12:02
  • von andres_romero