Introduction

The aim of this paper is to introduce the concept of “Strings Formulas” as a particular technique for algorithmic musical composition by describing its basic features and by showing how it can be applied to musical composition.

Ultimately, this paper aims to present a set of ideas and tools that may be useful to anyone interested in the field of algorithmic music.

The paper is divided in three main sections:

• Strings: describes the concept of strings.
• Strings Formulas: describes the lexicon, syntax, and semantics of formulas.
• Strings Music: analyses a musical piece entirely composed using this model.

I. Strings

The key concept that underlies this paper is the notion of “strings”.

Minimally stated, strings are sequences of elements capable of being reduced to a single formula or algorithm; therefore, strings are always the result of a formula or algorithm:

Formula = 3, 4, 7, 3, 8, 15, 2

As well as generating sequences of plain values, algorithms are capable of generating many different types of complex structures such as harmonies or phrase patterns.  I decided to give the name "Strings" only to those algorithmic resultants that are plain sequences or chains of values.

Moreover, throughout this paper the only type of sequences that are considered “Strings” are the ones defined by “Strings Formulas”, a particular type of formula that will be explained in the next chapter.

The specific difference, thus, between strings and any other sequences is that they are non arbitrary and that they are one-dimensional; their structure is always the result of a formula or algorithm and they always constitute a single chain of values.

Musical strings are those whose values are applied to musical dimensions (i.e. pitch, rhythm, dynamic, etc.), and “Strings Music” is a music where its elements are defined by strings.

Strings Music can be considered as a particular instance of algorithmic music.

II. Strings Formulas

Overview

A string formula is a particular way of expressing an algorithm for generating sequences of values or “Strings”.
```
>6_+3
|
-4_+5_8_2
|    |
+3_-1   +1
|
7

```

I invented these formulas inspired by Mayan hieroglyphs which I discovered in a visit to the anthropological museum of Mexico City.

The purpose of Strings Formulas is to gives us the ability of expressing complex and coherent strings by means of very simple structures in the same way as chemists and physicists can express complex relations and structures by means of simpler formulas and equations.

Here is an example of a string formula that produces a string of 8 elements:

```
5_4
|
>0_3  =     0,3,2,5,0,3,8,4
|
2_8

```

The following one, with the same constituents but a different structure, outputs a string of 24 elements:

```
>0_3  =     0,3,2,5,8,3,0,4,2,3,8,5,0,3,2,4,8,3,0,5,2,3,8,4
| |
2 5_4
|
8

```

This one, with just 10 elements outputs a string of 192 values:

```
>0_1  =     0 1 2 3 5 1 0 4 2 1 6 3 0 1 2 7 5 1 0 3 2 1 6 4 0 1
| |        2 3 5 1 0 8 2 1 6 3 0 1 2 4 5 1 0 3 2 1 6 7 0 1 2 3
2 3_4      5 1 0 4 2 1 6 3 0 1 2 9 5 1 0 3 2 1 6 4 0 1 2 3 5 1
|   |      0 7 2 1 6 3 0 1 2 4 5 1 0 3 2 1 6 8 0 1 2 3 5 1 0 4
5_6 7_8    2 1 6 3 0 1 2 7 5 1 0 3 2 1 6 4 0 1 2 3 5 1 0 9 2 1
|    6 3 0 1 2 4 5 1 0 3 2 1 6 7 0 1 2 3 5 1 0 4 2 1 6 3
9    0 1 2 8 5 1 0 3 2 1 6 4 0 1 2 3 5 1 0 7 2 1 6 3 0 1
2 4 5 1 0 3 2 1 6 9
```

All values in the above string are the same as the values in the formulas.

Variety in the resulting strings can be achieved by using relative values in formulas.

The following example is a formula with the same structure as the previous one, but all of its values are relative, generating a much more interesting string:

```
>+7_-5            7 2 6 7 15 10 17 8 12 7 0 1 8 3 7 9 17 12 19
|  |             20 24 19 12 3 10 5 9 10 18 13 20 12 16 11 4 5
+4 +1_-9         12 7 11 2 10 5 12 13 17 12 5 7 14 9 13 14 22
|     |          17 24 15 19 14 7 8 15 10 14 9 17 12 19 20 24
+8_-7 +2_-8      19 12 3 10 5 9 10 18 13 20 22 26 21 14 15 22
|       17 21 12 20 15 22 23 27 22 15 7 14 9 13 14 22
-5      17 24 15 19 14 7 8 15 10 14 16 24 19 26 27 31
26 19 10 17 12 16 17 25 20 27 22 26 21 14 15
22 17 21 12 20 15 22 23 27 22 15 17 24 19 23
24 32 27 34 25 29 24 17 18 25 20 24 16 24 19
26 27 31 26 19 10 17 12 16 17 25 20 27 29 33
28 21 22 29 24 28 19 27 22 29 30 34 29 22 17
```

