Examples of Game Logic Modulating Music?

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
8bitMusicNerd
Posts: 1
Joined: Fri Oct 14, 2022 1:24 pm

Examples of Game Logic Modulating Music?

Post by 8bitMusicNerd »

Hi All,

I’m trying to find interesting instances of NES game logic/events modulating the music.

Aside from button presses or collisions triggering sounds, are there examples of games changing song playback speed, pitch or looping behavior? anything generative or unusual?

Any examples, info or resources would be appreciated.

Thanks
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Examples of Game Logic Modulating Music?

Post by dougeff »

Tetris. When the stack is near the top it speeds up.

Super Mario Bros. When time is almost out it speeds up.

Excitebike, if you hit reset the sweep filter changes on the title screen.
nesdoug.com -- blog/tutorial on programming for the NES
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Examples of Game Logic Modulating Music?

Post by Drag »

The most fancy one I can think of off the top of my head is a GB game instead of NES, but GB Adventures of Lolo will dynamically switch between 5 different variations of the BGM depending on which direction you're facing and whether you're standing on grass. This is something that could've easily been done on the NES though which is why I'm mentioning it.

The way it sounds like it works is, the music data is broken up into 2-beat sections, and after the current section plays, the music engine checks the game variables to see which version of the next 2-beat section to play. There's two dynamic BGMs the game can play, and both are 16 beats in length, so the overall song loop is short, but it seamlessly shifts between 5 variations of itself as it reacts to what you're doing.

Another GB game, and simple to do on the NES, Pinball: Revenge of the Gator will endlessly loop a short "intro" section of the main BGM while it waits for you to launch your ball into play. Once the ball enters the playfield proper, the intro will stop looping and proceed into the main BGM.

On the NES itself:
- SMB2's pause screen mutes the two square channels. This is probably the only "true" dynamic music I can think of, where the playback of the music itself is modified, and not simply another track being loaded.
- SMB and SMB3 switch to a faster version of the current BGM track when the timer runs low. Tetris also does this when your stack gets too high, and then switches back to the "normal" track when your stack goes back down. For SMB and Tetris, this isn't a dynamic tempo adjustment; the game is switching to a different song which is simply a faster version of the original song. SMB3 I'm not sure, but it does start the song over.
- A Boy and His Blob will play an entire musical cue that leads back into the BGM when you cancel Blob's current transformation.
- In American Gladiators, the "wall" stage has semi-dynamic music based on how many opponents are currently on the screen (0, 1, or 2), plus the pitch shifts up one semitone each time the BGM switches between the "alone" and "pursuit" variations. While the "pursuit" variation is playing, the triangle channel will be muted or unmuted depending on whether you have 1 (muted) or 2 (unmuted) pursuers.
- A really weird example, Metal Gear 2: Snake's Revenge will dynamically switch between DPCM drums and noise-channel drums depending on whether a text box is open (noise) or closed (samples).
Last edited by Drag on Fri Oct 14, 2022 4:05 pm, edited 1 time in total.
Bavi_H
Posts: 193
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA
Contact:

Re: Examples of Game Logic Modulating Music?

Post by Bavi_H »

Perhaps you may be interested in the Famicom game Otocky:
Otocky can be described as a musical side-scrolling shoot 'em up. The player's spaceship has a ball for a weapon, which can be fired in eight directions; each direction corresponds to a different musical note. The note plays when the player presses the fire button, and is also quantized in time so that it matches the beat playing in the background. By using the weapon selectively the player can improvise music while playing. [...]

Otocky is notable for being one of the first games that include creative/procedural generative music [...]
User avatar
Individualised
Posts: 309
Joined: Mon Sep 05, 2022 6:46 am

Re: Examples of Game Logic Modulating Music?

Post by Individualised »

