Technical manual

Commandline parameters

There are several command-line parameters to Compose! The syntax structure of the command-line parameters is: [parameters] [“file name”] Parameters are a lower case letter preceded by either '-' or '+', '+_' means enable the feature, '-' disables it.

Parameter Default Explanation
l +l -l disables logging to the file Compose.log. This option can be set via Options→log file
s +s -s disables the splash screen
m +m -m show a minimalistic view at startup
q +q -q quits when a file has been played
“file name” ”” Include the quotes. Name of the file that will be played when Compose! is started. When playing of the file has finished and the -q option has been specified Compose! will quit automatically.


Creating vector plugins

Plugins allow the user to add his own vectors to Compose!. Currently plugins are only implemented for dynamic systems. Below the necessary steps are described.

  1. Create a DLL in the language of your liking
  2. The DLL should contain at least the following procedures/functions (delphi example)
    procedure vecSet (vx0, vy0, vz0, va, vb, vc, vd, ve: double); stdcall;
    procedure vecGet (var vx0, vy0, vz0, va, vb, vc, vd, ve: double); stdcall;
    procedure vecInit; stdcall;
    procedure vecNext (i: Int32; x_1, y_1, z_1: double; var x, y, z: double); stdcall;
    procedure vecFini; stdcall;
  3. The names of the functons, the number and types of parameters and the way of calling (stdcall) should be identical.
  4. Export these functions
  5. Create the DLL and run PluginManager.exe that is provided with your distribution
  6. install_dll creates a 32*32 24 bits bitmap with the same name as the DLL, but extension .bmp; it does so only when no .bmp file is present. An existing file will not be overwritten
  7. the name of the vector is the same is the file name of the .dll file, without the extension and the directory path, all underscores (_) are replaced by spaces
  8. Run Compose! and see that a vector is added to vector choice

The code below is a Delphi example for a Henon vector plugin.

procedure vecSet (vx0, vy0, vz0, va, vb, vc, vd, ve: double); stdcall;
   x0 := vx0;
   y0 := vy0;
   z0 := vz0;
   a  := va;
   b  := vb;
   c  := vc;
   d  := vd;
   e  := ve;
end; // VecSet //

procedure vecGet (var vx0, vy0, vz0, va, vb, vc, vd, ve: double); stdcall;
   vx0 := x0;
   vy0 := y0;
   vz0 := z0;
   va  := a;
   vb  := b;
   vc  := c;
   vd  := d;
   ve  := e;
end; // VecGet //

procedure vecInit; stdcall;
   VecSet (0, 0, 0, 1.4, 0.3, 0, 0, 0);
end; // VecInit //

// Example code
procedure vecNext (i: Int32; x_1, y_1, z_1: double; var x, y, z: double); stdcall;
   x := 1 + y_1 - a * sqr (x_1);
   y := b * x_1;
   z := 0.0;
end; // VecNext //

procedure vecFini; stdcall;
// Write your finalization code here
end; // VecFini //

XML schema of [[compose|Compose!]] files

Compose! reads and writes its information as XML-files. For this purpose an XML schema for A Fractal Composition Document (afcod) was developed. In order to create for processing by Compose! your own afcod documents a good understanding of the afcod format is necessary. This section provides that information. If you need more information, please contact the developers of MuSoft. We encourage other programs interfacing with Compose! and will provide any reasonable assistance.

Structure of a [[compose|Compose!]] document

Compose! is about generating music from numbers. Music is generated by Clips. Clips contain many parameters that govern the way music is being generated, like which instrument should be used, which rythm, tone scale, etc. A clip assumes that the numbers are correctly provided by vectors. Vectors are all about generating numbers, which parameters do apply, which dimension to use and which limitations apply. This all is lumped together into a composition that has some global parameters, like the total duration of the piece.

