Tied notes

This page is intend­ed for devel­op­ers of the Bol Processor BP3 (read instal­la­tion). It is not a for­mal descrip­tion of the algo­rithms car­ried by the con­sole’s C code, but rather an illus­tra­tion of their man­age­ment of musi­cal process­es, which may be use­ful for check­ing or extend­ing algorithms.

All exam­ples are includ­ed in the “ctests” fold­er of the distribution.

Example of tied notes

Consider mea­sures #18 to #22 of Liszt’s 14th Hungarian Rhapsody import­ed from a MusicXML file — see Importing MusicXML scores. The print­ed score of mea­sures #19 to #21 is as follows:

Measures #19 to #21 of Liszt’s 14th Hungarian Rhapsody
Source: ManWithNoName in the MuseScore com­mu­ni­ty

Tied notes are vis­i­ble on this score. Slurs con­nect­ing notes at dif­fer­ent pitch­es are ignored by the Bol Processor. These could be inter­pret­ed using the _legato(x) per­for­mance con­trol, but set­ting an appro­pri­ate val­ue for ‘x’ would require a care­ful analy­sis of the con­text. Ties link the same pitch, such as “Ab1″ (A flat in octave 1) at the bot­tom of the score lines. There are 3 occur­rences of tied “Ab1″ in this sec­tion, the first one start­ing at the end of mea­sure #18 and the third one end­ing at mea­sure #21.

In Bol Processor nota­tion, this frag­ment results in a sequence of poly­met­ric struc­tures. For the sake of clar­i­ty, each mea­sure has been placed on its own paragraph:

#18 {_tempo(4/3) {4,{7/4,C4,C5}{1/4,C4,F4,Ab4,C5}{7/4,C4,F4,Ab4,C5}{1/4,Db4,F4,Ab4,Db5},{7/4,G4,Bb4}9/4,{7/4,E2,C3,G3,Bb3}{1/4,F2}{7/4,C3,F3,Ab3}{1/4, Ab1&}}

#19 {_tempo(4/3) {4,{15/4,Db4,F4,Ab4,Db5}1/8{1/8,C4,Gb4,B4,Eb5},{3/4,Ab2}{3,Db3 F3 Ab3 Db4 F4 Ab4 Db5 F5 Ab5 Db6 F6 Ab6}{1/4,- Ab1&}, &Ab1 ---}

#20 {_tempo(13/10) {33/8,{1/4,Db4& Gb4& A4& Eb5&}{7/2,&Db4,&Gb4,&A4,&Eb5}1/4{1/8,Fb4,Ab4,Cb5,Fb5},{3/4,Ab2}{13/4,Eb3 Gb3 A3 C4 G4 Bb4 Eb5 Gb5 A5 Eb6 Gb6 B6 -}{1/8, Ab1&}, &Ab1 25/8}}

#21 {_tempo(13/10) {33/8,{15/4,Fb4,Ab4,C5,Fb5}1/4{1/8,F4,Ab4,Db5,F5},{3/4,Ab2}{13/4,Fb3 Ab3 Cb4 F4 Ab4 C5 F5 Ab5 Cb6 Fb6 Ab6 Cb7 -}{1/8,B1&}, &Ab1 25/8}}

#22 {_tempo(4/3) {4,{7/2,F4,Ab4,Db5,F5}1/2,{3/4,B2}{13/4,F3 Ab3 Db4 F4 Ab4 Db5 F5 Ab5 Db6 F6 Ab6 Db7 -}, &B1 ---}}

The 3 occur­rences of tied “Ab1″ and “B1″ are shown in colour. “Ab1&” is the begin­ning of a tie and “&Ab1″ is the end (of the same colour). Longer ties would occa­sion­al­ly require sequences such as “Ab1&” + “&Ab1&”+ “&Ab1″.

These ties merge the (sym­bol­ic) time inter­vals of the begin­ning and end­ing occur­rence. For exam­ple, the score “C4& &C4″ could be replaced by “C4 _ ” or equiv­a­lent­ly “{2, C4}”. The merg­ing of time inter­vals is done in the FillPhaseDiagram() pro­ce­dure of file “FillPhaseDiagram.c”.

While pars­ing the com­pact poly­met­ric struc­ture to build the phase table — see Complex ratios in poly­met­ric expres­sions — the algo­rithm calls GetSymbolicDuration() (in “SetObjectFeatures.c”) to cal­cu­late the sym­bol­ic dura­tion of a sound-object or sim­ple note. By default, this is easy to cal­cu­late. The ignorecon­cat flag is set to true if the sound-object or note is not fol­lowed by a ‘&’. The dura­tion is set by prodtem­po = Prod / tem­po.

If ignorecon­cat is false, GetSymbolicDuration() looks for the next accept­able occur­rence of the note or sound object pre­ced­ed by a ‘&’. Acceptability implies the fol­low­ing conditions:

  1. The note or sound-object should be on the same MIDI chan­nel or the same Csound instrument;
  2. The date of the next occur­rence should be lat­er than the on-set date.

The con­di­tions are read­i­ly appar­ent in the exam­ple. For exam­ple, “A1b&” can­not be paired with “&A1b” because the lat­ter occurs at an ear­li­er date. The next valid occur­rence is “&A1b”. The same applies to pairs shown in oth­er colours. Each colour indi­cates a match­ing pair.

Once the dura­tion has been set, the algo­rithm calls PutZeros() to fill as many columns as nec­es­sary to set the total dura­tion of the pair of tied notes — as detailed in the page on Complex ratios in poly­met­ric expres­sions.

In addi­tion, when “&A1b” is parsed lat­er, it should be ignored because the dura­tion of the note has already been set by call­ing GetSymbolicDuration() and PutZeros() at the time of pars­ing “A1b&”. Skipping these pro­ce­dures is ensured by the foundend­con­cate­na­tion flag.