Drag wrote: Fri Oct 14, 2022 4:01 pm - SMB2's pause screen mutes the two square channels. This is probably the only "true" dynamic music I can think of, where the playback of the music itself is modified, and not simply another track being loaded.
Speaking of, I have noticed that a small section of the SMB2U/Doki Doki Panic overworld theme with the 2 pulse channels muted was reused as the slot machine/cards minigame music in SMB3. I haven't seen anyone else make the connection or mention it on the internet.
Drag wrote: Fri Oct 14, 2022 4:01 pm - SMB and SMB3 switch to a faster version of the current BGM track when the timer runs low. Tetris also does this when your stack gets too high, and then switches back to the "normal" track when your stack goes back down. For SMB and Tetris, this isn't a dynamic tempo adjustment; the game is switching to a different song which is simply a faster version of the original song. SMB3 I'm not sure, but it does start the song over.
I think this is incorrect. I'm pretty certain they did not store each theme in SMB1 twice with one sped up. You can check the disassembly. Maybe the faster variants have separate music IDs but they're not actually separate songs. Though interestingly, this seems to be a common misconception on the internet due to a combination of a misconception about what NSFs are, and the most common NSF of Super Mario Bros. having the faster variants as separate tracks. (The same NSF includes a glitched version of the Game Over theme and a fast variant of the pipe cutscene jingle, which have commonly been mistakenly labelled as unused content, with the sources saying that they're from track X of the NSF as if the NSF is something that's part of the game itself.)
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Examples of Game Logic Modulating Music?

Post by Drag »

Individualised wrote: Fri Oct 14, 2022 6:50 pmI'm pretty certain they did not store each theme in SMB1 twice with one sped up. You can check the disassembly. Maybe the faster variants have separate music IDs but they're not actually separate songs.
I was assuming they were separate music IDs. For sure, they point to the same physical note data (but with a different tempo setting in the header, or some other extra sequencing commands), but I meant to point out that the game behaves as though it's loading a new song (i.e., the song restarts but with a faster tempo), instead of, for example, a tempo variable simply being adjusted while the song continues seamlessly. Maybe that level of distinction is unnecessary but I wanted to point it out regardless. :P
User avatar
Individualised
Posts: 309
Joined: Mon Sep 05, 2022 6:46 am

Re: Examples of Game Logic Modulating Music?

Post by Individualised »

Drag wrote: Sat Oct 15, 2022 12:36 pm
Individualised wrote: Fri Oct 14, 2022 6:50 pmI'm pretty certain they did not store each theme in SMB1 twice with one sped up. You can check the disassembly. Maybe the faster variants have separate music IDs but they're not actually separate songs.
I was assuming they were separate music IDs. For sure, they point to the same physical note data (but with a different tempo setting in the header, or some other extra sequencing commands), but I meant to point out that the game behaves as though it's loading a new song (i.e., the song restarts but with a faster tempo), instead of, for example, a tempo variable simply being adjusted while the song continues seamlessly. Maybe that level of distinction is unnecessary but I wanted to point it out regardless. :P
Good point. If I remember correctly, atleast for the overworld theme, in SMB1 it tries to restart the song at the same "pattern" (the game doesn't use a tracker format of course but the term still works I suppose) that it left off at, though this may be a useful side effect of technical limitations as the overworld song is split into several chunks of data.
Dacicus
Posts: 32
Joined: Sat Dec 20, 2008 4:59 pm

Re: Examples of Game Logic Modulating Music?

Post by Dacicus »

I'm not sure if this is quite what you want, but Wizards & Warriors III gradually increases the tempo of the music in the ascent to Malkil. This does not seem to be dependent on player input or location, though. If you wait long enough, the music eventually stops altogether (because it's too fast?).
User avatar
za909
Posts: 248
Joined: Fri Jan 24, 2014 9:05 am
Location: Mijn hart woont al in Nederland

Re: Examples of Game Logic Modulating Music?

Post by za909 »

