Skip to content

Geometric Search

David Garfinkle edited this page Feb 25, 2020 · 14 revisions

The search algorithm thinks of notes as two-dimensional points, where the X axis is a note's offset (measured in quater notes) and the Y axis represents a note's chromatic pitch.

For example, an excerpt from Schubert's Der Leiermann is shown first in sheet music, then its two-dimensional reduction.

Now consider "Query A", a monophonic line we'd like to investigate.

As a pointset, it looks like this:

The search algorithm will find an occurrence of Query A where the 2-D pointset can be translated up / down or stretched in / out, so that the Query A pointset lines up in the Der Leiermann pointset.

Because these pointsets are only two-dimensional, the duration of the query is ignored when finding occurrences. The only effect a note's duration has is to delay the offset of a subsequent note.

For example, check out the queries on the right hand side:

Each query is found in the piece on the left hand side, with the occurrence outlined by purple arrows.

The six queries arise from transformations on a single model (A): first, we remove one note (B); then, we augment the rhythm (C); then we augment the rhythm and remove a note (D); then we warp the rhythm (E); then we warp the rhythm and remove a note (F). Notice that, even though the final note of the queries (right hand side) doesn't have the same duration as the final note in the matched occurrence (left hand side), it will still find an occurrence because notes are 2-dimensional objects: duration is ignored.

The search algorithm will find anything like the bottom right corner: notes are missing, and the rhythm is warped. Also, chromatic transpositions are allowed too. You can then use the filters to refine what you're looking for.

Clone this wiki locally