This division is reflected in the definition of an afcod document. Each afcod document consists of three blocks: globals, vectors and clips. The globals block contains a few global parameters, like for example the number of measures. It is followed by a vectors block and a clips block. Vectors and Clips contain zero or more vector resp. clip (note the singular) blocks. Each vector and clip consists of parameters and each parameter has two attributes: “name” and “value”. Example:

<parameter name="Size" value="1000" />

This has the advantage that it is easy to code, the disadvantage that it is a little harder to understand, compared to a schema where each parameter has been defined separately. Below is the schema for afcod version 1.0.

afcod schema

Download from:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs=""

  <xs:element name="afcod_document">
        <xs:element ref="globals" minOccurs="1" maxOccurs="1"/>
        <xs:element ref="vectors" minOccurs="1" maxOccurs="1"/>
        <xs:element ref="clips" minOccurs="1" maxOccurs="1"/>
      <xs:attribute name="version" type="xs:string"/>
  <xs:element name="globals">
      <xs:sequence minOccurs="1" maxOccurs="1">
        <xs:element ref="parameters"/>
  <xs:element name="vectors">
      <xs:sequence minOccurs="1" maxOccurs="1">
        <xs:element ref="parameters"/>
          <xs:element ref="vector"/>

  <xs:element name="vector">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>
      <xs:attributeGroup ref="name_type"/>
  <xs:element name="clips">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>
          <xs:element ref="clip"/>
  <xs:element name="clip">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>
          <xs:element ref="clip_parameters"/>
          <xs:element ref="chord"/>
          <xs:element ref="aspects"/>
      <xs:attributeGroup ref="name_type"/>
  <xs:element name="clip_parameters">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>

  <xs:element name="chord">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>

  <xs:element name="aspects">
      <xs:sequence minOccurs="4" maxOccurs="4">
          <xs:element ref="aspect"/>

  <xs:element name="aspect">
        <xs:element ref="parameters" minOccurs="1" maxOccurs="1"/>
      <xs:attributeGroup ref="name_type"/>
  <xs:element name="parameters">
        <xs:element ref="parameter"/>

  <xs:element name="parameter">
        <xs:extension base="xs:string">
          <xs:attribute name="name" type="xs:string"/>
          <xs:attribute name="value" type="xs:string"/>

  <xs:attributeGroup name="name_type">
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="type" type="xs:IDREF"/>

A full description of all parameters (not yet complete) follows below. Parameters need not be present. When parameters are not present defaults are supplied that may not be realistic and the results will be unpredictable. Parameters labeled as “reserved” should be provided with the exact value as prescribed.


Contains the global parameters of the music piece. A note on the computation of durations etc. in Compose!. The finest grain of time in Compose! is the 32nd note. The amount of 32nd notes in a measures depends on the beats of that measure and its rythm. A 4/4 measure contains 32 32nd notes and a 9/8 measure 36. The total length of a piece is thus determined by the amount of measures, its beats and rythm. This is not the same as the speed with which a piece is played. That depends on the Beats per Minute (BpM), the amount of quarter (1/4) notes per minute. A typical BpM of 120 plays 2 quarter notes each second which is equal to 16 32nd notes per second. This means that a 32nf note last 1/16th second which equals 0.0625 second.

Parameter Type Explanation
Version String Version of Compose! that created this file. afcod documents are backwar and forward compatible, this requires specifying the version number. Specify “1.0” when in doubt (with the quotes)
Measures Int Total number of measures in the document
Beats Int Number of beats for each measure, 4, reserved
Rythm Int Rythm of each measure, 4, reserved
BpM Int Beats (= quarter notes) per minute
PpM Int Pixels per measure to display the document. Creates the amount of zoom: default is 16, which means that 16 pixels for each measure are reserved, lower number zooms out (max = 1), higher amount zooms in (max = 64).
Max_Time Int Maximum time of the piece = Measures * Beats * 32 / Rythm, reserved


The vectors section contains parameters element global to all vectors followed by zero or more vector elements. There are currently no global vector parameters defined.


A vector should be defined with two attributes: name and type. Example:

    <vector name="Henon" type="10">

