Jump to content
NHL'94 Forums

Editing music/sounds in NHL '94- a start


Asher413
 Share

Recommended Posts

Hi all,

This is mostly to capture my thinking, as I do hope to come back to this another day, but I cannot spend any more time listening to my computer play version of "Go fight win!"... And in case anyone else has started the work or has an interest, here's some information for you!

Objective:
Determine where/what the note pitches are in the NHL '94 code

Background: To be able to edit or add new music, somehow those bytes need to be translated out of code into music- then new pieces can be translated from music into code.
I'll start with "Go, Fight, Win!" (The song at offset 00184052 in DEC) Why?  It's first, and it's a simple song in '94 with only a couple of chords. 
Some background (trying not to get too music geek here)- Go Fight win is quarter notes for the first 3 notes, and the first measure's tones are 1-3-4-4#-5 on a scale.  In half steps from the root, they are 0-4-5-6-7 (So the last three notes are chromatic).  It's tempo in NHL '94 is around 90 BPM.
Process: So I'll copy the code from this song in small parts to the start of song 02 (Start of game when Boston is the home team, so it's easy to access in the game) to see if I can ID the first measure's code.  The first 64 bytes are close (the last note of the measure is cut short, but it's enough to work with)
Two patterns stick out to me in those bytes- 27-2B-2C-2D and 33-37-38-39.  27-2B might be too far of a jump, but it might be that what I'm hearing as a single note might be two notes together.  

For notes- I'm looking at decimal 184996 onward. So these are the chunks I'm looking at:  (underlined the sets of 90 for clarity)

90 27 23 00 
90 33 23 14 
80 27 37 03 
80 33 41 0E 
90 37 23 00 
90 2B 23 14 

80 2B 48 03 
80 37 47 10 
90 38 23 00 
90 2C 23 13 

80 2C 16 01 
80 38 2E 06 
90 39 23 00 
90 2D 23 1A 

80 2D 50 02
80 39 50 01

From my experiments I believe:

80/90 have to do with the instrument. Changing all the 90's to 80 met me with silence.  I think you can think of 90 as an on switch and 80 as an off swtich.   But I can't see why you'd have values after a 'off' instrument (3703, 410E for example) so I'm not sure here.  I didn't experiment with changing the 90's to different values, as my goal today was simply the pitch.

I'm certain the second set of bytes are pitches.  If you change the on and off pitches together, you can move around the pitch of the notes.  (SUCCESS!)

I can't figure out the third set, and any attempts to change them ended inconclusively.  It might be a note style?

I thought the 4th set was note length, but I'm struggling with the 00 values.  Changing the 14's up and down made the notes longer and shorter.  Maybe it loads all the notes then plays them for that length?  Again, I can't figure out the off notes bytes there.

Conclusion: I believe I found the pitches, which was my goal for today.  When I get a better grasp on note length, I can probably make the note long enough to calibrate the pitches with a tuner, which means note length will be the next project.

  • Thanks 2
Link to comment
Share on other sites

This is a short and sweet one-

I was correct on the note length.  If put in a value of 50 (32), then cut it in half on the next note at 25 (20), the notes are twice and half as long.  They could be calibrated to a metronome I suppose, but I'd guess if you're creating music you'd find out how long you want a quarter note to be by trial and error perhaps?

