Coolest Silverlight Sound Library for Games I’ve Seen Yet

Jun 10, 2010

Quite amazing demo: 

The library has a lot of potential for Silverlight games. It does MP3 decoding in managed code and exposes some cool controls like Pitch, Echo. Duet is my favorite. I’m also a Transformers fan and like how Duet makes explosion and swoosh sounds sound “Transformerish”.

I believe it should solve the “short sound” and “looping music” issues with Silverlight without any problem :). The biggest coolness though is that you can now simulate doppler effects and have more “rich” sound in smaller package (for example, by keeping only one explosion.mp3 and varying the pitch slightly).

The CPU usage on my quad core q6600 is ~1-2% of one core for most of the effects. 11% for the Pitch and 8% for the duet.

You can download the source code here: (MIT License)

Edit: another library, just released under CDDL License:

Playing The Piano From Scratch

May 25, 2010

Yes! For the last month or so I have been studying the piano. Here are my first 2 pieces:

This is the reason why I haven’t done anything public in Silverlight recently. I’ve been also experimenting with the new Expression Blend and Phone 7 stuff.

Note that I started from 0 (zero) :) about 2 months ago, all by myself so coming from “Marry Had a Little Lamb” to the above music was definitely a trip and fun!

They are licensed under CC-BY-SA license. I’ll probably switch it to something even more permissive later.

Contents Of This Rather Long Post


Key Takeouts For Music – Nokola’s View

Key Takeours For Composers – Nokola’s View

Skills and How Piano is like Role Playing Games

3 Major Cheats For Beginners

Resources And Inspiration



Here is a summary of my experiences:

  • Piano playing can be very addictive. I started with the goal to play one song (the Meadow from New Moon) and ended up doing a lot of stuff.
  • It’s definitely not hard and it’s better if you like it :)
  • Playing with teacher or following “excercises” is not fun. I always did what I felt like – a lot more fun and I believe helps with development.
  • Composing your own stuff is not as hard as I thought, once you learn some “tricks”. It is a lot like software development :)

I started trying to play The Meadow, but after the first note line, decided to buy a book. Then got a “Learn & Play Keyboard“ – a book for absolute beginners that describes notes, durations, etc. The nice thing about it is that you can start playing immediately with 3 fingers and it builds nicely on top of that.

After finishing this (relatively) small book in about a week, I searched online and found this amazing piano course:

It’s one of those long sites that offers a lot of stuff with buy buttons and initially I thought it’s “just one of those buy now sites” but after researching I decided to buy the 10 books for ~$40… It was great! The author focuses on “getting the feel of music” from the start, not notation, reading and boring exercises. You begin to improvise almost from the start – great for having fun at your own pace! He will teach you several rhythm patterns then give you “chords” (chords are typically 3 or 4 notes pressed together) for common songs (Beatles, and many many other) so you can experiment. The nice thing is that you can actually understand why a music is composed the way it is, what sounds nice together (to some extent), etc.

After going through books 1-3 I decided to give The Meadow another try! It was much better this time, since I could recognize the patterns and didn’t have to just blindly memorize the notes from the sheet anymore (in fact I play a little different version of The Meadow since I didn’t pay 100% attention to the sheet all the time and probably deviated here and there).

The books contain also a lot of “tricks” “cheats” or “shortcuts” that basically help you “do the job” or “fake it” (produce nicely sounding things with not-so-much effort), which I liked a lot. There is some song that is amazingly simple and sounds (and looks) complex when played.

The key takeouts for music so far (for me):

  • Chords are groups of several notes (e.g. C, E, G) that sound nice together.
  • It doesn’t matter where the notes of the chord are located on the keyboard as long as their name is the same. For example, you can play C at the “bottom” of the keyboard, and E, G at the middle; or you can play the E at the top of the keyboard and G in middle – it’s still the same chord (C, E, G). This is crucial when “mixing” tones as you have much better knowledge of what tones mix “nicely” and what don’t.
  • By modifying a chord a little you can make it sound “mellow” “sad” “happy” or add “tension” (this is the feeling of “something not 100% right” when playing that can later “resolve” to the chord without tension)

