I’m a new Unity user (and I’ve only made some very rudimentary test projects so far). I have an admittedly ambitious idea, but I’d like to at least try to head in the direction of making it and learn as I go; which is where I need your help in pointing me in the right direction – thanks for any advice you’re willing to share!
I’d like to make a 2D platformer in which the player character jumps on and/or through musical notes in a page of sheet music. As the character touches/passes over the musical notes, Unity needs to play the correct pitches. I have the sheet music (which I can recreate in Photoshop with individual notes as sprites and the bass/treble clef as a static background image, etc.), and I can create a matching MIDI file.
That said, how do I even begin to do this from that point on? I see so many music/MIDI packages for Unity, plus all the built-in tools, and I don’t even know where to begin. To specify a little more clearly what I want, here are some details:
I want every single musical note in the sheet music to be a GameObject that will play audio when hit by the player character.
The audio for each will be the appropriate note played by a decent-sounding virtual piano.
The duration of each note during gameplay will be determined by how long the player character is in contact/close proximity to each musical note GameObject, plus a fixed interval after the character leaves the note. I’m hoping the sample code I’ve tweaked in 2D platform tutorials to determine if the character can jump or not can largely be reused here.
Multiple notes therefore need to play simultaneously, with a very large number needing to be played simultaneously. For example, if the character jumps up through eight or nine different stacked musical notes in a big chord, that means all eight or nine piano notes need to ring out simultaneously and play for a fixed interval after the player has moved on to another big chord with a stack of musical notes… so I may need Unity to play back 20-40 simultaneous musical notes.
The player’s reward for making it through each section of the level (i.e. sheet music page) will be the game playing that portion of sheet music back properly – basically, playing the relevant portion of the MIDI file I’ve generated.
Anyway, I know this is a lot, but I’m eager to learn and if you can point me in any useful directions with specific built-in tools and/or third-party packages and/or approaches that you would recommend, I’d be extremely grateful. Thanks!