The Assistant Composer is part of Moritz (an
open-source Visual
Studio Solution, written in C#), and is a Windows Desktop application that creates scores that can be read in browsers.
The
scores are designed to be read
and interpreted using the Assistant Performer.
The compositions will obviously be related to my personal history and taste, but Moritz
is also intended to be a platform in which useful concepts (and software libraries) can be developed for use in other
contexts.
When the button is clicked in Moritz'
opening
dialog,
a file dialog appears asking the user for a score's settings file.
Score settings files have an
.mkss suffix, and are located in the folder
in which the completed score will be eventully be saved. Score folders are kept at a special location that can be found
in
Moritz' preferences.
The settings
file contains layout and other information necessary for creating a particular score. The
settings file's
name is the name of the score's algorithm, and is independent of the name of
its containing
folder. This means that the same algorithm can be
associated with different layouts: New score settings files (layouts) can be created for an existing algorithm simply by
duplicating an existing score folder, and then editing the layout in the Assistant Composer.
Algorithms contain no spatial information, but define the MIDI information for a score,
including the number of channels. They are written (in C#) in a restricted part of Moritz,
where I am developing the classes for a high-level musical grammar.
When a new algorithm is written, its name is added to a list of available algorithms inside Moritz. A new settings file
can then be created by renaming a duplicate of an existing one inside a new score folder.
When the settings file opens, the Assistant Composer knows both the name of the score's algorithm and the path to the
folder in which it should create the score.
In the case of the standard layout for Study 2c3.1, the
main Assistant Composer window looks like this:
The
name in the title bar is the name of the
folder containing the settings file. There is only one folder
containing a Study 2c3.1 settings (.mkss) file, but that is not necessarily the case.
There are three main sections at the top of the dialog:
notation,
krystals and
palettes (see below),
and initially four activated buttons at the bottom:
- The button creates the score in its folder using the score's algorithm and
current
settings. The score consists of SVG documents that are loaded into a host HTML document. Each SVG document is a
separately printable page of the score. If
any of the score's settings are edited, this button's text changes to ,
and
it is disabled until the new settings have been confirmed or reverted using the apropriate buttons. The settings have to
be saved before the score can
be created. The button's text and function changes back to when
the current settings have been saved. When the score has been created (overwriting any existing version in the its
folder), it is opened automatically in the user's default browser.
- closes the Assistant Composer and redisplays Moritz main dialog.
This button's text always includes the current algorithm's name.
- quits Moritz altogether.
- opens the following dialog:
These options are for each (SVG) page in the score.
- The number of pages is determined automatically when the score is created.
- The paper size selector offers a choice of (printable) paper sizes.
- Metadata is written to each (SVG) page of the score. In addition to the information provided in the above
metadata section
(if any), metadata automatically includes the date and time at
which the file was created.
- The website links section
is written to the top of the first (SVG) page of the score. In this case, a link is provided to the About Study 2 page
on
this website.
1. General
- chord type: A choice between standard chords (with accidentals, noteheads, flags, beams
etc.) and coloured '2b2' chord symbols (see Study 2c).
Standard chord symbols are well understood by performers, and can carry far greater amounts of information more legibly
and more flexibly than '2b2' symbols, so they are the Assistant Composer's preferred notation. The use of '2b2' chord symbols
is deprecated. They have been kept here for historical reasons.
- minimum crotchet duration (ms): Only available for standard chord symbols. The relation
between duration class symbol and duration. Duration classes are allocated according to a logarithmic scale of bandwidths.
If, as here, the minimum crotchet duration is set to 800ms, duration classes will be allocated as follows
(durations in milliseconds):

- beams cross barlines: Only available for standard chord symbols. Beams are substituted
for flags wherever possible. If this check box is checked, they cross barlines.
- staff line and stem stroke width: Best left at 0.5 screen pixels.
- (output staff) gap size: This is the score's gap size (the gap size for output staves).
Input staves, if there are any, are larger.
- (minimum) gaps between staves: When justifying systems vertically, this is the smallest
vertical distance between
any symbol on one staff and any symbol on the staff below. This is not just the distance between staves.
- (minimum) gaps between systems: When justifying pages vertically, this is the
smallest vertical distance between any symbol on one system and any symbol on the system below. This is not just the
distance between systems. If there are more than two systems on a page, they will be spaced evenly. If an attempt is
made to put too many systems on a page, another page is created.
2. voices per staff
This is where the voices (MIDI channels) provided by the algorithm are allocated to staves.
With Study 2c3.1 loaded, the dialog looks like this:
with Study 3 sketch 2.1 loaded, it looks like this:
The help text that can be opened by right-clicking the text on the right, is as follows:
3. clefs per staff
Clefs are allocated to staves in top to bottom order, according to the left-right order in this input field.
The number of staves is deduced from the above voices per staff input field. There is no difference here between output
and input staves. Input staves are always on the right (at the bottom of the system).
Using the number of staves defined above, the clefs per staff section looks like this for:
Study 2c3.1:
Study 3 sketch 2.1:
The following clefs are available when using standard chords:
- t: treble
- t1: treble, 1 octave higher ("piccolo" clef)
- t2: treble, 2 octaves higher
- t3: treble, 3 octaves higher
- b: bass
- b1: bass, 1 octave lower ("double-bass" clef)
- b2: bass, 2 octaves lower
- b3: bass, 3 octaves lower
The 'n' clef is always available. This is like a percussion clef, vertically
centred in the staff no matter how many stafflines it has.
4. stafflines per staff
Staves are in top-bottom order again. All clefs except 'n' must have 5 stafflines.
Using the number of staves defined above, the stafflines per staff section looks like this for:
Study 2c3.1:
Study 3 sketch 2.1:
5. staff groups
Each system is given a continuous first barline. After that, barlines are only drawn through staff groups.
Using the number of staves defined above, the stafflines per staff section looks like this for:
Study 2c3.1:
Study 3 sketch 2.1:
6. staff names
The names to be printed to the left of each staff.
Using the number of staves defined above, the stafflines per staff section looks like this for:
Study 2c3.1:
Study 3 sketch 2.1:
7. system start bar numbers
The bar numbers of the bars that begin each system.
The algorithm determines the number of bars — which are simply the places at which systems can be broken. If an attempt
is made to
create a score with too many bars on a system, a warning message is displayed, telling the user which system is causing
the problem.
This input field looks as follows for:
Study 2c3.1:
Study 3 sketch 2.1:
This section of the main Assistant Composer form
lists the krystals that are going to be used by the algorithm when the
score is created:
Study 2c3.1 |
Study 3 sketch 2.1 |
Song Six |
 |
 |
 |
The and
buttons are enabled when a krystal is selected in the list.
- displays the selected krystal in a krystals browser.
- opens a krystals browser having a
button at its bottom right.
When the button is clicked, the krystal's name is added to the list.
- simply removes the selected krystal from the list.
Krystals are actually
created using the
Krystals 4.0 program.
Krystals browsers can display both heredity and content information about all the available krystals.
Here is one that is about to return pk4(12)-2.krys — the krystal
used for the top voice in Study 2c3.1:
The palettes section lists the palettes used by the algorithm when creating the score.
A palette contains a
list of
MIDIChord definitions, each of which contains temporal information that can be associated with a single,
standard chord symbol.
A standard chord
symbol can have an attached ornament symbol (such as

or

),
so a
MidiChord can contain a sequence of unornamented MIDI chords.
See
Why ornaments? below.
Palettes are currently created and edited here inside the Assistant Composer, and their definitions are
stored in the current score settings file. That is not the best solution. Ideally, palettes should be edited and stored
externally in the way that krystals are.
That way, it would be possible to develop libraries of interrelated palettes and MIDIChords that could be used in any
score.
Currently, palettes can be copied from one score to another by editing settings files directly (they are XML text
files), but that is obviously not the ideal solution.
Palettes are edited using two main forms:
- The Palette Form: This defines the basic information,
including the duration that is to be converted to a duration class, and
the MIDI pitches (i.e. frequencies) to be converted to noteheads and accidentals.
- If any of the MIDIChords in the main Palette Form is to be ornamented, a linked
Ornaments Form is created. This
describes how the basic information is to be ornamented.
If there is an Ornaments Form linked to the palette, the text ': ornaments' is added to the palette's name in
the
main Assistant Composer form's list:
Study 2c3.1 |
Study 3 sketch 2.1 |
Song Six |
 |
 |
 |
The and buttons
are enabled when a palette is selected in the list.
- opens the selected palette (for editing) in a Palette Form.
- opens a New Palette dialog:
When this dialog is dismissed:
- The palette's name is added to the Assistant Composer's list.
- An empty Palette Form (without ornaments) opens. If ornament settings are added later (while editing), the Assistant
Composer's list is updated again.
- deletes the selected palette altogether from the current settings
(after appropriate warnings).
This
form defines a set of chords that can be written in standard notation without the use of ornaments.
If any chord is to be ornamented, it will have a non-zero value in the
ornament numbers
field,
and there will be a linked Ornaments Form defining the ornament. The combined result of the two forms is a list of
MidiChord
definitions.
A Palette Form has:
- 18 Input fields having either a brown or black label, and a blue help text.
Brown labels are for compulsory fields. Bracketed black labels indicate that the
default value will be used if the field is left empty. The blue help texts are updated at runtime.
Except for the root inversion
field, each input field must contain as many values as there are Midichords in the palette. A particular MidiChord
value is the value at a particular position in the input fields (i.e. MidiChordDefinition[4] consists of
the values at index 4 in each input field).
- Various buttons in the lower part of the dialog.
- Other blue help texts
palette 1 of Study 2c3.1 contains 12
MidiChord Definitions, and looks like this:
Input fields:
- Basic definitions (in the upper box)
- base chord densities The number of base pitches in each chord.
In standard chord notation, this is equivalent to the number of noteheads in each chord.
- durations The duration of each chord (milliseconds)
- base midi pitches The lowest pitch in each chord
- base velocities The velocity of the lowest pitch in each chord
- chord offs 1 means that the chord is sent MIDI NoteOff messages to silence it
when its duration has elapsed. 0 means that the chord is not sent such messages.
- root inversion An abstract chord-pitches definition: the intervals beween the
pitches of a chord in its root inversion. All the chords defined in this palette are related to this definition.
The number of values in this field is one less than the maximum density of any of the chords.
Each chord is found by first finding its inversion, using the first density - 1 values of the inversion, and
then transposing the result so that the lowest pitch is the chord's base midi pitch.
For example: The third chord in the above palette has density 3, base pitch 62, inversion 1, and the root inversion is 754321.
The possible inversions are derived from a linear field having
754321 as its base hierarchy:
index |
inversion |
0 |
754321 |
1 |
574321 |
2 |
547321 |
3 |
453721 |
4 |
435271 |
5 |
342517 |
6 |
324157 |
7 |
231457 |
8 |
213457 |
9 |
123457 |
So the third chord uses the first 2 intervals in inversion 1 (=57), added to the base pitch 62. That is pitches 62, 67,
and 74.
- inversion indices The inversion index of each chord (see above).
- vertical velocity factors The factor by which to multiply the velocity of the
lowest pitch in each chord to find the velocity of the highest pitch in the chord. Intermediate velocities are interpolated
(linearly).
If the resulting velocity of any pitch in the chord exceeds the maximum MIDI value (127), it is automatically truncated
to 127.
- Other parameters
- bank indices The MIDI bank index for each chord. Ignored if this is a MIDI
percussion palette.
- patch indices The MIDI patch index for each chord. Ignored if this is a MIDI percussion
palette.
MIDI Percussion: If the percussion check-box in the lowerpart of this dialog is checked:
- both the bank and patch fields will be ignored
- the palette's timbres will be those defined in the Standard MIDI Percussion channel of the MIDI output device set in
Moritz' preferences.
- repeats 1 means that the MidiChord definition will repeat in assisted
performances if the performer holds the chord for longer than its defined duration. 0 means that the MidiChord
does not repeat.
- pitchwheel deviations The pitchwheel deviation setting for each chord.
- pitchwheel envelopes A pitchwheel envelope for each chord. There is a help
text on the form describing how to define an envelope. Long envelopes are quite difficult to edit here, so a MidiChord
editor has been created to edit them singly (see midi chord editor buttons below).
- pan envelopes A pan envelope for each chord.
- modulation wheel envelopes A modulation wheel envelope for each chord.
- expression envelopes An expression envelope for each chord. This defines MIDI
expression messages. Channel master volumes are initialised by algorithms, but MIDI volumes are not otherwise controlled
by Moritz.
- ornament numbers An Ornament Settings form can be created by clicking the button.
The number of available ornaments is defined in that form, and displayed here in the ornament numbers help text. A value
of 0 entered in this
field means that the chord is not ornamented, otherwise the value is the number of the ornament
defined in the form.
- minimum chord durations
In ornamented chords, this is the minimum duration (milliseconds) of any sub-chord inside each MidiChord. Setting
this value
can reduce the number of sub-chords in the MidiChord.
Buttons:
The lower part of this dialog contains a percussion check-box, various buttons and help texts:
- three rows of buttons: These are created dynamically, with one column of buttons per MidiChord
definition in the palette.
- midi chord editors: New in Moritz v3. Clicking one of these opens
a modal dialog containing the definition of a single MidiChord. This is, in effect a vertical slice through
the settings in the main dialog. The purpose of this is simply to make the editing of a particular MidiChord easier,
especially its envelope.
- midi: clicking one of these plays the MidiChord on the MIDI output
device set in Moritz' preferences.
These buttons have not changed since Moritz v2, and can be tried out live in the
Study 3 sketch documentation.
- audio: each of these buttons can play an audio sample defined by the user
(see the help text at the bottom left of the dialog). These audio samples are intended to be models providing orientation
while defining
MidiChords. These buttons have not changed since Moritz v2, and can be tried out live in the
Study 3 sketch documentation.
- : opens a help dialog listing the
names of the Standard MIDI patches and their indices. (Indices - numbers that begin counting at 0 - are used consistently
throughout this editor.)
If the percussion check-box is ticked, the text on this button becomes
and it opens a help dialog about percussion
instruments and the pitches used to access them.
- : opens a help window
listing pitch names and their MIDI pitch numbers.
- and : these buttons are enabled when the form has changed. They are used to revert
or confirm the current state of the dialog.
- : creates a new set of
ornament settings and the corresponding Ornaments Form. If such a form already exists, the user is asked if it should be
overridden.
- : deletes the current
ornament settings and the corresponding form. Asks for confirmation of course.
- : brings the Ornaments Form
to the front of the z-order.
- : brings the main Assistant
Composer form to the front of the z-order.
There
have been major changes to this form since the previous version of the Assistant Composer: Ornament values in the lower part of the form are now entered directly, rather than being related to krystals.
I have updated all the current Assistant Composer compositions by copying the previously used krystal values here, so
that the compositions themselves have not changed.
The screenshot below is
The Ornaments Form associated with Study 2c3.1.
This
form defines a set of ornaments that are used by the
MidiChord definitions in the linked palette form.
The settings in the upper box define a set of abstract
basic chord defs
that can be used
relatively to any of the definitions in the main palette form. These settings are very like some of the settings in the
palette form, but
basic chord defs have neither envelopes nor ornaments.
Each value in the ornament definitions below the box is the number of one of the
basic chord defs.
The maximum number of both
basic chord defs and ornaments is 12. The other blue help texts adjust dynamically
to the values in the appropriate fields. In the dialog below, for example, the range of possible values in the ornament
definitions is given as 12, which is the number of
basic chord defs.
When the number of ornaments is set, the correponding help text in the linked palette is also adjusted.
There are simplified help texts at the bottom of the dialog, but a more complete explanation below the following screenshot.
Input fields:
- The upper box
- number of basic chord defs An integer in the range 1..12. When this value is
set, the help texts (and error handling) in the form are updated.
- note density factors A chord having this density is created from each note in
the chord to which the ornament is being added. This happens after the root chord defined in the palette has
been transposed to its base midi pitch defined in the palette.
- relative durations The ornament has the duration of the root chord to
which it is being added (the duration defined in the palette). It is constructed by creating a sequence of basic
chords with these durations, and then stretching or compressing them all so that the total duration in
correct.
The minimum duration of any of these basic chords is set in the minimum chord durations
field in the main palette. If the given basic chords will not fit into the given duration, basic chords at
the end of the sequence are omitted until they do.
- transpositions The root chord's pitches are transposed by these amounts before
adding the pitches defined in the root inversion and
inversion indices fields in this form. If the palette is a percussion palette,
this will change the instruments being played.
- velocity increments The root chord's velocities are increased
by these amounts before adding the chord velocities per pitch defined here for the ornament in the
vertical velocity factors
field.
- ( chord offs ) 1 means that the chord is sent MIDI NoteOff messages to silence it
when its duration has elapsed. 0 means that the chord is not sent such messages. Default is that all basic chords
are stopped.
- root inversion,
inversion indices and
vertical velocity factors: An abstract chord-pitches definition: These fields work
together, in the same way as in the main palette form to define a chord
having both pitches and a velocity per pitch.
- ( bank indices ) and ( patch indices )
If present, these values override the root chord's bank and patch values. If the palette is a percussion palette,
these values will be ignored.
- ornament definitions
- number of ornaments An integer in the range 1..12. This value is independent
of the number of basic chords. When set:
- The relevent help text (and error handling) changes in the linked palette form.
- The number of ornament definition fields in this form changes.
- The size of this whole form changes to fit the ornament definition fields.
- ornament definition fields Each field defines a sequence of basic chords,
as defined in the box at the top of the form, referring to them by number.
Each sequence must contain at least one basic chord number, but is otherwise of unlimited length.
The basic chord numbers must, of course, be in the range given in the help text above.
Buttons:
- and : these buttons are enabled when the form has changed. They are used to revert
or confirm the current state of the dialog.
- : brings the linked palette
form
to the front of the z-order.
- : brings the main Assistant
Composer form to the front of the z-order.
Why ornaments?
Ornaments describe the level of information, below the chord level, normally dealt
with by signal processing software such as
Max/MSP or
SuperCollider. It is important that this boundary is
not too sharply drawn.
Also (and equally important): The smallest events notated in humanly readable music
notation are chords. These are the smallest logical units which can be used to create
musical forms. Adding information (ornaments) to them makes them more recognizable,
and the entire form more
comprehensible.
Compare the situation with the examples in
the (archived) Moritz’
Ornaments documentation in which the following
diagram serves as a ‘score’.
Colouring the individual values enables them to be found more easily, and the krystal’s
(i.e. the recorded example’s) form to be better understood.