I have once done an experiment like this, but that project is on hold for now. The game logic would change the global transpose variable every x frames to make the pitch go up and down on the continue screen, which would just be the same fours beats of data repeated over and over again to save some space. So a plain nsf rip would come out sounding like the same short loop over and over again instead of the intended way.
User avatar
Jedi QuestMaster
Posts: 688
Joined: Thu Sep 07, 2006 1:08 pm
Location: United States
Contact:

Re: Examples of Game Logic Modulating Music?

Post by Jedi QuestMaster »

The Battletoads intro theme switches the drum sample on and off depending on what's on screen.

In-Game: https://youtu.be/NspFiTAVtfk
NSF: https://youtu.be/7kB6OXGVJ0c

The Jurassic Park stampede/t-rex theme seems to have some pitch / speed dynamics, but I'm not sure what this is based on:

In-Game: https://youtu.be/Rica13n3mBU
NSF: https://youtu.be/y5v1dJ83vDg

A number of Rare games disable the square leads when paused:

• Snake Rattle 'n' Roll
• A Nightmare on Elm Street
• Danny Sullivan's Indy Heat
• Battletoads & Double Dragon

Edit: Metroid loops the title screen music, but lets it end on the menu screen.
User avatar
Ben Boldt
Posts: 1148
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Examples of Game Logic Modulating Music?

Post by Ben Boldt »

Does lag count? Lots of games do that. :)

I think there’s a track in Marble Madness that speeds up and up each loop.

Zelda 2’s NSF seems to have some copies of same song with subtle variations in volume. I haven’t played this game a whole lot but never noticed it. Are these swapped around in real time?
User avatar
Individualised
Posts: 309
Joined: Mon Sep 05, 2022 6:46 am

Re: Examples of Game Logic Modulating Music?

Post by Individualised »

Jedi QuestMaster wrote: Sun Oct 16, 2022 1:38 pm The Battletoads intro theme switches the drum sample on and off depending on what's on screen.

In-Game: https://youtu.be/NspFiTAVtfk
NSF: https://youtu.be/7kB6OXGVJ0c
Not sure if this counts. Battletoads' sound engine only supports PCM output during downtime.
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Examples of Game Logic Modulating Music?

Post by Gilbert »

(This is not a game, so this may not count.)
Konami's Doremiko on FDS:
https://www.youtube.com/watch?v=v4EbFb9kUOo
Okay, it includes a piano keyboard, so you can perform music live, but even without the keyboard, you can use the joypad to (limitedly) manipulate the music being played back.

(Now this is a geme.)
Otocky:
https://www.youtube.com/watch?v=4A2mzS6toMo
It's a very inventive horizontal shooter (cute, too) where different weapons sound like different instruments and produce different tones according to the direction you're shooting at, i.e. you're basically playing your own music in the game. It was designed Iwai Toshio, an artist involved in experimental art. He later designed Sound Fantasy for the SFC, which was some sort of spiritual successor of Otocky, but the game was shelved for unknown reasons, which was later recycled and published by Maxis as SimTunes on PCs.
Catyak
Posts: 54
Joined: Mon Apr 25, 2022 4:33 pm

Re: Examples of Game Logic Modulating Music?

Post by Catyak »

Gilbert wrote: Mon Oct 17, 2022 10:25 pm He later designed Sound Fantasy for the SFC, which was some sort of spiritual successor of Otocky, but the game was shelved for unknown reasons, which was later recycled and published by Maxis as SimTunes on PCs.
<pedantry>Actually, SimTunes is based on only one component of Sound Fantasy (Pix Quartet), and that part was in turn based on an art installation he did called Music Insects. SimTunes exists because Maxis heard about that installation and decided it would make a good product.</pedantry>
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Examples of Game Logic Modulating Music?

Post by Pokun »

Digdug 1, being a faithful port of the arcade game, the main BGM only plays as you move Taizo Hori. I guess this is simply done by calling the sound routine only frames where the d-pad is pressed as opposed to every frame.
Post Reply