Purcell

A dynamic relational model of music engraving

(please use Google Chrome, Opera or Safari to view this page)

purcell is a tool that allows musical scores to be embedded and interacted with dynamically. Below is a purcell score!

Of course, it is more interesting if we can add elements dynamically. Click on the buttons below to add some quarter notes, rests (R), and barlines (|).

Look like the score on the previous page? That's because purcell scores are created on a server and can be visualzied anywhere.

Keep editing and flip back and forth between the pages to see realtime updating, or go forwards to see more cool stuff.

purcell engraving is mostly done in SQL. purcell implements a relational model of music engraving, where database triggers propagate data into tables representing engraved music.

This data can be rendered to any surface that draws lines, curves, polygons and glyphs. Above, the surface is SVG.

The power of using a relational model in music engraving is that arbitrary data about a score can be retreived.

Click on "execute" below to execute the SQL query.
In purcell speak, it translates to "select the ID of all notes in the score where the pitch is B or E."

Use this page as a SQL sandbox for the score below.

Here are some suggestions.

--Only execute one query at a time. Queries are delimited by semicolons.
SELECT accidental.id AS id FROM accidental;
SELECT name.id AS id FROM name WHERE name.val = 'clef';
SELECT beam.val AS val FROM beam GROUP BY beam.val;
SELECT x_position.id AS id, x_position.val AS val
  FROM x_position JOIN name ON x_position.id = name.id
  WHERE name.val = 'bar_line';
SELECT duration_log.id AS id FROM duration_log WHERE duration_log.val = -1;

Modifications are possible as well.

To change all sharps in the score above to flats, execute the statement below.

purcell is ideal for engraving music in embedded, dynamic, interactive, and animated contexts.

Mini-Editor

Check out the slides below to play with a slightly more robust editor.


Clicking on the note name will add a note, and clicking on other buttons will control aspects of the next added note.


Below the editor's slide, an SQL editor can be used to query the score.


   

      


Dynamic SQL Queries

Thanks!

Questions about purcell? Comments? Like to get involved? Contact mike@mikesolomon.org.

Fork me on GitHub