Each vector contains a number of parameters defined below. Each vector consists of three dimensions: x, y and z. Graphically x and y are displayed as the horizontal resp. the vertical dimension of a vector. The Z-dimension is represented as color. The y-dimension must always exist. For graphical representations an absent x-dimension is provided for with the values of 0..Size-1. To complicate situations further in some situations a fourth dimension is distinguished: t. This is solely used to represent a MIDI track, in which T represents the time a note is played.

The use of colors to display the Z-dimension of a vector (especially for complex maps) is a bit tricky. To begin with there are two pairs of colors separated by a separator. The reason for this is that colors of a pair are interpolated in order to create a smooth gradient. A user might however want to highlight differences. That is why a second pair has been introduced and a separator. When the colors are different (i.e. black and white) the distinction will be quite sharp. If no pairs are desired, just set separator to 0 or 1. The way of interpolation depends on the color pattern parameter. Each color is represented as RGBA, a byte for each color, A being unused, inIntel order of bits and bytes.

Parameter_Defs Type Explanation
Size Int Size of the vector
x (size) Int # of horizontal pixels for a complex map
y (size) Int # of vertical pixels for a complex map
x (min) Float Minimum value for x axis, 0, reserved
x (max) Float Maximum value for x axis, 0, reserved
x (cross) Float position of cross over a complex map. Should be between min and max
y (min) Float As for x, 0, reserved
y (max) Float As for x, 0, reserved
y (cross) Float As for x
T0 Float Initial value T0
X0 Float Initial value X0
Y0 Float Initial value Y0
Z0 Float Initial value Z0
Dimension (T) Int As for x
Dimension (X) Int Does dimension exist for x-axis? 0 = no, 1 = yes
Dimension (Y) Int Dimension exists always, should always be 1
Dimension (Z) Int As for x
Start T (play) Int As for x
Finish T (play) Int As for x
Start X (play) Int With the Start and Finish parameters one can limit playing range of a vector. The Vector starts playing at Start and stops playing at Finish. Depending on other parameters playing either stops at finish or wraps around. By default Start=0 and Finish=Size-1. Start and Finish should always be in the range [0..Size-1] and Finish > Start, else a crash will follow.
Finish X (play) Int See explanation above.
Start Y (play) Int As for x
Finish Y (play) Int As for x
Start Z (play) Int As for x
Finish Z (play) Int As for x
XY Choice Int
Colors Int Number of colors, 0, Reserved
Color Separator Int The separator as a fraction (between 0 and 1) of the range of Z-values
Color pattern Int 0 = interpolate, 1 = rainbow (only for first pair, 2 = alternate (Z-value mod 4 = 0: first color, = 1, second color, etc., 3 = raw (direct mapping of the value to the color)
Color from Color First color of the first pair
Color to Color Second color of the first pair
Separator from Color First color of the second pair
Separator to Color Second color of the second pair
Color reduction Int The number of adjacent Z-values to be lumped together as one color. This creates “color banding”
Plot lines Bool On = Plot lines between successive points; Off = just plot the successive points without lines
MIDI Bool On = interpret the vector as a MIDI vector; Off = do not
Ini Loops Int # of initial loops = the number of loops that are ignored in order to avoid initialization effects
Params Int # of parameters for this vector (0-5 (a, b, c, d, e)
Iterations Int # of iterations for each pixel in a complex map
Method Int 0 = normal, 1 = , 2 =
Initialization Int
a Float a-e are parameters for the vector, Params defines how many there actually are
b Float
c Float
d Float
e Float
String 1 String String 1-4 supply additional values for the vector. For a Lyapunov vector its string, for a data vector its values, etc.
String 2 String
String 3 String
String 4 String


The clips element contains a parameters element containing the global clip parameters followed by zero or more clip elements. Currently there are no clipwide parameters.


The clip element contains clip parameters element, a chord parameters element followed by four midi aspect elements. The clip specification has two parameters: name and type. Example:

    <clip name="176" type="0">

The name should be a unique number among clips and for type the following applies:

  • 0 - this is an instrument clip
  • 1 - drum clip
  • 2 - MIDI controller clip
  • 3 - chord clip


Parameter Type Explanation
Channel Int MIDI channel [1..16] for this clip, channel 10 is the drum channel, avoid this when the channel must playback an instrument, set it for a drum clip
Patch Int GM MIDI program or patch
Drum Int GM MIDI drum patch
Controller Int GM MIDI controller
Port Int Port (soundcard) for this clip. A computer may have 0 or more ports, some soundcards do have seceral ports. Set to 0 if not present as can happen when files are ported to another computer
Play Int
Offset Int Offset in 32nd notes of the clip
Top Int The vertical dimension of the drawing pad has no meaning, so it is expressed in pixels. Top in pixels in the range [0..1000] (untidy & temporary measure)
Chord Int ?
Reverse Bool On = play clip backwords
Track Bool On = subtract each generated note value from its maximum in the clip
Links String Only when this is a cord clip: a list (separated by semi-colons of names of clips that the chord is linked to
Generate Bool Whether or not this clip generates music, On, reserved


Chord parameters are not yet expected to be provided. However, Compose! must find them in order not to crash, thats why they are always present. Below the default values are listed.

Parameter Type Explanation
Inversion Int 0
Openness Int 0
Center Int 4
Tracks String <empty>
Basic Weight String 0.2 0.1 0.0 0.2 0.4 0.3 0.2
Vector Weight Float 10
Vector Dimension Int 1
Conformity Float 1
Match Float 1
First Any Note Float 0
First Base Note Float 0
Avoid Self Float 0
Avoid Parallel Fifth Float 0
Avoid Parallel Octave Float 0
Broken Int 1
Chord Transition Matrix String 0.0 0.1 0.1 0.3 0.5 0.1 0.0 0.1 0.0 0.1 0.4 0.3 0.3 0.1 0.2 0.3 0.0 0.3 0.2 0.1 0.0 0.3 0.5 0.1 0.0 0.5 0.1 0.0 0.8 0.1 0.2 0.5 0.0 0.3 0.0 0.3 0.1 0.2 0.3 0.0 0.1 0.5 0.6 0.0 0.1 0.0 0.1 0.3 0.0
Apply Basic Weight Bool For all apply parameters: On = apply this parameters; Off = do not apply
Apply Vector Bool
Apply Conformity Bool
Apply Match Bool
Apply First Base Note Bool
Apply First Any Note Bool
Apply Avoid Self Bool
Apply Transition Matrix Bool
Apply Avoid Parallels Bool

midi aspect parameters

There are four MIDI aspects: notes (pitch), duration, volume and time. Not all parameters apply to all aspects.

Parameter Type Explanation
Vector String Name of an existing vector in the Vectors section
Style Int 0 = very legato .. 4 = very staccato
Scale String Name of a musical scale from scales.ini
Tonica Int 0 = c .. 11 = b
Minimum Int Minimum of the generated value. Number between [0..127], being a MIDI note
Maximum Int Maximum as above but > minimum
Rescale Bool On = rescale notes to a value between minimum..maximum; Off = just round, assigning minimum when smaller than minimum and maximum when bigger than maximum; this assumes a good knowledge of the data
Default Float When no value is supplied the default is assumed. This applies to all aspects except the Notes aspect: a value must be supplied
Dimension Int The dimension to use from the vector
N_Durations Int Number of duration values for the duration aspect
Durations String index to duration values separated by space. Vectors provide continuous data and when translated to durations this yields not always desirable results, especially because all is translated to an amount of 32nd notes which gives a very chaotic impression. In certain circumstances the user might want just 1/16th, 1/8the and 1/4th notes which should be 1, 3 and 7
The meaning of the duration indices

In certain circumstances the user might want just 1/16th, 1/8the and 1/4th notes which should be 1, 3 and 7. This means that NDurations = 3 and Durations = “1 3 7”. The meaning of a duration is as follows

index #32nd's Translation
0 1/32 1/32
1 2/32 1/16
2 3/32
3 4/32 1/8
4 5/32
5 6/32
6 7/32
7 8/32 1/4

An example

A Compose! document has been created with just one vector (Henon) and one clip.

The document has been saved as afcod_example.afcod, see below.

<?xml version="1.0"?>
<afcod_document xmlns=""
xmlns:afcod="" version="0400">
      <parameter name="Version" value="0400" />
      <parameter name="Measures" value="50" />
      <parameter name="Beats" value="4" />
      <parameter name="Rythm" value="4" />
      <parameter name="BpM" value="120" />
      <parameter name="PpM" value="32" />
      <parameter name="Max_Time" value="1600" />
    <vector name="Henon" type="10">
      <parameter name="Size" value="10000" />
      <parameter name="x (size)" value="0" />
      <parameter name="y (size)" value="0" />
      <parameter name="x (min)" value="0" />
      <parameter name="x (max)" value="0" />
      <parameter name="x (cross)" value="0" />
      <parameter name="y (min)" value="0" />
      <parameter name="y (max)" value="0" />
      <parameter name="y (cross)" value="0" />
      <parameter name="T0" value="0" />
      <parameter name="X0" value="0" />
      <parameter name="Y0" value="0" />
      <parameter name="Z0" value="0" />
      <parameter name="Dimension (T)" value="0" />
      <parameter name="Dimension (X)" value="1" />
      <parameter name="Dimension (Y)" value="1" />
      <parameter name="Dimension (Z)" value="0" />
      <parameter name="Start T (play)" value="0" />
      <parameter name="Finish T (play)" value="9999" />
      <parameter name="Start X (play)" value="0" />
      <parameter name="Finish X (play)" value="9999" />
      <parameter name="Start Y (play)" value="0" />
      <parameter name="Finish Y (play)" value="9999" />
      <parameter name="Start Z (play)" value="0" />
      <parameter name="Finish Z (play)" value="9999" />
      <parameter name="XY Choice" value="0" />
      <parameter name="Colors" value="0" />
      <parameter name="Color Separator" value="0" />
      <parameter name="Color pattern" value="0" />
      <parameter name="Color from" value="16711680" />
      <parameter name="Color to" value="65535" />
      <parameter name="Separator from" value="255" />
      <parameter name="Separator to" value="16777215" />
      <parameter name="Color reduction" value="1" />
      <parameter name="Plot lines" value="Off" />
      <parameter name="MIDI" value="Off" />
      <parameter name="Ini Loops" value="0" />
      <parameter name="Params" value="2" />
      <parameter name="Iterations" value="0" />
      <parameter name="Method" value="0" />
      <parameter name="Initialization" value="0" />
      <parameter name="a" value="1.4" />
      <parameter name="b" value="0.3" />
      <parameter name="c" value="0" />
      <parameter name="d" value="0" />
      <parameter name="e" value="0" />
      <parameter name="String 1" value="" />
      <parameter name="String 2" value="" />
      <parameter name="String 3" value="" />
      <parameter name="String 4" value="" />
    <clip name="Henon" type="0">
      <clip_parameters name="Clip parameters">
        <parameter name="Channel" value="1" />
        <parameter name="Patch" value="0" />
        <parameter name="Drum" value="0" />
        <parameter name="Controller" value="0" />
        <parameter name="Port" value="0" />
        <parameter name="Play" value="0" />
        <parameter name="Offset" value="30" />
        <parameter name="Top" value="58" />
        <parameter name="Chord" value="0" />
        <parameter name="Reverse" value="Off" />
        <parameter name="Track" value="Off" />
        <parameter name="Links" value="" />
        <parameter name="Generate" value="On" />
      <chord_parameters name="Chord parameters">
        <parameter name="Inversion" value="0" />
        <parameter name="Openness" value="0" />
        <parameter name="Center" value="4" />
        <parameter name="Tracks" value="" />
        <parameter name="Basic Weight" value="0.2 0.1 0.0 0.2 0.4 0.3 0.2" />
        <parameter name="Vector Weight" value="10" />
        <parameter name="Vector Dimension" value="1" />
        <parameter name="Conformity" value="1" />
        <parameter name="Match" value="1" />
        <parameter name="First Any Note" value="0.2" />
        <parameter name="First Base Note" value="0.4" />
        <parameter name="Avoid Self" value="-0.5" />
        <parameter name="Avoid Parallel Fifth" value="1" />
        <parameter name="Avoid Parallel Octave" value="0.5" />
        <parameter name="Broken" value="1" />
        <parameter name="Chord Transition Matrix"
        value="0.0 0.1 0.1 0.3 0.5 0.1 0.0 0.1 0.0 0.1 0.4 0.3 0.3 0.1 0.2 0.3 0.0 0.3 0.2 0.1 0.0 0.3 0.5 0.1 0.0 0.5 0.1 0.0 0.8 0.1 0.2 0.5 0.0 0.3 0.0 0.3 0.1 0.2 0.3 0.0 0.1 0.5 0.6 0.0 0.1 0.0 0.1 0.3 0.0" />
        <parameter name="Apply Basic Weight" value="On" />
        <parameter name="Apply Vector" value="On" />
        <parameter name="Apply Conformity" value="On" />
        <parameter name="Apply Match" value="On" />
        <parameter name="Apply First Base Note" value="On" />
        <parameter name="Apply First Any Note" value="On" />
        <parameter name="Apply Avoid Self" value="On" />
        <parameter name="Apply Transition Matrix" value="On" />
        <parameter name="Apply Avoid Parallels" value="On" />
      <aspect name="Notes" type="0">
        <parameter name="Vector" value="Henon" />
        <parameter name="Style" value="0" />
        <parameter name="Scale" value="Major" />
        <parameter name="Tonica" value="0" />
        <parameter name="Minimum" value="36" />
        <parameter name="Maximum" value="96" />
        <parameter name="Rescale" value="On" />
        <parameter name="Default" value="0" />
        <parameter name="Dimension" value="2" />
        <parameter name="N_Durations" value="0" />
        <parameter name="Durations" value="" />
      <aspect name="Duration" type="1">
        <parameter name="Vector" value="" />
        <parameter name="Style" value="2" />
        <parameter name="Scale" value="" />
        <parameter name="Tonica" value="0" />
        <parameter name="Minimum" value="1" />
        <parameter name="Maximum" value="32" />
        <parameter name="Rescale" value="On" />
        <parameter name="Default" value="0" />
        <parameter name="Dimension" value="2" />
        <parameter name="N_Durations" value="0" />
        <parameter name="Durations" value="" />
      <aspect name="Volume" type="2">
        <parameter name="Vector" value="" />
        <parameter name="Style" value="2" />
        <parameter name="Scale" value="" />
        <parameter name="Tonica" value="0" />
        <parameter name="Minimum" value="0" />
        <parameter name="Maximum" value="127" />
        <parameter name="Rescale" value="On" />
        <parameter name="Default" value="0" />
        <parameter name="Dimension" value="2" />
        <parameter name="N_Durations" value="0" />
        <parameter name="Durations" value="" />
      <aspect name="Time" type="3">
        <parameter name="Vector" value="" />
        <parameter name="Style" value="2" />
        <parameter name="Scale" value="" />
        <parameter name="Tonica" value="0" />
        <parameter name="Minimum" value="0" />
        <parameter name="Maximum" value="320" />
        <parameter name="Rescale" value="On" />
        <parameter name="Default" value="0" />
        <parameter name="Dimension" value="2" />
        <parameter name="N_Durations" value="0" />
        <parameter name="Durations" value="" />

Vector types

yet to come.

tech_manual.txt · Last modified: 2014/06/17 21:53 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki