A prefix tree-based user interface for exploring abstract structure in Irish folk tunes

by James McDermott

When writing a tune, when do composers repeat some material; when do they introduce a variation of previous material; and when do they introduce totally new material? To ask the same questions in a different way: what are the abstract syntactical structures in melodies?

11 August 2023

by James McDermott

When writing a tune, when do composers repeat some material; when do they introduce a variation of previous material; and when do they introduce totally new material? To ask the same questions in a different way: what are the abstract syntactical structures in melodies?

In 2020, composer, musicologist, and traditional Irish fiddle player Seán Doherty (Dublin City University) set out to answer these questions in the context of Irish traditional music. He used “the bible”, O’Neill’s The Dance Music of Ireland: 1001 Gems as his source.

Figure 1: O’Neill’s The Dance Music of Ireland: 1001 Gems (title page and extract from page 1, showing 4 tunes)

Doherty developed a simple system for analysing repetition and variation in these tunes, working at the bar level. We’ll explain it using the first tune, Shandon Bells, as an example.

In these tunes there are usually 2 or 3 main parts, of 8 bars each, usually repeated, possibly with alternate endings for each repeat. Shandon Bells has 2 parts, labelled A and B above.

In the repetition/variation annotation system, the first bar is labelled a as shown above. (These letters A and a are part labels and bar labels, not musical notes.) Then for each subsequent bar:

  • If it’s the same or almost the same as a previous bar, it gets the same label.
  • If it’s similar to a previous bar (50% or more, or a transposition), it’s labelled as a variation, eg a1, as in bar 3 above.
  • Otherwise, it gets the next sequential letter, eg bar 2 above is labelled b.
  • If a bar is similar to a bar in a previous part, the label is prefixed with the part name, eg bar 7 in part B is labelled Ad.

With this system, Doherty annotated all 1001 Gems. He found for example the following structures (focussing just on the A part in each case):

We observe that multiple tunes, even quite different ones, can share the same abstract syntactical structure (eg Johnny’s Wedding and Lough Allen, above). Doherty went on to analyse several different types of structure and their frequency in different tune types, eg jigs and reels.

At this point, Doherty contacted James McDermott (University of Galway), the leader of Polifonia Work Package 3 (on Mining Musical Patterns), and McDermott brought in Kieran Jayes, a student in University of Galway. As computer scientists, McDermott and Jayes were keen to introduce an appropriate data structure and user interface to explore the analyses produced by Doherty.

In collaboration, then, we began by observing that of course all structures start with a by definition, but more importantly there is a prefix structure: every pair of tunes shares some prefix, for example Shandon Bells and The Pipers’ Picnic share a, b before they diverge. This suggests the prefix tree or trie data structure. This is a tree where every node label is a prefix of the labels of its children. For example, in Figure 2, we see that node a has a child a, a1, and that child has a child labelled a, a1, a2. However, when we visualise all 1001 tunes in a prefix tree, it quickly becomes unwieldy (Figure 3).

Figure 2: an extract of the prefix tree, showing the root node a at the left-hand side.

Figure 3: the full prefix tree, with the root node a at the top, showing all 1001 Gems.

We decided to base the user interface on visualising and exploring that data structure in a more manageable way. Using Firebase, Node, Typescript, React, and D3, Jayes created an online user interface in which the user can expand and collapse levels of the tree, filter and search (Figure 4). The nodes in the final level of the tree are now labelled with tune names (Figure 5), which can be clicked to access a score and audio rendering (Figure 6).

Figure 4: the control bar allows the user to expand or collapse levels of the tree, and to filter and search.

Figure 5: the nodes in the final level are labelled with tune titles.

Figure 6: clicking a tune title leads to a score and audio rendering.

Exploring this user interface we find interesting results, such as structures which are unique across the corpus (eg Petticoat Loose is the only tune with structure a, b, a, c, a, d, e, c1,  see top of Figure 5) and others which are extremely common (eg there are 89 tunes with structure a, b, c, d, a, b, c, f).  

