Music Lab is a virtual reality application for HTC Vive containing a compilation of experiments using real-time spatial audio and player interactions.
So far, the application features:
- A stage with speakers and spatial audio sources which reflect sound in real-time, and adjust their perceived volume depending on how close you are to the speakers. The stage also allows the user to turn off the lights in the room, subsequently providing them with a flashlight to explore the place.
- A canvas with buttons that when activated with the laser attached to the player's controller, play audio loops in sync, allowing the player to create music in real-time. I synchronized the audio using Ableton Live by warping each loop to the same BPM, before importing into Unity. Then, I synchronize each audio track by assiging the time samples of each track to a muted master drum track. The player can then enable or disable sounds as they wish, and the sounds will be kept in time.
- An audio sequencer structured in a 5 row by 4 column grid (5 audio samples, and four-beats-to-one-bar grid). The player can enable or disable the buttons using their hands, and when the audio sequencer (120 beats per minute) detects the enabled button, it plays the sound.
- An audio visualizer. I partitioned the audio into seven frequency bands. Each group represents a different frequency range (bass for example). Then, I convert each group's amplitude to a value ranging between 0 and 1 and assign the values to shapes, which move/dance according to those values.
- A 'Modulation Contaminate Funnel.' The player can solve the puzzle, by throwing a cube into a large solid funnel, and the cube becomes "contaminated" with modulation (the same technique used for the audio visualizer). Then, when the player places the contaminated cube onto the dance floor, and turns on the music and turns off the lights, the cube will dance to the music.
The Lab Renderer v1.0 - https://www.assetstore.unity3d.com/en/#!/content/63141
SteamVR Unity Plugin - https://www.assetstore.unity3d.com/en/#!/content/32647
Steam Audio (Phonon) - https://valvesoftware.github.io/steam-audio/
Unity 5.6.0b11 - https://unity3d.com/unity/beta