Strings formulas are able to describe large and complex strings by just structuring a few elements. This feature can be interesting for granular synthesis or algorithmic composition as will be described in the last section of this paper.

I have developed a computer program that reads formulas described in a simple text document and generates the corresponding strings. This compiler is very useful for dealing with formulas that generate big strings of values.
Also, I developed an extension to that application in order to use string formulas for generating Csound scores.

Both the compiler and the module for Csound score generation are described in the appendix of this paper.

To understand fully the strings formulas we need to analyse them as a language by focusing on their particular lexicon, syntax, and semantics.

Lexicon

Strings Formulas make use of a small number of characters to describe strings.
As positions of characters are essential for the meaning of a formula, it is necessary to use a fixed character size font like “Courier”

The following is the list of symbols that can be used by a formula to express a string:

 Character Name Meaning > Starting mark Specifies the starting value of a string formula. 0 - 9 Absolute values Absolute values to be sequenced into a string. _ Horizontal connector Joins two values in a row. +, -, *, / Operators Turn values to be relative (, ) Groupers Enclose sub-strings

Syntax

Next, there is a list of simple syntactical rules which must be followed in order to produce well-formed Strings Formulas. Each rule is accompanied by examples of pertaining valid and invalid formulas.

List of Syntactical rules:

• Each formula must contain only one starting mark.

• Valid formulas:
```
>1_2        2_5
|          |
3          >4
```
• Invalid formulas:
```
1_2         >1_2_3      >>0_3_4
|            |              |
3           >3_7            7
```
• No character must be placed immediately before a starting mark.

• Valid formulas:
```
1 >2        0__5
|  |        |  |
6__3        3 >8_7
```
• Invalid formulas:
```
1>2         1_>2
| |            |
6_3            3
```
• A starting mark must be followed by an absolute or relative value.

• Valid formulas:
```
>1_3_5      >+6_9
|   |      |
2   -2_3   8_+3
```
• Invalid formulas:
```
>_4_5       >|
|         5_3
2
```
• Each formula must contain at least one value.

• Valid formulas:
```
>1          >+1
```
• Invalid formulas:
```
>           >_          >+
```
• All values in a formula must be connected. If the value is relative - i.e. has an operator to the left – then vertical connectors must point to the operators.

• Valid formula:
```
+6_1
|
>+1_4_-7_9_+2
|    |
-7_4  3_+2
|
7_-1
```
• Invalid formulas:
```
>-1 _2      >1_+2       >1_+2
|                      |
3        +3           3
```
• Values can have only one operator.

• Invalid formulas:
```
>+1-_2      >1_+-2
|          |
3          +3
```
• Operators must be placed before values.

• Invalid formulas:
```
>1-_2         >1_2+
|             |
3             +3
```
• Connectors must always connect absolute or relative values.

• Invalid formulas:
```
>+1_        >1_+2_
|               |
3               +3
```

Semantics

This section describes the semantics of string formulas by showing how strings are originated from formulas.

How is it that a certain formula outputs a particular string?

```
>1_2 = 1 2 1 3
|
3
```

Strings Formulas use a mechanism that might be called “exhaustive looping process”, meaning that they loop values in concatenated rows and columns until all the formula’s values are expressed in a string.

Loops in a formula can be linked horizontally and vertically by means of connectors.

The following table describes the steps that occur in the process of string generation from a formula:

 Step Formula String Comments 1 ``` >1_2 | 3 ``` ``` 1 ``` The formula starts with the value designated by the starting mark (>) 2 ``` >1_2 | 3 ``` ``` 1,2 ``` The next value in the row is returned, which at the same time is the first value of the next column (second loop) 3 ``` >1_2 | 3 ``` ``` 1,2,1 ``` As the end of the first loop (first row) has been reached, and as there is no vertical loop in the first column, the first value of the row is returned again. 4 ``` >1_2 | 3 ``` ``` 1,2,1,3 ``` Now, the second value of the second loop (right column) is returned. Here the string ends, since continuation will imply repletion of the same pattern for ever.

