Scoring
Format
Scores in the program are saved as XML files.
Each XML has one <score> node wrapping the score, with multiple
<instrument> nodes each containing their own notes.
Each score file is prefaced with an XML header: <?xml version="1.0" encoding="utf-8"?>
<score>
<score> wraps the entire score and has two attributes.
bpm describes the beats per minute for the score.
beatspermeasure describes how many beats are in each measure.
Scores follow typical musical notation. Quarter notes are assumed to be one beat.
A beatspermeasure of
4 is analogous to a time signature of 4/4,
and a value of 2 is analogous to 2/4, etc.
| Attribute | Purpose |
|---|---|
| bpm | Beats per minute |
| beatspermeasure | How many beats are in each measure |
Example:
<score bpm="120" beatspermeasure="2">
instruments...
</score>
<instrument>
<instrument> wraps an instrument's individual score and has one attribute.
instrument is a string with the name of the instrument to be used.
Valid instruments are detailed on the components page.
| Attribute | Purpose |
|---|---|
| instrument | Which instrument to use |
Example:
<instrument instrument="ToneInstrument">
measures...
</instrument>
<measure>
<measure> wraps the notes in a measure. It has no attributes.
It is used to make scoring easier without having to manually set the measure number on each note. Internally, each time the program finishes reading a measure, it increments the measure counter.
Empty measures can be added by using an empty node <measure/>.
Example:
<measure>
notes...
</measure>
<rests>
<rests> denotes one or more rest measures where the instrument plays nothing.
It has one attribute. It should always be outside of a <measure> tag.
count determines how many measures to rest for.
| Attribute | Purpose |
|---|---|
| count | How many measures to play nothing for |
Example:
<rests count="2"/>
<note>
<note> describes a note for instruments.
It has three attributes.
beat describes the location of the note within the measure.
Beats outside of the measure is undefined behavior and may or
may not work as you expect.
duration describes the duration of the note.
Duration does not have to stay within the constraints of the measure.
This allows for notes that cross the bounds of a measure, such as tied notes.
note describes the pitch of the note in scientific pitch notation.
| Attribute | Purpose |
|---|---|
| beat | Where the note starts in the measure |
| duration | Length of the note (1 = whole note) |
| note | Pitch of the note (SPN) |
Example:
<note beat="1" duration="0.5" note="Bb4"/>
<[effect]>
<[effect]> describes an effect to apply to the score.
The tag name will correspond to the proper effect.
Different effect types may have their own required attributes.
See the effects page.
The attributes listed here are common to all effects.
Effects should be placed inside a measure in the same way a note is placed.
enable describes whether or not the effect is enabled.
The first time an effect is enabled, all values must be initialized. Subsequent uses can enable and
disable as long as the id matches an existing effect and the beat is defined.
id describes a unique integer ID for the effect. This allows for the effect to be toggled
and for multiple of the same effect to be applied.
beat describes the where in the measure the effect will enable/disable.
wet describes the portion of signal to modify (from 0 to 1).
The output will be a mix of wet wet signal and 1-wet dry signal.
| Attribute | Purpose |
|---|---|
| enable | Whether or not the effect is enabled |
| id | Unique identifier number (allows for toggle) |
| beat | Where the effect starts in the measure |
| wet | Portion of wet signal to output (0-1) |
Example:
<[effect] enable="true" id="1" beat="1" wet="0.9"/>
<[effect] enable="false" id="1" beat="3"/>
<[effect] enable="true" id="1" beat="4"/>
Sample file
This sample file is the score file used to create the audio selection.