The GUIDO Engine Library



The GUIDOLib project aims at the development of a generic, portable library and API for the graphical rendering of musical scores. The library is based on the GUIDO Music Notation format as the underlying data format. It is an open source project covered by the Mozilla Public License.

The project has started in December 2002, based on the source code of the GUIDO NoteViewer developed by Kai Renz.

The GUIDO Music Notation

The GUIDO Music Notation format (GMN) is a general purpose formal language for representing score level music in a platform independent plain text and human readable way. It is based on a conceptually simple but powerful formalism: its design concentrates on general musical concepts (as opposed to graphical features). A key feature of the GUIDO design is adequacy which means that simple musical concepts should be represented in a simple way and only complex notions should require complex representations. This design is reflected by three specification levels: the basic, advanced and extended GUIDO specifications.

The GUIDO Engine

The GUIDO Engine operates on a memory representation of the GMN format: the GUIDO Abstract Representation (GAR). This representation is transformed step by step to produce graphical score pages. Two kinds of processing are first applied to the GAR:

This GSNF is finally converted into a GUIDO Graphic Representation (GGR) that contains the necessary layout information and is directly used to draw the music score. This final step includes notably spacing and page breaking algorithms.

Note that although the GMN format allows for precise music formatting (in advanced GUIDO), the GUIDO Engine provides powerful automatic layout capabilities.

Main library services

The main services provided by the library are:

Graphic devices

First version of the GUIDO Engine was Windows dependent: a Windows HDC type (graphic device context handle) was provided to the GGR objects, that were directly calling Microsoft Windows APIs to draw graphics and text.

For the GUIDO Engine to be platform-independent, and to avoid being restricted to one graphical technology (even a cross-platform one such as pdf, eps or OpenGL ...), the choice has been made to provide a C++ object (called VGDevice) to the GGR objects, in place of the previous windows HDC handle.

VGDevice is a C++ pure virtual class that declares all methods required by the GGR objects to communicate their graphical operations. Implementations of VGDevices are provided by clients applications using derived classes so that neither GGR objects nor any part of the GUIDO Engine depends on a particular graphical implementation.

The main advantage is that VGDevice derived classes can implement any kind of graphic output: on-screen (platform specific, OpenGL), off-screen (raw bitmaps), files (pdf, svg, postscript), network streams...

VGDevices derived classes must provide standard graphic functions (Lines, Arcs, Boxes,Polygons, Text), coordinate transformations (zoom / scaling), and symbolic music symbols handlers (DrawSymbol method). VGDevice design makes a clear distinction between text characters and music symbols (although music symbols are generally glyphs in a music font). Music symbols are identified by font-independent constants. This mechanism provides VGDevice objects with a higher abstraction level than a pure graphic layer.

Existing implementations of VGDevices:

    GDeviceOSX:             MacOS X Quartz implementation.
    GDeviceWin32:           Windows (gdi)
    GDeviceWin32GDIPlus:    Windows (gdiplus)
    CairoDevice:            Linux   (cairo)
    GDeviceQt:              platform independent - Qt based device

VGDevice implementations not maintained:

    GDeviceWin2000:         Windows 2000 / XP(gdi+)
    GDeviceGL:              OpenGL implementation
    GDeviceGTK:             Linux GTK implementation
    GDevicePostScript:      EPS files (encapsulated postscript)
    GDeviceWx:              wxWindows DC implementation.