Polymetric notation is one of the main features of the Bol Processor project, which is here considered as musicological research rather than software development. Other features include tonal modelling and the time-setting of sound objects.
Polymetric expressions are a convenient product of rule-based music composition. They are represented as strings of symbols that embody a semi-lattice structure, here meaning a tree of sound objects with ties. Polymetric notation, generally speaking, is a sequence of polymetric expressions that is processed as a single polymetric expression.
The aim of the current project is to transcribe a musical input (given by a stream of MIDI events) to the most comprehensible polymetric notation. An extension of this would indeed be to accept a sound signal as input.

To achieve this, we plan to train a transformer (a type of neural network), using sets of polymetric expressions alongside their associated MIDI file renderings. As we require large sample sets that cover a wide range of musical styles, the plan is to create these sets using existing musical scores.
The process described on the Importing MusicXML scores page demonstrates the ability to "translate" any Western musical score (in its digital format) to a polymetric expression. This process is irreversible because polymetric expressions cannot be fully converted into human-readable musical scores, despite them carrying time structures that sound "musical". A typical example of this is the use of undetermined rests, as these imply further processing of the structure in order to set exact durations.
Sample sets that associate polymetric expressions with their MIDI file renderings will contain identical pitch and timing information on both sides. However, the transformer should be able to handle streams of MIDI events created by humans or random effects, where the timings are not based on a simple framework. Therefore, a quantization will be needed to adjust the stream before it is analysed. This quantization of incoming events is already operational on the Bol Processor — see the Capture MIDI input page.
The creation of sample sets
Sample sets are created from musical works imported from MusicXML scores. For instance:

Click the CREATE SET FOR AI button.

A sample set is created and can be downloaded in a zip file:
set_-da.Hungarian_Rhapsody_OguzSirin.zip.
More sets can be created using the same musical work. Clicking the CREATE SET FOR AI button again would produce the same set, as it is built from a sequence of random numbers that is not reinitialised. To ensure the new set is different, click the refresh button. When downloading it, the system will automatically assign it a different name, e.g.:
set_-da.Hungarian_Rhapsody_OguzSirin (1).zip.
Sample sets of minimised polymetric structures
The mini button close to the refresh button modifies the sample set so that all (eligible) polymetric structures are minimised. In a minimised structure, some rests with explicit durations are replaced with undetermined rests (notated '…') without any loss of timing accuracy. Read the Minimising a polymetric structure page for more details. These sets are smaller in size than the ones they are derived from because only eligible structures have been retained.
Once samples in the training set have been minimised, the CREATE SET FOR AI button is changed to CREATE minimised SET FOR AI.
The sets of minimised structures are downloaded with specific names that mention the 'mini' feature, such as:
set_-da.Hungarian_Rhapsody_OguzSirin_mini.zip
When training an AI, these sets should be used separately from standard sets because they are expected to train the transformer to guess the proper locations of undetermined rests. Nevertheless, it could be interesting to compare related (standard versus minimised) samples in order to model changes between standard and minimised polymetric structures.
The content of a sample set
The first sample set created in this demo contains 160 samples. These samples are text files named 1.txt, 2.txt, etc., associated with MIDI files 1.mid, 2.mid, etc. One of the text files contains for instance:
{_tempo(4/3) _vel(85){2,{3/16,D6& E6& D7&}{3/16,&D6,&E6,&D7}{1/8,C6,C7}{3/8,B5,B6}{1/8,A5,A6}{3/8,G#5,G#6}{1/8,A5,A6}{3/8,B5,B6}{1/8,G#5,G#6},{3/8,G#3}{1/8,D4}{3/8,B4}{1/8,E4}{3/8,E3}{1/8,B3}{3/8,G#4}{1/8,E4}}} {_tempo(4/3) _vel(85){2,{3/8,A5,A6}{1/8,G#5,G#6}{3/8,A5,A6}{1/8,B5,B6}{3/8,C6,C7}{1/8,B5,B6}{3/8,C6,C7}{1/8,D6,D7},{3/8,A3}{1/8,D4}{3/8,C5}{1/8,A4}{3/8,E3}{1/8,C4}{3/8,A4}{1/8,E4}}}
This polymetric expression covers 2 measures of the musical score. Clicking the CREATE SET FOR AI TRAINING button slices the score randomly into chunks containing between 1 and 5 measures. The upper limit of 5 has been set arbitrarily and may be revised at a later date. Every time the Refresh button is clicked, a new slice is created, resulting in a different sample set.
The idea is twofold: (1) the transformer should be trained to recognise sequences of polymetric expressions, and (2) tied notes may span more than one measure. A tied note in the above example is the pair "D6& &D6" (read more). Each sample contains only complete pairs of tied notes. This means that any notes whose ties are not present in the sample are untied for consistency.
Note that the timings of the polymetric expression and the MIDI file are identical, as the metronome is automatically set to a default tempo of 60 bpm when the MIDI file samples are created. In the above phrase, the tempo is set to 4/3, which is equivalent to a metronome set at 80 bpm.
A collection of sample sets
Several collections of sample sets can be found in the folder:
https://bolprocessor.org/misc/AI/samples
These can be used for training a transformer of your choice. We recommend creating more sets from more musical works to achieve a better training. Run the Bol Processor and browse imported MusicXML scores in the ctests/Imported_MusicXML workspace, or import more works from a dedicated score server.
A test of the transformer's ability to "translate" MIDI files to polymetric notation will first be to retro-convert (to polymetric expressions) all samples, then to retro-convert the MIDI file of every musical work used for the training.
What follows…
Once a proper transformer type and an optimum size of sample sets have been found, we will work on the following extensions:
- Translate MIDI streams produced by human interpreters, for which accurate timings are not guaranteed.
- Extend the AI recognition to the use of undetermined rests when it permits a more simple polymetric structure.
🛠 Work in progress!
