The imitation filter identifies modal melodic repetition between voices.

The imitation tool identifies repeated interval patterns between voices. The following example demonstrate the results from the tool for the opening two voices of the first fugue from J.S. Bach’s Well-tempered Clavier, Book I (BWV 846).

Try changing pitches in the textual music on the left to see how the matches change.

Imitation summary

Beneath the first note of each imitation pair, a text string gives four pieces of information about the imitation. The four fields are separated by colons, and each value is prefixed by a letter:

prefix parameter meaning
n A unique enumeration ID for each imitation pairs within the score, starting at 1.
c The note count in each the imitation pairing.
d The distance (duration) between the first note in each imitation pair. A positive value means that the imitation occurs after the current sequence, while a negative value means that the other imitation sequence comes before the current sequence.
i The imitation interval in diatonic steps. Positive values means the imitation in the other location is higher in pitch than the current sequence, while a negative value means that the paired sequence is at a lower pitch.

So the text under the first note in the above example (n1:c14:d6:i5) means that this is the first pair, where there are 14 shared notes (13 intervals), the imitation is at the fifth, and the distance between the sequence starts is 6 quarter notes.

Suppressing information

There are several options to modify the display of the match information. To completely suppress the matching information, use the -q option (meaning “quiet”):

The matches are still highlighted, but no textual information is added to the score. You can also selectively remove the n, c, d or i fields by adding the option -N, -C, -D or -I respectively. Here is an example of removing the count and distance and fields at the same time:

Information can be suppressed from the second sequence in the match by using the -f option, meaning give only the information on the “first” sequence in the pair:

The options --NN, --CC, --DD, and --II can selectively suppress match fields from the second match. Here is an example showing only the n field on the second pair of a match:

The -2 option is a shortcut for --CC --DD --II:

Adding information

The -m option can be used to add measure numbers to the match information, and -b can add the beat information. The beat information is actually in units of quarter notes (regardless of the meter), with the first beat of a measure labeled as beat “1”.

The -l (lower-case L), can be used to include the length of the matched sequence:

The length is prefixed by the letter L in the information string. In this case the length of both matches is 5.75 quarter notes.

Note count threshold

The -t option is used to set a threshold number of notes that must be matched. The default number of notes is 7. In the example music, there are 14 notes that match between the two fugal entrances, so if the threshold is set to 15, this pair will not be identified:

But setting the threshold to 14 will result in a match:

Maximum distance between imitation

The -d option can be used to limit the distance (duration) between matches. This is useful for highlighting imitative entries while minimizing matching noise. By default, any duration between matches is allowed. To limit the search distance between matches specify the maximum duration between pairs in units of quarter notes. Below is an example limiting the match distance to 4 quarter notes. Since the distance between the fugal entrances is 6 quarter notes, so no match is identified:

Increasing the minimum distance to 6 quarter notes or more will catch the imitation:

Imitation by pitch but not by rhythm

The -p option will consider only pitches when searching for matches, ignoring the durations of the notes. Here is an example match between two sequences that have the same notes in sequence, but the rhythms are different:

Matching inversions

The -v option can be used to match inversions. Here is an example where an upward and downward scale are matched to each other:

Notice that the enumeration number is prefixed by v to indicate that the imitation relation in an inversion. The interval value indicates the interval between the first pair of notes in the two sequences.

Adding the -a option to the -v option will search for both regular matches as well as inversion matches at the same time. Here is an example:

Each type of search will be given a different color (but only one color can be displayed when the match types overlap).

Selecting or avoiding parallel motion

The ‘-z’ option can be used to select only imitation that starts at the same time. This is an alias for -d 0:

The ‘-Z’ option will do the opposite: remove any imitation pairs that start at the same time: