Search Unity

Realtime Animusic like project, 2 scenes, still in early stages

Discussion in 'Made With Unity' started by NathanWarden, Dec 18, 2010.

  1. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Hey all, I don't know how far this is going to go, but, here's a couple of scenes that I've been working on the past few days. This project is in the very early stages so pretty much everything is proxy. I threw a few instruments in since I already had them modeled.

    This is reading a midi file and animating the lights / instruments based on the data read in.

    I plan on adding more effects like particles, maybe some ice shattering effects for the Echo song, but, who knows what will pop into my head.

    Anyway, hope you enjoy it, and I hope you enjoy the ABC song for the first time since you were a kid :)

    http://web.mac.com/nathanwardenlee/Unity/Midi/Midi.html

    Thanks,
    Nathan
     
  2. Londy

    Londy

    Joined:
    Jan 24, 2010
    Posts:
    108
    Error :S
     
  3. Seraphim

    Seraphim

    Joined:
    Sep 18, 2009
    Posts:
    137
    I love it, but what is it for?
     
  4. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Hi Londy, you may want to take a look again, I think I posted this right before it finished uploading... oops :)
     
  5. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Thanks Seraphim, it's just for fun right now :) I love animusic and my friend and I wanted to try this for ourselves. So it's really just a hobbyist side project, and of course, looking to make a good portfolio piece ;)
     
  6. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Finally posting an update...

    In this update:

    - The Grand Piano scene is mostly done.

    - Several songs to choose from for the Grand Piano scene.

    - The Grand Piano scene has several songs now that show that it implements most of the necessary Midi features such as tempo change, namely in Moonlight Sonata.

    - Can hide pretty much all of the interface while the song is playing

    - Added a playback control with the standard play, pause, stop, and loop features. Can also scrub the playback.

    - Started adding some proxy instruments and instrument functionality into the Echo and ABC scene. Namely, string vibration, rotation, and sliding (such as a violin bow).

    - Now a streaming web player so you can load individual scenes so that it doesn't take so long to load the whole thing.

    http://web.mac.com/nathanwardenlee/Unity/Midi/Midi.html

    Hope somebody enjoys this :)
    Nathan
     
  7. Kaya

    Kaya

    Joined:
    Dec 21, 2010
    Posts:
    50
    Nathan,

    I've just run the ABC song over the web. That is awesome!!

    I assume you developed a MIDI file reader and event generator framework for Unity. Can you tell us about your technique and/or share some of your code?

    -Kaya
     
  8. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Thanks Kaya,

    Your assumption is correct. Basically, I'm reading in the data and storing it in classes to make it more readable. Then I calculate out the event times which is probably one of the most difficult things to do since you have to account for tempo changes.

    I have two methods for making things work in the system:
    #1 is I build an animation curve for the "Behaviour" and position, rotate, vibrate a string, or whatever based on an empty game object that moves on the y axis between 0 and 1
    #2 is that I send an event through a Messaging system.

    Both methods so far are invaluable as they both have very distinct uses. Animation curves are essential for having accurate movements when they need to have quick movements such as the balls and birds moving up and down. Events are used for more loose behaviors that shouldn't follow an exact curve. These will probably be seen in the next update I post. For now, there's only one thing that are using events and that's the bows on the Cello/Viola/Violins. Them moving back and forth are based on events instead of animation curves since they need to change movement every note played.

    I may end up at least releasing the Midi file reading code, especially since it isn't 100% compatible with all Midi files in hopes that maybe someone would like to chip in. But, if I do release some of the code it may be a while since I'm still in the testing stages.

    Thanks for your interest in it and for taking the time to comment :)
    Nathan
     
  9. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Well I know it's been a while, but, here it is... the MIDI reader source code. It only works with Speedy MIDI or SynthFont, but I can't remember with which format it works (I think it was SynthFont). Both are free apps.

    If you can improve the code to read any MIDI file, please share it on this thread :)

    http://web.mac.com/nathanwardenlee/Unity/Midi/MidiReader.zip

    Thanks a bunch,
    Nathan
     
  10. Polygans

    Polygans

    Joined:
    Apr 19, 2009
    Posts:
    79
    Thanks for the code Nathan, but could you also provide and example scene with an example of how to access the generated values by your script? Also how do you tell it which midi-file (source) to use?

    Or maybe you could point me into the right direction as how to accomplish this? I'm pretty new to csharp coding and accessing it from javascript.
     
  11. Jeff1N

    Jeff1N

    Joined:
    Dec 5, 2010
    Posts:
    10
    i too would love if you could provide an example of how to use this midi reader
     
  12. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    None of the links work anymore....are you still on this project?