The user interface is available at: https://fyproject-98a82.firebaseapp.com/ and necessary data files are available at: https://gist.github.com/jmmcd/7fefb0fea2a4d00d74f6a3a8eaab81cf

This work was presented at the HCI International 2023 Workshop on Interactive Technologies for Analysing and Visualizing Musical Structure, Sunday 23 July 2023, Copenhagen, Denmark https://2023.hci.international/W1.html. The workshop organiser was David Meredith. The full programme is available at: http://www.titanmusic.com/events/hcii2023/workshop/accepted-papers/hcii2023workshopprogramme.html

Kieran Jayes, School of Computer Science, University of Galway

Seán Doherty, School of Theology, Philosophy, and Music, Dublin City University

James McDermott, School of Computer Science, University of Galway

Recent News

Last year, the Polifonia project and new ways of engaging with our musical past were introduced to audiences of all ages during the European Night of the Researcher. This year, the Polifonia team looks forward to returning to this colorful event!

Last year, the Polifonia project and new ways of engaging with our musical past were introduced to audiences…

21 September 2023

The MEETUPS pilot  focuses on supporting music historians and teachers by providing a Web tool that enables the exploration and visualisation of encounters between people in the musical world. A new demo video gives a sneak peak into the interface.

The MEETUPS pilot  focuses on supporting music historians and teachers by providing a Web tool that…

18 September 2023

This year, Europeana’s annual conference puts all things tech in the spotlight, with EuropeanaTech 2023 – Explore, Engage, Experience: cultural heritage in the data space and beyond led by the experts, developers and researchers from the R&D sector who make up the EuropeanaTech community.

This year, Europeana’s annual conference puts all things tech in the spotlight, with EuropeanaTech…

13 September 2023

Do you want to learn more about pipe organs, but can’t wait for the ORGANS Knowledge Graph to be ready? On Nationale Orgeldag (National Organ Day), organs can be viewed, played and heard throughout the Netherlands.

Do you want to learn more about pipe organs, but can't wait for the ORGANS Knowledge Graph to be ready?…

7 September 2023

Last summer, the first version of the Polifonia Ecosystem was released. Now the project is ready to present an updated version with 22 datasets, 20 tools and 67 reports.

Last summer, the first version of the Polifonia Ecosystem was released. Now the project is ready to…

23 August 2023

by James McDermott

When writing a tune, when do composers repeat some material; when do they introduce a variation of previous material; and when do they introduce totally new material? To ask the same questions in a different way: what are the abstract syntactical structures in melodies?

by James McDermottWhen writing a tune, when do composers repeat some material; when do they introduce…

11 August 2023

How do you ensure that everyone can participate in musical activities? That’s the question the ACCESS is trying to answer and this Polifonia pilot is doing so by developing haptic devices in relation to music making. And by actively engaging users during workshops, as was the case at Milton Keynes International Festival 2023 (UK) last Sunday.

How do you ensure that everyone can participate in musical activities? That's the question the ACCESS…

28 July 2023

Polifonia is preparing for the 7th Polifonia Project Meeting. This face-to-face meeting will take place in Bologna from Oct. 16-20. 

Polifonia is preparing for the 7th Polifonia Project Meeting. This face-to-face meeting will take…

25 July 2023

Last weekend, Polifonia was part of Sonár festival Barcelona. Max Tiel from our consortium partner Netherlands Institute for Sound & Vision, gave a presentation on the insights of the Polifonia project.

Last weekend, Polifonia was part of Sonár festival Barcelona. Max Tiel from our consortium partner…

23 June 2023

Polifonia team members Nicolas Lazzari, Andrea Poltronieri and Valentina Presutti recently won the Best Research Paper Award at ESWC23.

Polifonia team members Nicolas Lazzari, Andrea Poltronieri and Valentina Presutti recently won the Best…

16 June 2023

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement N. 101004746