You are on page 1of 4

INTRODUCING BELLE, BONNE, SAGE

William Andrew Burnson


University of Illinois at Urbana-Champaign
Composition-Theory Division, Urbana, Illinois, USA
andrew@williamburnson.com
Figure 1. Belle, Bonne, Sage by Baude Cordier from 14th
century France.
ABSTRACT
In the search for a suitable tool for notation to engrave
his graphic symbol piece Bike Ride, the composer starts
from scratch, developing a corpus of vector-graphics tools
for music notation Belle, Bonne, Sage in deference to a 14th
century piece of eye music under the same name by Baude
Cordier. The technical problems posed by this feat, once
solved, become solutions to other gaps in current music no-
tation technology. Given that there are still no open-ended
music typesetting software libraries, it is paramount to de-
velop the software from the perspective of having uses be-
yond single notational paradigms, envisioning new inter-
faces, algorithmic composition via notation, and custom en-
graving.
1. BELLE, BONNE, SAGE
Belle, Bonne, Sage is an open-source C++ vector-graphics
library for music notation with a range of examples which
make use of its utilities to practical application. It attempts
to ll a gap in music notation technology not covered by cur-
rent commercial music notation programs or freely-available
software such as Lilypond, Common Music Notation[3], or
the PWGL Expressive Notation Package[2].
The library takes its name from a famous piece of eye
music by Baude Cordier from the 14th century, and these
three words are in turn, the tenets of its evolution.
1.1. Beautiful
Since the library is used not just for printing (usually involv-
ing fairly high resolutions), but also for interfaces which can
involve lower resolutions, microscopic detail is given to the
output.
1.1.1. Path-Based Geometry
The problem of music notation is unique for vector-graphics
applications in that it requires precise placement of text,
symbols, lines, and other types of geometry. When these
different types of graphical entities are combined, they are
often sent through different rendering pipelines. For exam-
ple, a quarter-note consisting of a notehead taken froma mu-
sic symbols font must be precisely joined to a stem which is
often a stroked line. Since most scanline renderers use one
algorithm optimized for drawing text and another optimized
for drawing lines, the results can be irregular, even if the
typesetting application sent exact coordinates.
Belle, Bonne, Sage converts lines, text, symbols, and
all other geometry into vector-based paths so that they are
rendered in the same graphics pipeline. In some instances,
when joins are difcult to control, a single union path is
created. For example, stemmed notes are drawn as single
outlines so that the scanline renderers have an easier time
creating a smooth join.
1.2. Good
1.2.1. Multiparadigm
The library can be used and extended by anyone for their
own purposes and is heavily documented so that users with
only basic programming experience can learn to use it given
482
Figure 2. Bike Ride (2007, rev. 2009) for solo piano by William Andrew Burnson. Dedicated to Barry and Mary Hannigan.
The print is 18 x 32.
the extensive tutorials and examples. For users who want
to try out the library without having to learn C++, the Lune
application can be used online to write scripts that generate
scores.
1.2.2. Native Compiling
The library builds native executables for Linux, Mac OS X,
and Windows using any of the familiar build environments:
the GNU Compiler Collection, Apple Xcode, and Microsoft
Visual C++ (Express), all of which are freely available. Ad-
ditionally, the library compiles for both 32-bit Intel x86 and
64-bit AMD x64 architectures.
1.3. Wise
1.3.1. Unity
The library is built around the principles of unity and self-
sufciency between all layers and that there should be one
clearly dened way to do the usual tasks.
1.3.2. Future-Proong
Work on the library anticipates developments in technolo-
gies in an attempt to future-proof its effectiveness. The use
of PDF, which was recently accepted as an ISO standard,
ensures that its output will remain in a rst-class format for
years to come. Also, extensive work has been done to ensure
that the library compiles strictly without warnings or errors
on all the above-mentioned platforms so that as compilers
change and evolve, the library will be easily maintained.
1.3.3. Open Source
The library is released under the open-source GNU Lesser
General Public License to help impact its adoption in per-
sonal, academic and commercial pursuits.
2. ARCHITECTURE
The C++ code is organized into a core library consisting of
three interdependent layers and two third-party extensions
upon which customized notation programs may be imple-
mented. With the core library, a user builds console appli-
cations that create custom scores in C++ and generate PDF
les. With the extensions, interfaces may be built or script-
ing can be used.
2.1. Core Library
The core library contains three layers each building on top
of the previous. In the rst layer, primitive types and classes
are exposed. File-manipuation, math functions, lists, ar-
rays, strings, iterators, integers, numbers, and other essential
483
types and classes are dened under a unied namespace that
allow the user to circumvent use of the more complicated
(and sophisticated) C++ standard library. Strings are a par-
ticularly important feature, since they are directly encoded
as UTF-8 allowing the entire Unicode codepoint range to be
used, thus facilitating the use of music fonts and languages
using non-Roman scripts.
The second layer is music-specic. It denes notions of
fonts and things useful to drawing music such as notes, and
establishes three abstractions that target applications imple-
ment to control the behavior of the output. These are score-
canvas, create-paint, and the painter. A score contains a
number of canvases (pages) that can be of varying shapes
and sizes. When a score is created, the implementation of
the score (say a notation program or a composers instruc-
tions) creates a number of canvases. After the score is cre-
ated, each canvas is painted in turn. The implementation of
canvas tells the painter what to draw on its surface.
The third layer is implementation specic. It currently
denes a reference PDF painter and a JUCE renderer for
interfaces. In the future, other formats such as SVG and
JPG may be added as native painters.
2.2. Third-Party Extensions
The JUCE library allows developers to create cross-platform
windowed interfaces. In conjunction with the supplied ex-
amples discussed later, a user can quickly start building a
notation interface. JUCE is dual-licensed under the GNU
General Public License and a proprietary license, so com-
mercial applications require paying a fee to its developer.
The Lua programming language is included to facili-
tate scripting and is used by the Lune application, discussed
later. Lua is an expressive Lisp-like language with a syn-
tax resembling many procedural languages. Lua is licensed
under the MIT License.
3. RENDERING
As the rst of the tenets of Belle, Bonne, Sage is beauty,
much work has gone into the suboptical details of not just
what is rendered, but how it is rendered. Vector-graphics
technologies usually implement a notion of stroked and lled
paths (i.e., a line versus a shape such as an elliptical note-
head) as well as glyph-based fonts. Unfortunately, the ras-
terization process for each of these types of drawing is often
optimized for one particular purposefor text, legibility;
and for stroked lines and curves, reducing jaggedness. How-
ever, since a lled path can describe any shape the others
can describe, its scanline algorithm is usually more general-
purpose and stable for the purposes of music notation. More-
over, in Postscript (and later its derivative PDF) drawing
commands were never intended to exactly join font-based
glyphs with other geometry. Ever since the beginning of the
computer-based music notation, the seemingly trivial task
of joining a notehead to a stem has been, as a result, non-
trivial. Even drawing lines (as opposed to lled rectangles
or rounded-rectangles) has also seen issue with some printer
drivers not properly recognizing stroke widths and leading
to unpredictable results.
To circumvent these fundamental issues of rasterization,
a decision was made to primarily use lled-paths for both
lines and text. Fonts are converted to a custom Scalable
Vector Graphics (SVG) format, acting both as a typeface
specimen that can be opened in any SVG-compliant web-
browser for viewing and as the native font format used by
the library.
Another benet of using the custom format is that Uni-
code characters are easily accessed. In a typical font for-
mat such as TrueType (TTF), glyph mapping is platform-
dependent and encoded through any one of a handful of eso-
teric algorithms. When the font is embedded into a PDF le,
the process of glyph mapping Unicode characters is compli-
cated even further.
1
4. USING THE LIBRARY
There are several ways in which the library can be used. The
easiest way to understand what the library does is to use any
of the sample applications which have been precompiled for
each target platform available at the project website.
2
For
those with basic programming experience, one way to use
the library is to try the online interactive Lune application.
5. SCRIPTING WITH LUNE
Lune is the most recent addition to Belle, Bonne, Sage and
provides a way to access the powerful drawing capabilities
of the library via the expressive Lua programming language.
Lune is also available online as an interactive server-side
application at the project homepage.
Lune redirects the C++ painting abstractions to the Lua-
implemented functions. For the score.create() func-
tion, the user requests the creation of any number of pages
of arbitrary size. When that function nishes, each pages
page.paint() function is called with a painter ob-
ject, passed as a parameter. The painter can then be used
to draw anything the user wishes to create. As Lune is a re-
cent addition to the library, work is still underway to nish
mapping the Lua painter to its C++ counterpart.
1
Belle, Bonne, Sage used to directly embed fonts into PDF les before
this technique was adopted and still retains this ability, however it is not
capable of embedding fonts that use characters outside the non-diacritic
Roman alphabet.
2
See: http://bellebonnesage.sf.net
484
6. PRACTICAL APPLICATIONS
Over the course of its development, Belle, Bonne, Sage has
been inuenced by the practical applications that depend
on it. The library was developed with real-time interfac-
ing in mind, so that just as one can implement a customized
manner of notation, one can similarly develop need-specic
interfaces, and includes the cross-platform JUCE user in-
terface library to facilitate the rapid development of cross-
platform custom music notation interfaces. Two examples
of interfaces, Chorale Composer and Blume are shown in
the gures.
Figure 3. A page from Chorale Composer showing an
on-the-y analysis of the rst of Bachs 371 Harmonized
Chorales. Work on Chorale Composer[4] began in 2008
with the goal of providing an educational environment for
advanced music theory training to complement previously
created four-part harmonic analysis software.
6.1. Applications in Development
Belle, Bonne, Sage is currently being used to implement
an automatic score generator for instruments, voices, and
electro-acoustic sounds for DISSCO.[1] As there are no mu-
sic notation programs that can easily generate sophisticated
tape scores in conjunction with traditional notation, Belle,
Bonne, Sage is being used to help ll another gap in computer-
based music notation.
Figure 4. A set of geoemetric-series accelerations created
by the Blume interface. The image is projected onto a page
and hand-traced by the composer to ll in the other musi-
cal details. The interface is named after the colleague who
requested it.
7. FUTURE WORK
Since Belle, Bonne, Sage denes an assumption-free model
of notation, hopefully the ongoing projects that use it will
propel the creation of diverse utilities to solve increasingly
sophisticated notational requirements. Eventually, a library
of interdependent modules could form the basis of a sys-
temfor professional publishing, composition of nonstandard
scores, algorithmic composition via notation, and custom
notation interaces. The creation of a visual interface, such
as those which have found widespread popularity in com-
mericial music notation software, is an apparent direction of
development.
8. REFERENCES
[1] H. G. Kaper and S. Tipei, Dissco: A unied approach
to sound synthesis and composition, in Proceedings
of 2005 Intl Computer Music Conference, Barcelona,
Spain, 2005, pp. 375378.
[2] M. Kuunskankare and M. Laurson, Expressive nota-
tion package, in Computer Music Journal, vol. 30, no.
4, Montreal, QC, Canada, 2006, pp. 6779.
[3] W. Schottstaedt, Common Music Notation. Stanford
University: Stanford: Center for Computer Research in
Music and Acoustics, 1992.
[4] H. Taube and Author, Software for teaching music the-
ory, in Proceedings of 2009 Intl Computer Music Con-
ference, Montreal, QC, Canada, 2009, pp. 175178.
485

You might also like