Project DeadNote
Downloads
Abstract / Description
The main objective of project DeadNote was to create a free and easy-to-use plugin that enabled MIDI file import, playback, and audio control within the Unity game engine. The criteria for achieving these goals consisted of providing Unity the following: a method of direct import of MIDI files without the necessity of modifying of their file format or structure, and the ability to process real-time playback and control of sound within the game engine. This was further defined by objectives of including the ability to playback, pause, stop music and/or sound in real-time, as well as the functionality to mute specific audio tracks and retrieve the current playback timer. In order to achieve these goals, another open-source project known as the C# Synth Project was heavily stripped, modified, enhanced, and integrated with Unity as a C# script. A Unity project and scene was created, showcasing and utilizing DeadNote as a real-time MIDI file player within the game engine.
Prototype Implementation
The prototype for this project is a fully functional Unity scene that can be used to verify the Evaluation Criteria listed above. It can be opened in its entirety by downloading the DeadNote source code and simply double-clicking the DeadNote.unity file within the Assets folder. Once open within Unity, it is possible to click the Play Scene button located at the very middle and top of the Unity game engine window. This will execute the scene and run the UnityMidiPlayer.cs script attached to the Unity camera. After clicking the Play Scene button within Unity, the Game pane of Unity will display the prototype scene. The user can interact with several buttons to control the playback of a MIDI file in real time. They will be able to hear these changes in real-time from their default audio device.
UnityMidiPlayer.cs contains example source-code for relevant function calls, as well as helpful comments to be referenced by the user. The Plugins folder contains the C# Synth Project files which were heavily modified to achieve integration with Unity. Within the Changelog folder there is a generic text file outlining all the required changes made in order to integrate Unity and the C# Synth Project. Additionally, all modification made to the C# Synth Project have been commented with phrase \\DeadNote for transparency and readability.
UnityMidiPlayer.cs contains example source-code for relevant function calls, as well as helpful comments to be referenced by the user. The Plugins folder contains the C# Synth Project files which were heavily modified to achieve integration with Unity. Within the Changelog folder there is a generic text file outlining all the required changes made in order to integrate Unity and the C# Synth Project. Additionally, all modification made to the C# Synth Project have been commented with phrase \\DeadNote for transparency and readability.
Background Info
Less than 20 years ago, MIDI was the de-facto standard format for storing music in video games. With massive increases in the amount of available memory, both primary and secondary, it became possible to store audio in sample-based formats like MP3 and PCM-WAV. This produced a much higher quality of sound and MIDI slowly fell off the radar. Now, with fast multi-core machines, it has become possible to create more content procedurally. However for sound to be interactive with a player there needs to be a bridge to connect the raw sound data with the actual playback device (i.e. speakers or headphones).
MIDI files are a very organized and standardized format with a history for exemplary documentation. They contain organized logistical values required to play the correct pitches at the correct times in order to produce music (Soundonsound.com, 2014). This format was once a popular source of music and sound in early video games, which eventually lost popularity as video game consoles and PC's became capable of sound playback via digital audio. However, their timbre and sound is iconic to this day. Classic video games like Super Mario Bros, Zelda, PAC Man, and so many others have engrained themselves into our culture.
MIDI files are a very organized and standardized format with a history for exemplary documentation. They contain organized logistical values required to play the correct pitches at the correct times in order to produce music (Soundonsound.com, 2014). This format was once a popular source of music and sound in early video games, which eventually lost popularity as video game consoles and PC's became capable of sound playback via digital audio. However, their timbre and sound is iconic to this day. Classic video games like Super Mario Bros, Zelda, PAC Man, and so many others have engrained themselves into our culture.
Even after their decline in popularity in video games this format was utilized in other programs such as notation software such as Finale and Guitar Pro. The real benefit of this file format is that most modern musical notation software, such as Finale, can export to the format and are also capable of using it for sound playback (Finale, 2014). Therefore, it is almost impossible to perform a search on the web for a specific soundtrack, even one on the current Top 40, without finding a version in MIDI.
Unfortunately, both Unity and Unity Pro do not provide support for MIDI files (Unity Technologies, 2014). Other programmers have created similar projects for MIDI playback support on the Unity Asset Store, however their cost is anywhere from $10.00 to $90.00 (Assetstore.unity3d.com, 2014)! This monetary restriction does nothing to promote the continued usage and support of MIDI files. Project DeadNote will provide a free and open-source method of MIDI playback for all game developers utilizing the Unity game engine.
Assetstore.unity3d.com. (2014). Asset store. [online] Retrieved from: https://www.assetstore.unity3d.com/#/search/Midi%20files [Accessed: 9 Feb 2014].
Finale. (2014). Production and sequencing tools - finale. [online] Retrieved from: http://www.finalemusic.com/products/finale/features/production-sequencing-tools/ [Accessed: 9 Feb 2014].
Soundonsound.com. (2014). Midi basics, part 1. [online] Retrieved from: http://www.soundonsound.com/sos/1995_articles/aug95/midibasics1.html [Accessed: 9 Feb 2014].
Unity Technologies (2014). Unity - audio files. [online] Retrieved from: http://docs.unity3d.com/Documentation/Manual/AudioFiles.html [Accessed: 9 Feb 2014].
Unfortunately, both Unity and Unity Pro do not provide support for MIDI files (Unity Technologies, 2014). Other programmers have created similar projects for MIDI playback support on the Unity Asset Store, however their cost is anywhere from $10.00 to $90.00 (Assetstore.unity3d.com, 2014)! This monetary restriction does nothing to promote the continued usage and support of MIDI files. Project DeadNote will provide a free and open-source method of MIDI playback for all game developers utilizing the Unity game engine.
Assetstore.unity3d.com. (2014). Asset store. [online] Retrieved from: https://www.assetstore.unity3d.com/#/search/Midi%20files [Accessed: 9 Feb 2014].
Finale. (2014). Production and sequencing tools - finale. [online] Retrieved from: http://www.finalemusic.com/products/finale/features/production-sequencing-tools/ [Accessed: 9 Feb 2014].
Soundonsound.com. (2014). Midi basics, part 1. [online] Retrieved from: http://www.soundonsound.com/sos/1995_articles/aug95/midibasics1.html [Accessed: 9 Feb 2014].
Unity Technologies (2014). Unity - audio files. [online] Retrieved from: http://docs.unity3d.com/Documentation/Manual/AudioFiles.html [Accessed: 9 Feb 2014].