The next one describes the steps for a different formula containing some relative values:

 Step Formula String Comments 1 ``` >5_+3 | | 6 2 | -4 ``` ``` 5 ``` 2 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8 ``` The resulting value is a sum of the previous string value and the current value. 3 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6 ``` 4 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2 ``` 5 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5 ``` 6 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1 ``` Now the resulting value is the subtraction of the two last values (5 – 4) 7 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6 ``` 8 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6,9 ``` Again, the sum of the two values (6 + 3) 9 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6,9,5 ``` 10 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6,9,5,2 ``` 11 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6,9,5,2,6 ``` 12 ``` >5_+3 | | 6 2 | -4 ``` ``` 5,8,6,2,5,1,6,9,5,2,6,2 ``` (6 -4)

Notice again that the use of relative values enriches the variation of the elements contained by output strings. Also notice that all values in a formula can be relative.

Once understood, the mechanics of String Formulas appear as very clear and straightforward. Most formulas’ results (strings) can be deduced within a minute.

The computer program that I have developed is very helpful to calculate in seconds strings from complex formulas that otherwise will take too much time to resolve.

IV. Strings Formulas Applied to Music

The aim of this chapter is to show how strings can be used in musical composition by analysing an electro-acoustical piece composed using this technique.

The piece that we are going to briefly analyze consists in 3,145,632 notes arranged in 3:15 minutes. All pitches, dynamics, and spatial locations of notes are defined by strings.

The sound material used throughout the piece consists in a simple string sound (in the traditional meaning of the word) generated by Csound’s pluck opcode which uses the Karplus & Strong algorithm. An envelope is applied to the pluck sound in order to soften its attack.

My Strings formulas compiler was used to generate all Csound scores from the specified formulas described in text files.

All sound synthesis, sequencing, and mixing were done using Csound without any help from third party software or tools.

Everything was composed using a standard laptop computer running Windows, Java, and Csound.

Material

This piece uses 8 formulas which output 8 strings of 96 values each.
The resulting strings are used to define all pitches, dynamics, and spatial location values of the piece.

Here is the list of the 8 formulas and their resulting strings.

 Formula String A ``` >(0_2)_(0_4_9)_(0_2)_(0_4_9) | | | | | | 4 5_7 2_5 9_4 5 5_2 | | | | 9 7 7 7 ``` 0 2 4 5 9 2 0 7 4 2 9 5 0 2 4 7 9 2 0 5 4 2 9 7 0 4 9 2 4 9 0 4 9 5 4 9 0 4 9 2 4 9 0 4 9 7 4 9 0 2 4 5 0 7 9 2 0 5 4 7 0 2 9 5 0 7 4 2 0 5 9 7 0 4 9 0 4 2 0 4 9 0 4 5 0 4 9 0 4 2 0 4 9 0 4 7 B ``` >(0_-4_+9)__(0__+2)_(0_-4_+9)_(0__+2) | | | | | | +5_+2 -9_-4 +5 -2_-5 -4 +5_+7 | | | | +7 +7 -7 -9 ``` 0 -4 5 0 -4 -2 0 -4 5 0 -4 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 -7 -16 -18 0 -5 -9 -16 0 -2 -11 -16 0 -7 -11 -13 0 -5 -14 -21 0 -4 -13 0 -4 -6 0 -4 -13 0 -4 -9 0 -4 -13 0 -4 -6 0 -4 -13 0 -4 -11 F ``` >(0_+4_-9)__(0__-2)_(0_+4_-9)_(0__-2) | | | | | | -5_-2 +9_+4 -5 +2_+5 +4 -5_-7 | | | | -7 -7 +7 +9 ``` 0 4 -5 0 4 2 0 4 -5 0 4 -1 0 4 -5 0 4 2 0 4 -5 0 4 -3 0 -2 2 -3 0 -7 2 0 0 -5 -1 -8 0 -2 7 2 0 -7 -3 -5 0 -5 4 -3 0 4 -5 -3 1 -8 0 4 -5 0 4 -5 0 4 -5 -3 1 -8 0 4 -5 2 6 -3 0 -2 2 -3 6 4 0 -7 -3 -5 4 -1 0 -2 2 -5 4 2 0 -5 -1 -3 6 -1 G ``` >(9__-7)__(9_-5_-0)_(9__-7)_(9_-5_-0) | | | | | | -5 -4_-2 -7_-4 -0_-5 -4 -4_-7 | | | | -0 -2 -2 -2 ``` 9 2 -3 -7 -7 -14 9 7 2 -5 -5 -9 9 2 -3 -5 -5 -12 9 5 0 -7 -7 -9 9 4 4 -3 -8 -8 9 4 4 0 -5 -5 9 4 4 -3 -8 -8 9 4 4 2 -3 -3 9 2 -3 -7 9 7 7 0 9 5 0 -2 9 2 2 -2 9 7 2 -5 9 5 5 3 9 4 4 9 4 -3 9 4 4 9 4 0 9 4 4 9 4 -3 9 4 4 9 4 2 H ``` >(9_+5_+0)__(9__+7)_(9_+5_+0)_(9__+7) | | | | | | +4_+7 +0_+5 +4 +7_+4 +5 +4_+2 | | | | +2 +2 +2 +0 ``` 9 14 14 9 14 21 9 14 14 9 14 18 9 14 14 9 14 21 9 14 14 9 14 16 9 16 21 25 9 11 11 18 9 13 18 20 9 16 16 20 9 11 16 23 9 13 13 15 9 14 14 21 26 26 9 14 14 18 23 23 9 14 14 21 26 26 9 14 14 16 21 21 9 16 21 25 25 32 9 11 16 23 23 27 9 16 21 23 23 30 9 13 18 25 25 27

