Posted on: 14. Feb, 2012 [ 10:00 ] - Last edit: 14. Feb, 2012 [ 10:03 ]

Making a music box in SuperCollider

I need to make a broken music box sound for a project of my wife. I didn't wanted to search the whole Logic sample library to find nice instruments, it was a good oportunity to make some sound design with SuperCollider. After making a little pattern for spawning some synths and chords (happy major melodies of course, it's a music box!) I started working on the sound. From a simple sine wave with a percussive envelope, the first change was to use a ringing filter and a trigger with a decay. This sounded already much better, because of the first attack. I later combined it with a very short array of sine waves with some harmonics slightly out of tune. Much better, but then I thought about filter the whole sound to damp a little bit the sound, making it less brilliant and sound more kind of broken. I didn't knew modulating the frequency of that filter would make such a difference. The sound started to be more natural, the percussive part at the beginning now much punchier and more broken sound, even if the sound was still bright, I think this did what I was looking for. You can look at the code below and try it out in SuperCollider