Minimising a polymetric structure

šŸ‘‰ For geeks only!

This page is about the polyĀ­metĀ­ric notaĀ­tion used in the Bol Processor project and, most likeĀ­ly, othĀ­er softĀ­ware enviĀ­ronĀ­ments. This advanced tool is used to repĀ­reĀ­sent the time strucĀ­ture of events, which can be simĀ­ple notes, sound-objects, or more genĀ­erĀ­alĀ­ly time-objects that can be instanĀ­tiĀ­atĀ­ed as video fragĀ­ments, sequences of robotĀ­ic actions, and so on.

In a polyĀ­metĀ­ric strucĀ­ture, rests (or 'silences') are repĀ­reĀ­sentĀ­ed by inteĀ­ger ratios (their symĀ­bolĀ­ic duraĀ­tion), for examĀ­ple ā€˜6’ for "six beats" or '4 2/3' for "four and two third beats". Small inteĀ­gers can be replaced with hyphens, for examĀ­ple '---' for '3'.

In some (but not all) polyĀ­metĀ­ric strucĀ­tures, rests with explicĀ­it duraĀ­tions can be replaced with undeĀ­terĀ­mined rests (notatĀ­ed '…' or '_rest'), the valĀ­ue of which is calĀ­cuĀ­latĀ­ed by a (deterĀ­minĀ­isĀ­tic) algoĀ­rithm in the conĀ­sole (file 'polymetric.c'). This is an imporĀ­tant feaĀ­ture because it enables the notaĀ­tion to be simĀ­pliĀ­fied withĀ­out comĀ­proĀ­misĀ­ing the accuĀ­raĀ­cy of the time. Take a look at Charles Ames' examĀ­ple, for instance.

A polyĀ­metĀ­ric strucĀ­ture conĀ­tainĀ­ing at least an undeĀ­terĀ­mined rest is called 'minĀ­imised" for this reaĀ­son. Examples of minĀ­imised strucĀ­tures are found on the Polymetric strucĀ­tures page.

The topĀ­ic of this page is about 'revertĀ­ing' the algoĀ­rithm that assigns explicĀ­it duraĀ­tions to undeĀ­terĀ­mined rests in the Bol Processor conĀ­sole. Geeks will find this algoĀ­rithm in the 'polymetric.c' file, and they can set the 'trace_und' variĀ­able to '1' to trace its operation.

Examples of minimisation

All examĀ­ples are found in the "-da.tryMinimise" data file (disĀ­tribĀ­uted from the 3.3.6 verĀ­sion). Click the MINIMISE butĀ­ton to minĀ­imise all (eliĀ­giĀ­ble) polyĀ­metĀ­ric expresĀ­sions on the page.

The first examĀ­ple {2, C4 C4 --} will be minĀ­imised as {2, C4 C4 …} whereĀ­as the secĀ­ond examĀ­ple {2, C4 C4 -} is not eliĀ­giĀ­ble. The reaĀ­son is that {2, C4 C4 …} is always instanĀ­tiĀ­atĀ­ed as {2, C4 C4 --} (or {2, C4 C4 2}) and there is no minĀ­imised verĀ­sion of {2, C4 C4 -}.

The third examĀ­ple {C4 D4 E4, A4 B4 F4 3 G4 A4 B4} is minĀ­imised as {C4 D4 E4, A4 B4 F4 … G4 A4 B4}. Both verĀ­sions yield the folĀ­lowĀ­ing time structure:

For this demo, we use simĀ­ple notes with arbiĀ­trary pitchĀ­es in English notaĀ­tion, as we are only focusĀ­ing on the time structures.

The next examĀ­ples are not eliĀ­giĀ­ble for a minimisation:

{C4 D4 E4, A4 B4 F4 1 G4 A4 B4}
{C4 D4 E4, A4 B4 F4 2 G4 A4 B4}
{C4 D4 E4, A4 B4 F4 4 G4 A4 B4}

