An algorithm for simulating music?

I'm interested in automatic music. I was thinking of a program in which, for simplicity, a large number of arpeggios with 1 bar were loaded (= sequences of fixed note lengths) and generated its own sequences based on what it learned.

To begin with, I know that I can use the letter (digram? Trigram?) Frequency analysis , it applies only to notes, and then generate my sequence based on frequency probabilities.

Are there any more advanced algorithms that you know about, maybe explicitly taught for musical sequences?

+5
algorithm sequences audio music
source share
5 answers

The Wikipedia article on Algorithmic Composition is an excellent primer. He describes some of the models used to create algorithmic music, well-known composers, reference books and software for composing algorithmic compositions.

http://en.wikipedia.org/wiki/Algorithmic_composition

+6
source share

As a musician myself and a major software developer, I can say that I can shed some cool light here: P I have done a lot of work on this issue and plan to do something big based on this in the future.

When you write an algorithm, your goal is to come up with an example of a solution; when sorting problems, it should have a sorted list. In an algorithmic musical composition, the solution (usually) is to have a song, or a pleasant melody, structure, etc.

The problem with the solution (hah) is that it is not only objective, but the solution is completely open. With the sorting algorithm, you have only one way to sort the list. With a musical composition, you have millions of enjoyable songs / whatevr, your goal.

Thus, you will need an algorithm that is good in order not to find the final solutions, but OPTIMAL. My suggestion is a genetic algorithm or similar. Genetic algorithms are great because they can create a pool of various optimal solutions.

You need to break the composition into pieces - have GA for the melody, GA for the rhythm, GA for the structure, etc. And design your fitness function according to your needs.

Of course, this is only one solution to the problem; there are many, and the wikipedia link listed above is a great start.

I recommend checking: GenJam: an improvisational jazz genetic algorithm designed to trade solo- http://www.it.rit.edu/~jab/GenJam.html

And this book is very instructive: http://www.springer.com/computer/information+systems/book/978-1-84628-599-8

I guess another interesting way would be with neural networks ... but providing them with sets will be a bit of a problem, maybe ... it works a lot more.

In any case, good luck with your projects: P

+4
source share

A statistical analysis of existing ones leads to music, which is well average. There is rarely something interesting there, because it tends to reproduce all the common features of what you analyzed.

Music is multidimensional. You can, of course, analyze any or all the measurements you are interested in. Step, pace, sequence of notes, harmonic progressions, volume changes, whatever. Everything.

The music is subtle and complex, so there is always something more to analyze.

AFAIK (my son is a composer), which is more interesting, is to invent your own unique algorithm for creating music that is reasonably distinctive.

My son specified something here. It generates a sequence of 48 musical events that are built around.

#!/usr/bin/env python """ there are 8, 3-note sets. each one can occur on 3 different beats. each pitch of the 3 note set can be in one of 3 octaves and it can either be a harmonic or a fingered note. """ import random noteSetChoices = [ "CEG", "CFA", "CEA", "DFA", "DFB", "DGB", "EGB", "FAC" ] beatChoices= [ "1 - - -", "- 2 - -", "- - - 4" ] octaveChoices= [ 1, 2, 3 ] techniqueChoices= [ 'Fingered', 'Harmonic' ] for n in range(48): note= random.choice(noteSetChoices) beat= random.choice(beatChoices) octave= random.choice( octaveChoices ) technique= random.choice( techniqueChoices ) print octave, note, technique, beat 
+2
source share

Although it is usually designed to work with longer sequences than one bar, the Markov chain is a simple, efficient way to generate music similar to its input. For an example written in Python using RTcmix to generate sound, see My implementation here .

It is based on the head of the Markov chain of Notes from Metalevel, excellent text in algorithmic composition.

+1
source share

It really helps if you know the conventions of music, so read books and articles written to teach people how to write songs. You will get great ideas.

Throw some point on the pedal at a time, and then to create tension. Use the age-old technique of answering a call between two different tools.

0
source share

All Articles