Structure and Form

A layer, in this piece, consists in two superposed sequences of 6144 notes with all pitches, dynamics and spatial locations defined by the values of the 8 strings. Those long resulting sequences can be considered themselves as huge strings.
Both sequences use 8 times each of the 8 strings arranged as follows:

1: AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFFGGGGGGGGHHHHHHHH
2: ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH

Each letter represents one of the 8 previously described strings containing each of them 96 elements or notes. The concatenation of each individual string constitutes a large string.

Rhythmic values have been arranged in a way so that each repetition of a string in a sequence is altered in its rhythmic values in an exponential proportion.
In the following graph, each segment represents a string. The duration of the strings is represented by the length of the segments. Each colour represents one of the strings defined in the previous table.

As each segment has the same amount of notes, the difference of rhythmic values among different segments can be considered also as a difference in the density of notes over time. Shorter segments in the above graph have a greater density of notes than longer ones.

As densities of notes across the piece change in an exponential proportion between segments, this graph shows the notes density over time for the two layers’ sequences using exponential envelopes.

Graph of densities over time for sequence 1

Graph of densities over time for sequence 2

Graph of densities for one layer (sequence 1 and 2 combined)

Click here to listen to an audio sample of a single layer.

The layer described above constitutes the main or central layer of the piece.
The piece contains a total of 15 layers that sound simultaneously.
Each layer has the same structure and they are differentiated only by their overall pitch, intensity and velocity.

The central layer is in the middle of the fifteen layers, so we will call it layer 8. This layer is the only one that is played once.
Layers above layer 8 are repeated in an exponential proportion. Layer 9 two times, layer 10 4 times, and so on.
Layers below layer 8 are played partially also in an exponential ratio. Layer 7 0.5 times, layer 6 0.25, and so on.

Here is a table that describes how layers are arranged around the central layer.

 Layer Times Pitch Volume Notes 15 128 128 0.0078125 1572864 14 64 64 0.015625 786432 13 32 32 0.03125 393216 12 16 16 0.0625 196608 11 8 8 0.125 98304 10 4 4 0.25 49152 9 2 2 0.5 24576 8 1 1 1 12288 7 0.5 0.5 0.5 6144 6 0.25 0.25 0.25 3072 5 0.125 0.125 0.125 1536 4 0.0625 0.0625 0.0625 768 3 0.03125 0.03125 0.03125 384 2 0.015625 0.015625 0.015625 192 1 0.0078125 0.0078125 0.0078125 96

The following graph intends to give a picture of the densities of the 15 layers sounding simultaneously.
This picture represents the formal structure of the piece.

Click here to listen to the first movement of the entire piece.

As can be seen on the previous graph, the formal structure of the piece can be understood as different layers of compressions and rarefactions which produce a kaleidoscopic effect of separated elements which sometimes reveal their individuality and sometimes join with other layers producing “explosion” effects.
Those moments, where different layers reach their maximum compression state at the same moment, can be thought as nodes. Layers can also be thought as different strings of a musical instrument which vibrate at different frequencies and the piece itself can be considered as the instrument where those strings vibrate.