The key takeouts for composing music (for me):

  • Composing can start with a very simple (3-4 seconds) melody that can be “enhanced” by using what I call “piano techniques” (not sure what other people call those):
    • Echo: Moving the melody up or down one octave (12 notes)
    • Key Shift: Very powerful technique, as it changes the mood dramatically. I don’t have this in the 2 songs above yet, but I did it last week in the Unbreakable Love and it sounds much improved! “Key shift” is just moving the melody few notes (not an octave) up or down. It works best if your transition between keys does not “jump” notes. For example if you switch from key A to key E, you can play a melody that somehow goes from A to E then shift. Imagine playing a Storyboard and suddenly have your animation jump – who would want that? Ideally, you would make your animations smooth and nice.
    • Time Shift: getting a bit sci-fi here :) Timeshift is just playing the melody gradually faster or slower in order to convey a feeling. It’s used in The Meadow (at least I do) after the second part of the song
    • Pitch Shift: Sometimes, you can add “color” to the music by quickly moving through one or more half-tone notes. For example, you can C, C#, D instead of C,D. It can add a “weird” mood feeling (“something is wrong”) which can make the music more interesting
    • Broken Chords: This just means “play C, then E, then G” instead of all 3 at the time. You can also “break” by playing C, then EG, or some other way. Broken Chords are also called Arpeggios
    • Crawl: If you play with both hands, and slow down one of them significantly (e.g. the right hand), you may end up with a completely new melody that sounds close to the original. One of my last week’s findings (no public music yet) :) Crawling makes music more “dramatic” and “determined” IMO. Or it could do for a sad ending or whatever :)
    • Burst: If you’re in a crawl (or just regular play), you can drastically increase the speed of some of the notes in the melody (it creates a new, similar melody)
    • Repetitions: I had some trouble (and still have) repeating notes – in fact it can help a lot with the music. On few occasions I’d find myself unable to find the “right” note when it was exactly under my finger :)
    • Chord Progressions: probably one of the most defining traits of your music. Progressing between chords means to switch from one chord to another, somehow. The “somehow” leaves a lot of room for interpretation. Given that a chord can be played in many octaves, across octaves, there is a lot of variation. I think a good way to start is by trying to change chords with the minimum number of note changes (e.g. from C, E, G to C, E, A)
    • Duplication: This means playing the same note (e.g. C) on a different octave. You can also do this with chords and play CCEG instead of just CEG.
    • Chord mode on/off: This is when you switch from playing melody to playing chords (happens for 2 times in Unbreakable love). Good when you want to “end a chapter” of the song and continue to the next.
    • Other: there are a lot other I don’t know (e.g. intervals, tremolo fired runs, fills, riffs or whatever else people are doing on youtube)
  • Be free to explore – for example, go one of few notes up and down when playing a melody, many times it sounds a lot more interesting this way
  • Songs usually follow a pattern, for example AXYXYXZ (or other) where X is one melody, Y is “choir” and A,Z are beginning and ending. You don’t have to follow the pattern just for the sake of it, but it sounds nice sometimes.
  • Try to “build up” the melody – for example if it’s “firm and strong” at the beginning, getting more soft towards the end, you probably may want it to get progressively “softer” (as compared to jumping from “strong” to “soft” all the time – unless that’s the point)
  • Try to vary the melody just a little bit – the brain, a very good pattern matching machine feels “engaged” with subtle variety. I read somewhere (don’t remember the source) long time ago that classic compositions usually start with a pattern that rarely (if ever) repeats in its original form until the end, thus keeping the brain engaged “looking for the right pattern”.
    • Make different by not completing – for example, start with half the melody and then add more of it as the song progresses or vice versa (or just skip/add tones as appropriate)
    • Make different by slight changes – changing a note here and there can add enough difference to make the music a whole lot interesting. For comparison with Silverlight, imagine having an animation of a rectangle going back and forth for 10 seconds. Now imagine another animation that builds on top of the first by changing the shape of the rectangle towards circle slightly form time to time. Which one would you be more likely to watch longer?


Piano playing is like software development (which is like RPG games). Thus, piano playing is like RPG games.

For example, you can use C++, but you may use only it’s “C” part (not the object oriented aspects). Thus learning object-oriented programming is a skill (like in RPG “Fireball Level 3” would be a skill). Piano is the same – you can press the keys but by learning skills you can advance your character level.

Here I will define 3 classes that can be useful to think about when starting with piano:

  • Pianist: master of piano skill and live performances
  • Bard: a great singer (alone or in choir) with good command of an instrument
  • Synthetron: master of computers and synthesizers capable of producing a complete score with many instruments, part by part. May not be necessarily good with live performances though.

There are also 2 life-paths available:

  • Performer
  • Composer

For example, you can be a Pianist Composer or a Bard Performer! :)

Here’s a list of few not-so-obvious skills (at least for me) that can bring you to the next level. Search on the web to find our how to improve those if you’re interested:

  • Relative Pitch: Allows you to name any note in relation to another. For example if someone plays C and tell you it’s C. Then plays E, and you can tell that it’s E, since you can tell how much the second note played was apart from the first. Must-have for the Bard class and overall very good to posess for Pianist and Synthethron too. Choirs tend to “sag” in pitch so having a good relative pitch allows you to sing along.
  • Absolute Pitch: (1) Allows you to name any note when played. (2) Allows you to sing any note (provided you can sing) when named. This is a 2-blade skill, since choirs and pianos go down or “sag” in pitch over time. Then they might sound weird to you. Thus I would apply this skill to Synthetrons or Pianists in possession of electric piano (since these don’t sag in pitch). The big plus is that you can compose music in your head and “hear” music by reading – cool huh? :)
  • Autonomous Hand Control: The name of this implies this skill would be useful for the Synthetron class, although it’s most useful for the Pianist. Having good separate control over both your left and right hand when playing allows you to put your left hand on “auto-pilot” (accompaniment mode) while thinking up a melody with the right hand. Also helps with some of the techniques (such as speeding or slowing down a melody with one hand only).

Obviously, you can expand the list of classes, paths and skills more – I’m interested to hear what people would come by.

Major Cheats for Beginners:

  • Overlaying strings over piano (even cheap keyboards nowadays have this), makes mistakes pop out much less
  • Many other cheats in the books (like ballad based on pentatonic scale, where you can hit any note from a huge selection, in any order and it sounds good). These tricks are explained there…
  • I think there’s no need to always try to follow books and tutorials. Take the best of them and move on. For example, I paid very little attention to proper hand posture (after reading that my hands should be “like holding an apple”). My hands were stiff but after 2 weeks they feel lot more smooth and natural without any effort to keep the posture (if you don’t, your fingers start to hurt and the sounds are not so nice so it’s a self-fixing issue:)
  • Youtube is an amazing source of techniques you can use later in composing

Here are a few:


Also some of the master’s works:

This one from ear with lots of improvising based on music from Transformers:

Another interpretation by ear of the same song:

Official Soundtrack to New Moon (The Meadow):

Hope you like it! Please comment! | Terms | Log in


About the author

Happy & enjoying life. Software enthusiast.
The opinions I express here and on are mine and not my employeer's (Microsoft).
This is the official blog of You can find Silverlight samples, coding stuff, and hopefully other interesting things here.