Articles

Music Hack for Max 7 - Elevator Music Generator

Stefan Brunner, one of our Berlin-based developers, attended Music Hack Day in London last week, and created a really cool patch that generates "Elevator Music" by downloading and mixing sounds from Freesound.org (using OAuth2). Stefan was kind enough to share his patch and this short tutorial on getting it work.
- ab

The Elevator Music Generator is an example patcher created for last weekend's Music Hack Day in London. It will generate an endless stream of completely meaningless music.

To achieve this great goal it needs to query the Freesound database. For this (and for downloading soundfiles) you need an OAuth2 authorization, a technology used all over the net, for example in Google Docs, Instagram etc.

And this is what this patcher will do: It starts by displaying a Freesound login window, handling getting the OAuth2 access token and looking for soundfiles defined by your tags (at the moment it will mix percussion loops with piano sounds) and downloading them.

Freesound also offers a nice way to get analysis data, for example the tempo of a loop, and in Max 7 we can use this information to time stretch the sounds to smoothly crossfade into each other. This gives you automatic beat-matching with very little effort.

One thing: for using this example you need to sign up for a Freesound account, and register your application to receive a Client ID and a Client Secret. Make sure to use the supplied freesound.org callback URL on the "Your application's callback URL" field. There are lots of simple ways this example could be extended, so I hope you enjoy.

Click to download Stefan's Elevator Music Generator

ElevatorMusicGenerator from stb on Vimeo.

by Stefan Brunner on December 19, 2014

Creative Commons License
Wetterberg's icon

bump for supreme code excellence. I look forward to tweaking this.

jonathan valdez's icon

great patch . look forward to learning from this one.

jtdancemusician's icon

At first I didn't understand what the Callback URL was, but I figured it out ... it is the following from the FreeSound.org site:

jose salinas's icon

i can't find the max for liven abet on live 9ç

joseph's icon

Very useful
Thank you for sharing this

mzed's icon

Great work.

The request url needs a trailing slash, like: "https://www.freesound.org/apiv2/oauth2/access_token/"

The patch is missing this, it should NOT be:
"https://www.freesound.org/apiv2/oauth2/access_token"

Udo Matthias's icon

could anybody help me?? it doesn't work

UM

Udo Matthias's icon

my email info@udomatthias.com