A description of how to encode figured bass (basso continuo) in **fb spines.

Figured bass can be encoded in Humdrum data using the **fb exclusive interpretation. Here is an example encoding:

Try changing/adding/deleting numbers in the second spine (column) to change the figured bass in the music on the right.

Notice that figures do not need to be attached to notes on the staff where figures are displayed (such as 3# in measure 15).

Stacked figures

Stacked figures, specifying more than one interval above the bass note, are created by listing the numbers in order from top to bottom and separating each figure with a single space. Here are some examples of displaying more than one figure simultaneously:

Stack placeholders

Use X or x to add an empty placeholder in a figured-bass stack. Upper-case X characters mean that any line extensions should terminate at this position, while lowercase x means that any extension line from a previous figure should pass through this position.

A colon (:) indicates that a hyphen should follow the figure, if it is at the end of a figure. If it is in the middle of a figure, then the colon should also be rendered as a hyphen, and it separates two figures from each other.

Implicit intervals

A figure such as “6” is shorthand for “6 3”. For analytic purposes, explicitly encoding the “3” interval as well as the “6” may be useful, yet display only the “6”. To do this, add a “K” to a figure to suppress its visual display. This is similar to “X” and “x”, but in the case of those two signifiers, no interval is implied. Unlike X/x, the K signifier will not preserve a vertical position for the invisible figure; however, you may include both K and X signifiers on the same figure to both hide the figure and preserve the stack position.

Staff placement

By default, figures will be placed below the staff. To move them above, add the interpretation *above before the first figure that should be placed above the staff. Use *below to revert to the default position below the staff.

Alternatively, you can use the exclusive interpretation **fba as a combination of **fb and *above. Note that you probably may want to add an empty placeholder x to align te numbers at the bottom.

Accidentals

Accidental encodings match those of **kern pitches:

Character Meaning
# sharp
n natural
– (dash) flat
## double-sharp
–– double-flat

Encoding written versus sounding accidentals

In **fb encodings, accidentals have a fixed meaning that is similar to modern music notation: A sharp means one half-step above a natural diatonic pitch, and a flat means one half-step below a natural diatonic pitch. In seventeenth-century music, the meaning of an accidental can be relative, such that a sharp sign for a note/figure that is otherwise flat means to raise the pitch by a half-step to the natural diatonic position. And likewise, flat signs may lower a sharped pitch to its natural state.

In such cases, add an “n” after the sharp or flat sign. When a natural sign is present at the same time as a sharp or flat, the natural sign is the sounding accidental for the figure, and the sharp or flat is the written sign. The following example demonstrates this behavior: in the first measure there is a written sharp sign for an interval which would otherwise be a B-flat due to the key signature. This should be interpreted to raise the B-flat pitch to B-natural. For the second measure, the modern convent of writing a natural to cancel the flat is used.

In both measures of the above example, a G-major chord should be played. For the first measure, the sharp functions as a relative accidental, and in the second measure, the natural sign is an absolute accidental.

Switching between relative and absolute visual accidentals

Add the tandem interpretation *absolute to the figure-bass spine to display accidentals in a modern style rather than the relative accidental style of the seventeenth century (if relative accidentals are encoded in the data). The allows easy switching between original notation and modern conventions. To cancel forced display of absolute accidentals, insert the *Xabsolute tandem interpretation before the figures to which it applies.

Here is a similar example, but an absolute accidental replaces the original relative accidental in the first measure:

Encoding chromatic interval

Using absolute accidentals for figured bass can cause problems when transposing music with figured bass. For example “♮7” in C major with a bass-note on C will produce a major seventh on B-natural, while the same figure in G major with a bass-note on G will produced an F-natural, which is a minor seventh.

The main problem is that in order to calculate the exact pitch of the figure, both the alteration of the figure and the key signature of the music is needed. So for encoding the exact chromatic interval, the letters m, M, P, d and A may be prefixed to the figure number:

Character Meaning
m minor interval
M major interval
P perfect interval
d diminished interval
dd doubly diminished interval
A augmented interval

The d and A characters may be repeated, with each additional letter lowering or rasising the pitch by a half-step.

These chromatic interval signifiers will not directly affect the visual display of accidentals on notes, but they are necessary for adjusting absolute accidentals when transposing music. An “fb” tool will be written to automatically insert chromatic alteration letters. This tool should also be able to adjust figured-bass accidentals after transposition.

Accidentals after figure numbers

Add an r to a figure to reverse the order of accidentals and numbers. The position of the sharp and the number is not otherwise important in the **fb encoding as demonstrated below:

Alternatively, give the tandem interpretation, *reverse, somewhere before the first figure to reverse the position of accidentals to avoid encoding reverse styling with r on every single token. Use *Xreverse to turn off the reversing feature.

Slashed figures

In some figured-bass notational conventions, slashes are used instead of accidentals to raise or lower the chromatic alteration of a figure. Slashes moving down from left to right typically mean that the chromatic alteration should be raised by a half-step, while slashes moving up from left to right mean that the figure’s pitch should be lowered by a half-step. Another variation is to use a + sign to indicate raising the pitch by a half-step. The + sign may also be stylized to be attached to the numeral of the figure.

Any figure can be slashed in **fb data, but not all of them are renerable in verovio notation. Here is a sampler of the ones that are available in graphic notation:

Here are the types of slashes that can be encoded:

Character Visual rendering Typical meaning
\ slash going down raise by half-step from key signature
/ slash going up lower by half-step from key signature
| vertical slash raise by half-step from key signature

Displaying figures without slashes

Accidentals should also be encoded in figures to explicitly indicate the chromatic alteration of the figure. Currently the MusicXML improter (see below) does not add such accidentals. The parallel accidental encoding is required since the meaning of slashes across different styles is not always consistent, so slashes in the encodings should be viewed as entirely visual elements, not analytic elements.

Figure bass can be automatically converted from slash notation to accidental notation for altered figures. Add the *Xslash tandem interpretation to display accidentals instead of slashes.

Editorial signifiers

There are three types of editorial signifiers for **fb data: i indicates editorial intervention, displaying figures/accidentals in square brackets; j indicates editorial intervention, displaying figures/accidentals in parentheses; and k indicates editorial intervention, not visualizing figures/accidentals. Here is a sampler of each type of editorial markup:

Note that lowercase codes apply only to the accidental, while uppercase codes apply to the entire figure.

Negative numbers

If you want to display a negative figured bass number, you can use the ~ signifier in front of the number to prefix it with a minus sign.

E.g. to encode the exact distances between two voices with an intervallsatz:

Adding figured-bass spines in VHV

To add a figured-bass spine to music in the VHV editor, do these three steps:

  1. Type this filter line (anywhere in the file):
    !!!filter: extract -s 1,0,2-$
    

    The filter assumes you have multiple parts or spines, and that you want to insert the figured bass spine as the second column from the left. The “0” in the extraction spine inserts a blank spine between spines 1 and 2. The spine extraction string will be different if you want to place the **fb spine elsewhere.

  2. Compile the filter by typing alt-c. For some keyboard/OS configurations, you may need to click on the graphic music on the right first (if alt-c inserts a character in the text, for example). After compiling the filter, the filter label should change to Xfilter and the blank spine should become visible in the text editor.

  3. Change the exclusive interpretation of the new spine from **blank to **fb. You can also remove the used filter line.

Here is a video demonstrating the process:

Demonstration of adding a figured-bass spine.
Demonstration of adding a figured-bass spine using the extract filter.

Importing figured bass from MusicXML

VHV can import figured bass from MusicXML data. Note that some music editors, such as MuseScore, can create/export figured bass, but others, such as Finale, cannot. To convert a MusicXML file with figured bass, drag-and-drop the file onto the VHV webpage.

MusicXML import with figured bass
MusicXML file containing figured bass, exported from MuseScore, then imported by drag/drop file into VHVV.

Here is the MusicXML test file used in the above video.

Realization hints

Here is an example of adding realization hints in a basso continuo part:

Here is Javascript code for implementing the above example:

document.addEventListener("DOMContentLoaded", function () {
   var containerSelector = "#beschrankt-svg"
   var svgSelector = containerSelector + " svg";
   var color = "#aaa";
   var interval = setInterval(function () {
      var svgTargetElement = document.querySelector(containerSelector);
      if (!svgTargetElement) {
         return;
      }
      clearInterval(interval);
      var observer = new MutationObserver(function (mutations) {
         mutations.forEach(function (mutation) {
            color514(svgSelector, color);
         });
      });
      var config = { attributes: false, childList: true, characterData: false };
      observer.observe(svgTargetElement, config);
      // Have to color manually the first time since SVG is already in place:
      color514(svgSelector, color);
   }, 100);
});

function color514(selector, color) {
   var item = document.querySelector(selector);
   var notes = item.querySelectorAll("g.note");
   for (var i=0; i<notes.length; i++) {
      var use = notes[i].querySelector("use");
      if (!use) {
         continue;
      }
      var height = use.getAttribute("height");
      if (height !== "514px") {
         continue;
      }
      var par = notes[i].parentNode;
      if (par.classList && par.classList[0] !== "chord") {
         notes[i].style.fill = color;
         notes[i].style.stroke = color;
      } else {
         par.style.fill = color;
         par.style.stroke = color;
      }
   }
}

And the CSS styling for the example to also color ledger lines of notes:

svg g.ledgerLines.cue [stroke]
	 { fill: #999;     stroke: #999; }