Monday, May 5, 2014: Creating Music with Algorithms and Mathematics

Just playing with http://studio.substack.net/, a Browser Synths with Code Studio. It is a website where you enter JavaScript code and it generates sound from it.

Here’s what I came up with.

Do You Hear the People Sing? (Uplifting Mix)

Inspired by another code, DUHearThePeopleSing, which comes from the song Do You Heart the People Sing from Les Miserables I created a version with sawtooth synth arpeggios and beats.

Do You Hear the People Sing (Uplifting Mix, v1.3)

I created this song in a declarative, functional approach. Each synthesizer is simply a function (such as sine, sawtooth) that takes the time and returns the sample. These synthesizers are filtered and mixed through a higher-order function. Finally, I ended up with a function that represents the music itself.

Since writing a lot of function() {} things are so cumbersome, I decided to develop it using CoffeeScript instead. Here is the source code in CoffeeScript.

Interactive Version

I added some hack to it to allow mouse position to be captured. I used the mouse position to control the highpass/lowpass filter and some stuttering beat effect.

Do You Hear the People Sing (Uplifting Mix, v1.31)
(Interactive Version)
(move your mouse around!)

Rising Arp

A fat sawtooth arpeggio that keeps rising in frequency. After one minute, it somehow turned into some kind of non-melodic sound.

Rising Arp

Infinitely Descending Chord Progression

This music features a chord progression that keeps descending.

It goes like this: C/E, Cm/Eb, A#/D, A#m/Db, G#/C, G#m/B, …

However, the chord progression seems to keep descending without ending. This is possible by an auditory illusion known as Shepard tone.

Infinitely Descending Chord Progression (v1.1)


There are a lot of other nice sound, which you can find in /-/recent.