
VR Drums
A virtual reality replacement for acoustic drums that is portable, quiet, and cost-effective. The VR Drums project aims to make music education accessible to all.
The benefits of music education, especially for children, are numerous. Time and again, research shows that learning to play an instrument and read music is correlated with improved hand-eye-coordination, pattern recognition, and problem-solving skills. Unfortunately, music and arts are often the first things to get cut from the curriculum when a school district finds itself short on funding. The VR Drums project endeavors to solve this problem by offering a tool for music education that is cheap, silent, and, most importantly, effective.
We intend to achieve this by embedding a virtualized instrument in an environment that contains all the tools necessary to practice one's technique, timing, and music literacy. We believe that by achieving a sufficient level of realism any skills learned in the virtual environment will translate to a physical drum set and vice-versa. Recent advancements in the field have yielded powerful virtual reality hardware at affordable prices. By keeping our application lightweight enough to run on a standalone VR rig, we believe we can make music education accessible at almost any budget.
While this began as a senior project from my time at Cal State, Northridge, it has evolved into a personal venture that I continue to improve.
The application provides the user with an eight-piece drum kit rendered in a VR space. A pair of virtual drum sticks tracks the user's hand movements, and colliders on each of the drum objects will produce a sound any time the head of a drum stick crosses the surface of a drum head. The pitch of the sound varies slightly depending on where the collision occurs. The virtual pedals of the hi-hat and bass drums are engaged when the user pulls the trigger on their left and right controller, respectively. The other objects in the scene are determined by which of the three play modes is currently active, as described below.
In Free Play mode, it's just the user, their drums, and the open sky. There are no rules here.
Play Along provides a simple music player which allows the user to listen to locally saved song files while they jam along.
The heart of the VR Drums can be found in Tutorial Mode. In this mode, the drum heads are given colors and the user has a large, lined board centered in their field of view matching the format used in drum music notation. When the user presses the play button, game objects representing musical notes begin instantiating on the right side of the board and move left as if the user were reading a page of sheet music. Additionally, the notes are color coded to the drum they represent. For example, the top line of the clef represents the hi-hat, and so the notes that spawn on that line are the same color as the hi-hat itself. At the left of the board is a vertical bar which cues the user as to when a note is meant to be played. When the user strikes a drum object, the distance between the note and target bar is measured to determine how accurate the user's timing is. A score is generated based on their precision. Is the music going too fast? Just to the right of the drum set is a selector box where the user can adjust the tempo.
We believe this combination of features provides the user with an environment in which they can learn to sight-read sheet music, practice their technique, and improve their rhythm all at the same time.
A few images documenting the development cycle are shown below.
When this project began, only a few members of the group had experience with Unity, and none of us had any experience with programming for virtual reality. As project lead, I identified six areas in which my team would need to become proficient:
While Unity is known for having a thriving community of developers and excellent online documentation, learning to use Khronos's Open XR standard proved to be quite the challenge. The standard was so new at the time that I often found myself reading documentation or following tutorials that were out of date despite only being a few months old. There were times when I considered developing this project strictly for the Quest 2 and following Oculus's documentation, but ultimately I decided that cross-platform compatibility was an essential aspect of the project and stuck with Open XR. I am happy to have some experience with the standard as it seems to be the future of VR and AR development
Integrating assets between multiple programmers during a time of remote learning was unexpectedly complex as well. Of the six members in the group, only two of us had access to VR rigs and PC's capable of running them. This meant that the majority of the group was trying to develop assets for a virtual reality application without being able to test them in VR. In an effort to find ways for my team to be productive despite the obstacles caused by the pandemic, I learned how to create custom templates in Unity and how to use the XR Device Simulator. I made a template with the Universal Render Pipeline enabled and which contained XR Origin and XR Device Simulator prefabs. I then helped my team install the template on their individual computers. My teammates without VR rigs could use the XR Device Simulator to move around the VR environment and interact with VR assets, and my teammates with VR rigs could simply disable the simulator and use their hardware as normal. While this is more of a leadership success story than one of programming proficiency, I did become more familiar with Unity and Open XR in the process.
Unity is a cross-platform game engine used for developing applications as simple as 2D mobile platformers or as complex as fully immersive VR experiences.
Blender is an open-sourced 3D computer graphics software used for animation, visual FX, art, 3D models, virtual reality, and video games.
Open XR is an open-sourced plugin that allows development support for various augmented and virtual reality head mounted displays. This includes integration for hardware developed by HTC, Oculus, and more.
The Meta Quest 2 (formerly known as Oculus) is a virtual reality platform that can operate either as a standalone device using its onboard processor to run applications or as a peripheral linked to a gaming PC. With a thriving community of developers and cutting edge motion tracking, the Quest 2 offers everything a consumer enthusiast could need.
Learn More About Meta Quest 2