On the downside- with my emulator, computer and tuner app on my phone, I am consistently getting notes that are *in between* steps (almost exactly just sharp enough or flat enough that it wants to jump between F and F# for example).  Almost exactly, as I move the pitches up and down.  But- 36 is an F I'll call it (my phone picked it up around 187 Hz, FYI), 34 was an E flat.  It's a start, and I guess if you're out of tune on every note in relation... it works? 

Next step: Explore instrumentation/effects- I'm not sure if I'll focus on the 23 bytes or the 80/90's.  I may try and find other songs in the ROM that aren't organ and see what differences I notice.  I feel like I have the basics for making an organ ditty down now enough to do it though, and I may try that as well.  Lot's of new branches in this project.

 

A side thought I had today- maybe it could be possible to combine the real songs on organs with an attempt to match the goal horn sounds for "modern" ROM's.  It may be a pipe dream, but I think the songs part is very possible,and horns would require instrument or effect work.  I also know the lengths would need love, as someone would have to manage the pointer table or make the songs the same length as the time currently available.---- Edit- I played with this a bit tonight and was able to get a weak sounding first line of "Sweetness" for Florida's horn.  I need to learn more about tone to get a meatier organ, but I'm making real progress and can make any song with sheet music at a basic level now.

Edited by Asher413
More work today
Link to comment
Share on other sites

This is great.  I know there is some information out there on the internet, and even programs, that explain how the Sega Genesis music works and how you can create custom songs.  I looked into this a while back as well, so I can dig up stuff if you haven't.

Link to comment
Share on other sites

Kingraph- I'll see when/if I get stuck.  I don't really do well with coding (basic was the last language I understood), so I'm trying to break it down a way I understand instead of the coding I've found from Google.

Today was a little less, but more information to be taken down on the next steps:

The bytes between the FF's and the start of the notes I have a stronger grasp on (someone hinted piece of these on the boards here as well).

The C# bytes I believe are setting the channel of the instrument, and the next byte I believe is the instruments. The organ songs didn't load multiple instruments often, but the opening song is clearly a number of instruments loaded.  I found (at least in NHL '94, I haven't tested '93 or others) there appears to be instruments loaded/preset/available in the rom between 00 and 1F.  It's hard to place what all are supposed to be, but my notes on what they sounded like to me include three organ sounds, a sitar (18), and my favorite- my wife called it "Finger plucking a rubber band" (14).  I'm leaning toward thinking organ's 03 and 04 sound better than the OB that appears to be the one they used, but YMMV.

Corresponding with that- the 90's that I think are on switches earlier, I think also correspond to the channel numbers.  If you are using the instrument in channel 0 (CO), you put a 90 in those bytes.  Channel 1 (C1) is 91, etc.  The 80's appear to work the same on turning off tones.

So now starting from the start of a 'song', I'm looking to ID the third bytes after the channel, the second/third bytes after the 80/90 command, then I think I've found what makes the sounds and manipulates the sounds.

 

When all this is done, I'll clean this all up into one more clear post, but I'm posting as I go for personal notes, and just in case I give up on the project tomorrow, there's a starting for someone else not to go through the same steps.

 

 

  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...

Unfortunately, no.  My sound card on my laptop didn't work this whole school year.  It's on my list this summer to see if I can fix it.

Which also means it's on my list to get back into a lot of these things once I can hear the sweet sounds of Genesis hockey on the computer again.  Here's to hoping!

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
46 minutes ago, CPLANAS1985 said:

Is there a way to replace music and sounds from NHL '94 with NHLPA '93 -- the Genesis versions!?!?

It's not well documented, but it's been done. Although sometimes the instruments aren't right.

https://forum.nhl94.com/index.php?/topic/11307-how-to-change-and-view-nhl-94-sound-effects-and-music/

 

Link to comment
Share on other sites

  • 1 month later...

Hey I noticed something.. You identified 90/80 as note ON/OFF... That suggests strongly that it's MIDI format.

80 hex = 1000 0000 binary

90 hex = 1001 0000 binary

http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html

Status
D7----D0
nnnn is the MIDI channel no.
Data Byte(s)
D7----D0
Description
1000nnnn 0kkkkkkk
0vvvvvvv
Note Off event.
This message is sent when a note is released (ended).
(kkkkkkk) is the key (note) number.
(vvvvvvv) is the velocity.
1001nnnn 0kkkkkkk
0vvvvvvv
Note On event.
This message is sent when a note is depressed (start).
(kkkkkkk) is the key (note) number.
(vvvvvvv) is the velocity.

Friendlier explanations: https://www.cs.cmu.edu/~music/cmsip/readings/MIDI tutorial for programmers.html

Also by Appendix 2 of the first link, it looks like the 90/80 byte is the 2nd byte in an instruction. The first byte is timing. So rewriting the bytes you quoted...

?? 90 27 23   ♪D#2
00 90 33 23   ♪D#3
14 80 27 37
03 80 33 41
0E 90 37 23   ♪G3
00 90 2B 23  
♪G2
14 80 2B 48
03 80 37 47
10 90 38 23   ♪G#3
00 90 2C 23   ♪G#2

13 80 2C 16
01 80 38 2E
06 90 39 23   ♪A3
00 90 2D 23   
♪A2
1A 80 2D 50
02 80 39 50
01 ...

Plug those notes in here (ignoring timing)...

https://onlinesequencer.net/

image.png

Click play... Does it sound familiar? I can't really place it, but it does sound like music! (edit: yeah it's totally the Go Fight Win song! https://www.youtube.com/watch?v=I6TV1jNI2ck)

 

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, kingraph said:

What did you do??? :D

I tried to replace the Whalers Brass Bonanza song with Toccata & Fugue in D minor, but it seems like can't just drop in internet MIDI file data directly, the game uses a very basic version of the format.

Real version of the song: https://www.youtube.com/watch?v=dkQrj-eEs-M

MIDI version: https://bitmidi.com/toccata-and-fugue-in-d-minor-bwv-565-busoni-piano-arr-mid

Link to comment
Share on other sites

https://www.youtube.com/watch?v=PLNpvLVu2xA

image.png

@031BB2

00    90    39    21
00    90    34    26
00    90    28    26
0C    90    3B    1D
07    80    39    50
10    80    34    50
00    80    28    50
00    90    34    26
00    90    28    26
00    90    39    21
02    80    3B    50
09    90    3B    1D
07    80    39    50
10    80    34    50
00    80    28    50
00    90    34    26
00    90    28    26
00    90    39    21
04    80    3B    50
07    90    3B    1D
07    80    39    50
03    90    39    21
08    80    3B    50
03    80    34    50
00    80    28    50
00    90    3B    1D
07    80    39    50
04    90    3E    21
00    80    3B    50
0B    80    3E    50
00    90    40    21
0B    90    39    21
00    80    40    50
0C    90    3B    1D
07    80    39    50
04    90    3E    21
00    80    3B    50
0B    80    3E    50
00    90    3B    1D
0B    80    3B    50
 

x12

  • Love 1
  • Like 1
  • Wow 1
Link to comment
Share on other sites

Working on a script for making it easy to import MIDI music downloaded from the internet...

It'll take some work to get the script to be able to merge tracks to create songs more accurately (e.g. keyboard + lead guitar tracks).

I was hoping the game would happen to support multiple instruments, but basically you get the organ sound on channel 0 and the marimba sound on every other channel.

Maybe some investigation of the menu screen music would show how extra instruments could be hacked in there... But I suspect it might not be possible, if the other sound channels are being used for gameplay noises.

  • Love 3
Link to comment
Share on other sites

6 hours ago, smozoma said:

Working on a script for making it easy to import MIDI music downloaded from the internet...

It'll take some work to get the script to be able to merge tracks to create songs more accurately (e.g. keyboard + lead guitar tracks).

I was hoping the game would happen to support multiple instruments, but basically you get the organ sound on channel 0 and the marimba sound on every other channel.

Maybe some investigation of the menu screen music would show how extra instruments could be hacked in there... But I suspect it might not be possible, if the other sound channels are being used for gameplay noises.

I would definitely be willing to assist if you need any help. 

Link to comment
Share on other sites

I put the code on github. 

https://github.com/nhl94dotcom/midi_2_nhl94  https://github.com/smozoma/midi_2_nhl94

I can add 'collaborators'

UltraMagnus and I both took a look at NHL95 and it doesn't seem to use the same music system (at least for the organ music), or the songs are compressed so aren't clearly visible in the ROM data. 

Link to comment
Share on other sites

On 9/3/2022 at 2:04 AM, smozoma said:

https://www.youtube.com/watch?v=PLNpvLVu2xA

image.png

@031BB2

00    90    39    21
00    90    34    26
00    90    28    26
0C    90    3B    1D
07    80    39    50
10    80    34    50
00    80    28    50
00    90    34    26
00    90    28    26
00    90    39    21
02    80    3B    50
09    90    3B    1D
07    80    39    50
10    80    34    50
00    80    28    50
00    90    34    26
00    90    28    26
00    90    39    21
04    80    3B    50
07    90    3B    1D
07    80    39    50
03    90    39    21
08    80    3B    50
03    80    34    50
00    80    28    50
00    90    3B    1D
07    80    39    50
04    90    3E    21
00    80    3B    50
0B    80    3E    50
00    90    40    21
0B    90    39    21
00    80    40    50
0C    90    3B    1D
07    80    39    50
04    90    3E    21
00    80    3B    50
0B    80    3E    50
00    90    3B    1D
0B    80    3B    50
 

x12

The Sabbath fan in me is gitty now!  If only we had a devil's horn hand "like" button...
Nice work!!!

 

  • Like 1
Link to comment
Share on other sites

I created a github "organization" to house all the various community NHL94 projects, and transferred the midi_2_nhl94 project into it

https://github.com/nhl94dotcom/midi_2_nhl94

Anyone wanting to work on the project, let me know and I can figure out how to give you editing access!

Link to comment
Share on other sites

  • 2 months later...

https://youtu.be/o--vwFE52iM - Kernkraft 400 (the woaaaaaaa, aaaaooooo, aaaooooaaooo goal song the Bruins have - needs tweaking)

https://youtu.be/SNA5cbHp6YY - Dirty Water

Just a few notes so other newbies can try this tool out:

  • I used Visual Studio and imported Smozoma's Github through the repository download feature - I recommend doing this and installing mido using the built in features if you're new to Python like me.
  • MuseScore has free trials and all of their notes sheets allow you to download midi versions. MidiEditor then is good tool to combine tracks or delete things you may want to. These were more reliable since they were midis made for transposing/learning and not for listening.
  • If you see any values on the Excel output column fourth from the right or furthest right that get up above 30-40, you may want to shorten them if there aren't major gaps in your song.
  • Count the # of bytes whatever track you're replacing has and then convert to decimal and divide by 4 to count how many rows of Excel cells to copy.

 

Edited by seamor
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Who's Online   0 Members, 0 Anonymous, 17 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...