Sunday, November 26, 2006

Mathematics Is Music

Warning: If you do find that the sound generated by the program is too satanic, please abort immediately.

The idea is simple. It is to prove that if you love mathematics, you don’t need the musical talent to compose a song.

The algorithm:

Binary melody;
Sound tone
Integer digit;
Data array key c, c#, d, d#, e, f, g, g#, a, a#, b, b#, C, C# …;

Input step, base, start, modulo, mode, note, scale, hold, instrument, speed, volume;

Do while not stop

Melody = binary(start) base;
Digit = sum of numbers in melody;
Tone = key(digit);

start = start step modulo;

Loop while


This is the sound generated under step = 1, base = 5, mode = all, note = d’, scale = major, hold = normal, instrument = grand piano, speed = 1/1:

This is the sound generated under step = 1, base = 5, mode = all, note = c’, scale = penta, hold = pedal, instrument = harpsichord, speed = 1/1:

The combination of both sound:

This song is generated under step = 16, base = 2, start = 47, mode = rising, note = g#, scale = major, hold = normal.

The output was quite amusing because I discovered chords that I have never seen/heard before and they are A#m69 and D#m69 and lotsa add9 and sus6 chords. I’ve checked the program again and again and I did not find any syntax and logical errors. I also called up my cousin who is well-versed in music asking are these chords existed and he told me that they do. The sound too is quite rhythmic that I rearranged it with more instruments. I decided to name this song: Malam Untuk Posisi 69 or A Night For Position 69 … hehehehe
There! Mathematics is Music :-)

All songs generated by the program will be posted on my other blog Halusi Matematika –