Saturday, 12 December 2009

Arsenic Gourmet Manifesto

It's been a while since the last post. Today I want to make explicit
some choices or decisions I have made about the Arsenic Gourmet
software.

First of all, the perimeter of what the software will do has to be
defined. I intend Arsenic Gourmet to be only a music scores generation
system. I don't think that it is interesting to add to it play-back
modes.

The input of the system will be the score specification, that is the
style, the length (in time) the mode (major, minor, etc.), and so on
so forth. All the possible choices will be defined by lists. It would
also useful to have a wizard mode, instead of using configuration
files as input, but this will come later on.

The output of the system will be a Lilypond file, so that the paper
score can be generated and a MIDI file can also be produced.

The score generation engine will use Artificial Intelligence
techniques and will probably be based on a rule-based expert system,
but with some random behavior.

A long term goal is to make the system learn from existing scores in
order to derive itself the production rules.
The system will be written in Python because of all the well known
advantages of this programming language, but mainly because I know
it.

There will be no graphical user interface at the beginning.

Saturday, 12 September 2009

Musical Scales

As I wrote in my introductory post, there are well known rules for building scales, at least for western music. There is a very intersting introductory material here.

Actually, the link above describes only the major and minor modes, but there are really 7 of them defined by the Greeks. They are:
  1. Ionian (major),
  2. Dorian,
  3. Phrygian,
  4. Lydian,
  5. Mixolydian,
  6. Aeolian (minor) and
  7. Locrian
The origin of these modes can be read here. It is also interesting to have a look at the Wikipedia entry for musical modes.

These rules could be easily coded in order to produce melodic sequences on a given key.

Wednesday, 9 September 2009

Pond, LilyPond

LilyPond just does that: it prints music in the best traditions of classical engraving with minimum fuss. Don't waste time on tuning spacing, moving around symbols, or shaping slurs. Impress friends and colleagues with sharp sheet music!

Well, for me LilyPond is more than that. It uses a markup language which allows another program to write musical notation. And that is exactly what we need as output for a music generator software.

For example, this code snippet:
{
c' e' g' e'
}
Produces this (as a pdf file):

Of course, one can produce more complex things, with chords, several staffs, lyrics, etc.
In order to generate MIDI output, you can just add a "\midi" tag in the LilyPond code. Just as easy as that!

Sunday, 6 September 2009

Automatic music generation

Back to the time of Pythagoras, music was numbers, therefore, perfection. Nowadays, numbers are mainly related to computers.

If you have a look at music theory books, you will see that music follows patterns. There are simple rules to produce a given scale, be it major, minor, harmonic, melodic, etc. There are also definitions of what a prelude is. When you say, "a blues in B", the band knows what to play. And so on.

So numbers and patterns used together allow to analyze music. Thus, it should be possible to generate music with a computer: get some numbers, use known patterns, put some randomness and there you go.

I am not a musician. I just play a little bit of classical/flamenco guitar. I have heard about software like "Band in a box" or Impro-visor which, as far as I know, do generate solos and/or play-back music on a given grid of chords.

The goal of this blog is to put together ideas on how to build a "Music Generator", that is a software which allows you to select a set of options (key, music style, etc.) and "composes" a piece of music. Ideally, one should be able to select to generate music "in the mood of" some musician (Mozart, Chuck Berry or Paco de Lucia).

So we will need to see the state of the art in music software, learn some music theory and start writing code ...

See you soon.