It is not easy to guess which duraĀ­tion of the rest — 1, 2, 3, 4 beats? — makes it eliĀ­giĀ­ble for being undeĀ­terĀ­mined. The corĀ­rect valĀ­ue can be found by clickĀ­ing the EXPAND butĀ­ton to the right of {C4 D4 E4, A4 B4 F4 … G4 A4 B4}. The first line of the result is the expandĀ­ed polyĀ­metĀ­ric expression:

/1 {*1/1 C4 D4 E4,*1/3 A4 B4 F4 - _ _ G4 A4 B4}

The '- _ _ ' sequence is a rest of duraĀ­tion 3 beats. The symĀ­bol '-' repĀ­reĀ­sents a rest of one beat. This is folĀ­lowed by two proĀ­lonĀ­gaĀ­tions, '_'.

Note that the "expandĀ­ed polyĀ­metĀ­ric expresĀ­sion" uses absolute temĀ­po markĀ­ers, such as '*1/3', to repĀ­reĀ­sent the strucĀ­ture, rather than relĀ­aĀ­tive markĀ­ers, such as '__tempo(1/3)'. This repĀ­reĀ­senĀ­taĀ­tion can be used for data, as was the case in earĀ­ly verĀ­sions of the Bol Processor.

Indeed, in this simĀ­ple examĀ­ple, the duraĀ­tion was visĀ­iĀ­ble on the graph. However, it becomes increasĀ­ingĀ­ly difĀ­fiĀ­cult to meaĀ­sure when rhythĀ­mic strucĀ­tures become more comĀ­pliĀ­catĀ­ed. For examĀ­ple, {A4 F4 G4, … C4 D4 … E4} is expandĀ­ed as:

/1 {*1/1 A4 F4 G4, *3/8 - *3/4 C4 D4 *3/8 - *3/4 E4}

It is not easy to figĀ­ure out that '*3/8 -' is a silence at twice the speed of '*3/4 C4', thereĀ­fore its (relĀ­aĀ­tive) duraĀ­tion is 1/2 and the strucĀ­ture is equivĀ­aĀ­lent to {A4 F4 G4, 1/2 C4 D4 1/2 E4}.

Tracing the minimisation

The algoĀ­rithm for minĀ­imisĀ­ing polyĀ­metĀ­ric strucĀ­tures is more comĀ­pliĀ­catĀ­ed to design than the one for assignĀ­ing explicĀ­it duraĀ­tions to undeĀ­terĀ­mined rests. As per this writĀ­ing, it does not covĀ­er all casĀ­es. Updated verĀ­sions will be impleĀ­mentĀ­ed in the interĀ­face file 'data.php'.

If you need to folĀ­low the process while lookĀ­ing at the code, open the setĀ­tings file and enter the item numĀ­ber at the botĀ­tom of the form. In this examĀ­ple, we have choĀ­sen to trace the minĀ­imiĀ­saĀ­tion of item #3.

Don't forĀ­get to save the setĀ­tings and save again the Data page. Now, click the MINIMISE butĀ­ton. You will get a trace that looks like this:

šŸ‘‰ { C4 D4 E4 , A4 B4 F4 3 G4 A4 B4 }
field #0 = 3/1 sounds, 3/1 beats
field #1 = 6/1 sounds, 9/1 beats
[3+0, 3/1 beats] [6+3, 9/1 beats]
ref field = 0, duraĀ­tion = 3/1 beats
āž” xp = -3, xq = 1, p_tempo = 1, q_tempo = 1, n_gaps = 1,
case 1 field #1 —> p_beats[ref_field] = 3, q_beats[ref_field] = 1, p_sounds[field] = 6, q_sounds[field] = 1
pmax/qmax = 3/1, lcm = 1, p_sounds[field] = 6, q_sounds[field] = 1
mgap = 2, x = 2, p_therest (before adjust) = 3
p_therest (after adjust) = 3, q_therest = 1
[field #1 -> rest = 3]
{C4 D4 E4 , A4 B4 F4 _rest G4 A4 B4} [3/1 levĀ­el 0]

(This trace will difĀ­fer in subĀ­seĀ­quent versions.)

.šŸ›  Work in progress .…. to be continued .….…

Leave a Reply

Your email address will not be published. Required fields are marked *