Dan Price (thwack) wrote,
Dan Price

  • Mood:

"All of Me" MIDI 3D

This started as an attempt to figure out how to create a "piano tutorial" as it is often requested on YouTube. After looking at a few other tutorials for ideas, I saw one that included a piano roll animation, turning piano playing into somewhat of a Guitar Hero style game. As it turns out, Synthesia is exactly that. Who knew!

So I started down that path, but I ran into problems with the video capture quality of Synthesia's animation. In a moment of deep thought, I got distracted by the idea of doing Synthesia's work myself. What would it really take? It's just reading a MIDI file as input, right?

With a little searching, I found analoq's video and blog post about using a Python script to import MIDI data into Blender. Sweet!

With that script as a starting point, I made a few tweaks to the code to make the note objects look the way I wanted, then ran it to generate all 2026 notes in 3D space. Next came the matter of animating it. :)

At first I wanted to use the particle system to make each note shoot out sparks as it played, but that proved to be too daunting for me, at least this time around. Instead I settled on having a cursor object scroll through the scene, lighting up the notes as it passes through them.

At some point I decided to go interpretive with the opening section, having the camera fly around and using the scene composition rather than the cursor to follow the notes. The problem I ran into after that was how to make the camera switch between free-flying animation and tracking to the cursor. For example, in one frame I might have the camera at an XYZ coordinate way down the field, but in the next frame its coordinates need to become zeros because it's going to become relative to the object it's tracking (the cursor, for example). In some spots I ended up using trigonometry to figure out what the camera's rotation needs to be when untracked to match up with the previous frame in which it was tracked and aiming at a target object. That made for some interesting IPO curves. In hindsight, I think I learned that it would have been much easier to have the camera always track/follow something, and never give it direct animation properties.

By the way, the sudden, brief backward motion of the camera near the end wasn't the result of difficulties with animating the camera... I did that intentionally to snap people out of any trance the might be in before the camera swings around to its ending angle after having been steady for so long.

Now the question is... What useful things can I do with what I learned? LOL
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.