Graphic display

The fol­low­ing is a sound-object graph of mea­sures #20 to #21 on which the bound­eries of inter­vals in tied notes are marked with dashed lines. The bounds of “Ab1& … &AB1″ (red colour) are self-explanatory when com­pared with the musi­cal score shown above: each occur­rence is an instance of “{1/8, Ab1&} &Ab1″.

Symbolic dura­tions can be checked against phys­i­cal time: since the tem­po is 13/10, the first part has a phys­i­cal dura­tion of 1/8 x 10 / 13 = 0.09 sec­onds and the sec­ond part 10/13 = 0.77 seconds.

Measures #20-21 of Liszt’s 14th Hungarian Rhapsody on a sound-object graph

At the end of mea­sure #21 the begin­ning of the note “B1&” is linked to its occur­rence “&B1″ in mea­sure #22. The bound­ary is marked by a dashed blue line. The piano roll of mea­sures #21-22 shows this con­nec­tion of “B1″:

Measures #21-22 of Liszt’s 14th Hungarian Rhapsody on a piano roll
Liszt’s 14th Hungarian Rhapsody inter­pret­ed by the Bol Processor on a Pianoteq physical-model syn­the­sis­er
Source: ManWithNoName in the MuseScore community


Arpeggio on chord
{Db, Gb, Bbb, Eb}
Bbb” is inter­pret­ed as “A”.

The green dashed lines belong to the poly­met­ric expres­sion {1/4,Db4& Gb4& A4& Eb5&}{7/2,&Db4,&Gb4,&A4,&Eb5}, the inter­pre­ta­tion of an arpeg­gio on the chord at the begin­ning of mea­sure #20. This inter­pre­ta­tion is con­struct­ed when import­ing MusicXML files — see the PHP code in the file “_musicxml.php”.

A short sequence “Db4 Gb4 A4 Eb5″ (dura­tion 1/4 beat) is played before the chord “{Db4, Gb4, A4, Eb5}” whose dura­tion is set to 7/2 beats. Each note in the sequence is tied to its occur­rence in the chord.

A sound exam­ple of an arpeg­gio can be found on the Importing MusicXML scores page.

More tied notes

A clear illus­tra­tion of the use of tied notes and unde­ter­mined rests is a short musi­cal phrase bor­rowed from a tuto­r­i­al by Charles Ames, a pio­neer­ing design­er of com­po­si­tion algo­rithms. The phrase is sup­plied as a musi­cal score but its inter­pre­ta­tion requires a care­ful analy­sis of the musi­cal struc­ture, result­ing in the fol­low­ing Bol Processor score:

{{2,-{2,F#3}, _rest {1,F5,A5}}{4,{ 1/2 ‚G#3,E5,G5}{ 7/2 ‚Bb4}}, _rest { 1/4 ‚G#5&,C6,E6,B6&}{2,&G#5,&B6}}

To make things clear we need to look at the score in com­mon music nota­tion, divide it into blocks asso­ci­at­ed with vari­ables, and final­ly write a gram­mar “-gr.Ames” to build the struc­ture. Below are details of the analy­sis process and the result­ing graphs of sound-objects and piano roll:

In this gram­mar, unde­ter­mined rests have been writ­ten as “”. In its cur­rent ver­sion, the Bol Processor con­sole no longer recog­nis­es the Unicode sym­bol for ellip­sis “”. Therefore, it is auto­mat­i­cal­ly con­vert­ed it to “_rest” by the PHP interface.

Undetermined rests are a pow­er­ful fea­ture of poly­met­ric expres­sions used to avoid tedious cal­cu­la­tions. The poly­met­ric expan­sion algo­rithm com­putes (sym­bol­ic) dura­tions that pro­duce the least com­plex expres­sion. Read more in the Polymetric Structures tuto­r­i­al.

Tied notes are exact­ly the ones indi­cat­ed by links on the musi­cal score. The sound ren­der­ing is:

Rendering of “-gr.Ames” with metronome mm = 60

Error tracing

The con­struc­tion of suit­able time inter­vals for tied notes depends on the match­ing of pairs — e.g. “A4&” fol­lowed by “&A4″ — in the Bol Processor score. Some pairs may remain incom­plete for one rea­son or another:

  1. The musi­cal item has been split into chunks, using the PLAY safe (instead of PLAY) option to speed up com­pu­ta­tion, and the two parts belong to sep­a­rate chunks;
  2. An error in the import­ed MusicXML score;
  3. An error in the algo­rithm — increas­ing­ly rare.
Unbound tie(s) sig­naled in a chunk

Case (1) is lim­it­ed by the method for chunk­ing items: each chunk is designed to con­tain the same num­ber of start and end ties. However, this is not guar­an­teed because the chunks are lim­it­ed in size.

Failure to bal­ance ties is indi­cat­ed below the PLAY safe but­ton (see image).

Errors are shown in colour on the track being played.. These may not cause any notice­able changes in per­for­mance. However, we rec­om­mend that you report any incor­rect data to the designers.

Below is an exam­ple of an error in a MusicXML score of Beethoven’s Fugue in B flat major. A tie starts at note “Db5″ (MIDI key #73) at the begin­ning of mea­sure #573 (part 2), but it ends nowhere:

Measures #573 to 575 (part 2) of Beethoven’s Fugue in B flat major, with a never-ending tie start­ing at “Db5

Read the MusicXML score frag­ment to check for this incon­sis­ten­cy. There are oth­er incon­sis­ten­cies in this score, such as a slur start­ing on note ‘C4′ of mea­sure #646 (part 3) that does not end. This makes it dif­fi­cult to inter­pret the slurs as legato.

Leave a Reply

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