Custom Music for SNES

Discuss PoP1 for SNES here.
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 217
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Custom Music for SNES

Post by spartacus735 »

Shauing wrote: March 25th, 2020, 3:54 am
spartacus735 wrote: May 6th, 2019, 10:30 pm How do you change the music of pop1snes ? with hexadecimal editor ?
Almost a year later, but I'm currently editing a video about it. I tried to condense the information it as much as possible, and some parts were skipped at the moment (panning, editing instruments data, and editing sequences). If you need another video where I tackle this, tell me so. I'll upload it hopefully this week.
Sound nice, if you could make a another video with the others parts mentioned it will be nice for me if I can add some of my knowledge.

For the moment I'm busy with "the lost bottle" (again haha) but it will be finish this year for sure. After that I will make a another mod with custom music if I can.

Thx
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

spartacus735 wrote: April 3rd, 2020, 5:41 pm Sound nice, if you could make a another video with the others parts mentioned it will be nice for me if I can add some of my knowledge.
Here are the two videos unedited (Will be up for I think 4 more days, I made several mistakes in some inserts, thus I edit them down to 24 minutes by speeding up the video and removing the mistakes - I will upload this 24 minute video in two parts on YouTube as I can only upload 15 minutes):
Part I: https://www.twitch.tv/shauingofficial/video/574352388
Part II: https://www.twitch.tv/shauingofficial/video/574509053

Yes, I will try to see how to do another one talking of the parts I omitted (panning, instrument data editing and sequence data editing).
spartacus735 wrote: April 3rd, 2020, 5:41 pm For the moment I'm busy with "the lost bottle" (again haha) but it will be finish this year for sure. After that I will make a another mod with custom music if I can.

Thx
Glad to hear you're still doing SNES mods and still intend to finish ''The Lost Bottle''. I will play it when it comes out.
I'll keep an eye to your custom music one, if you need more help on that, I can assist you.

Myself, I should have released my 30th anniversary port today, but I'm still inserting the last five music tracks and as many edits of the character sprites as I can insert (I think not all of them will fit). Game-play wise is 100% complete, but overall it's almost 90-95% complete.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 217
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Custom Music for SNES

Post by spartacus735 »

Shauing wrote: April 4th, 2020, 5:49 am
spartacus735 wrote: April 3rd, 2020, 5:41 pm Sound nice, if you could make a another video with the others parts mentioned it will be nice for me if I can add some of my knowledge.
Here are the two videos unedited (Will be up for I think 4 more days, I made several mistakes in some inserts, thus I edit them down to 24 minutes by speeding up the video and removing the mistakes - I will upload this 24 minute video in two parts on YouTube as I can only upload 15 minutes):
Part I: https://www.twitch.tv/shauingofficial/video/574352388
Part II: https://www.twitch.tv/shauingofficial/video/574509053

Yes, I will try to see how to do another one talking of the parts I omitted (panning, instrument data editing and sequence data editing).
spartacus735 wrote: April 3rd, 2020, 5:41 pm For the moment I'm busy with "the lost bottle" (again haha) but it will be finish this year for sure. After that I will make a another mod with custom music if I can.

Thx
Glad to hear you're still doing SNES mods and still intend to finish ''The Lost Bottle''. I will play it when it comes out.
I'll keep an eye to your custom music one, if you need more help on that, I can assist you.

Myself, I should have released my 30th anniversary port today, but I'm still inserting the last five music tracks and as many edits of the character sprites as I can insert (I think not all of them will fit). Game-play wise is 100% complete, but overall it's almost 90-95% complete.
Excellent ! Thx for the sharing, I will study your tutorials.
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

spartacus735 wrote: April 4th, 2020, 10:41 pm Excellent ! Thx for the sharing, I will study your tutorials.
No problem! If you have any more questions you can ask me.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

I'm curious about something here. Several games have an echo flag activated (as shown here on the SPC Player of a Sunset Riders song):
SPCEcho.png
SPCEcho.png (10.97 KiB) Viewed 5964 times
But Prince of Persia SNES doesn't seem to have it activated (or have one), as I checked on all 8 channels of every music track SPC. I'm curious as if it can be activated/or does even it have an echo capacity?

Supposedly on the music format there some commands for something related to echo but apparently nothing that activates the echo flag.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

Shauing wrote: July 24th, 2021, 12:22 pm I'm curious about something here. Several games have an echo flag activated (as shown here on the SPC Player of a Sunset Riders song):
SPCEcho.png

But Prince of Persia SNES doesn't seem to have it activated (or have one), as I checked on all 8 channels of every music track SPC. I'm curious as if it can be activated/or does even it have an echo capacity?

Supposedly on the music format there some commands for something related to echo but apparently nothing that activates the echo flag.
Well, almost a month later I found an answer to this. Turns out the original game has a bug in the echo implementation. More or less for what I understood, the intended EON (Echo Enable) bits got overwritten, thus no echo is heard.

This flaw was discovered by KungFuFurby from the SNESLab Discord, where I had submitted a cover of Mozart's ''Ave Verum Corpus'' utilizing custom samples and using the PoP SNES music engine. I wondered there if the echo flag could be activated somehow at all, perhaps maybe by an undiscovered command. KungFuFurby entered the conversation by commenting on my use of the Prince of Persia music engine as another Arsys developed game ''Battle Zeque Den'', uses a similar (if not the same) music engine.

So then for the next few days, KungFuFurby and I went discussing and looking into the music engine for PoP, mainly looking for what each music command did by looking into the SPC700 ASM itself and consulting documentation and files from here on the forum related to SNES PoP's music engine and eventually KungFuFurby found out and pointed the flawed portion of the code here:

Code: Select all

0893: f3 ce 6d    BBC7 $ce,$0903
0896: ab ce       INCZ $ce
0898: d0 69       BNE $0903
089a: e4 2f       MOVZ A,$2f ; muted channels?
089c: 48 ff       EOR A,#$ff
089e: 24 d0       ANDZ A,$d0
08a0: c4 b2       MOVZ $b2,A ; current command L
08a2: e4 2f       MOVZ A,$2f ; muted channels?
08a4: 24 d1       ANDZ A,$d1
08a6: 04 b2       ORZ A,$b2 ; current command L
08a8: f0 04       BEQ $08ae
08aa: b2 cf       SET5 $cf ; current FLG (Nn) noise freq
08ac: 2f 17       BRA $08c5

We're off to $08C5.

08c5: e4 cf       MOVZ A,$cf ; current FLG (Nn) noise freq
08c7: 8d 6c       MOV Y,#$6c
08c9: 3f b1 09    CALL $09b1 ; set register Y to A
08cc: 8d 4d       MOV Y,#$4d
08ce: 3f b1 09    CALL $09b1 ; set register Y to A
''The accumulator is overwritten here, meaning the true EON bits never get written''.

KungFuFurby also kindly provided a fix for this, which can be applied over the original ROM:
''Replace E4 CF 8D 6C 3F B1 09 8D 4D 3F B1 09
with 2D EB CF E8 6C DA F2 EE E8 4D DA F2
and the EON bits should be working again''.

The explanation of the fix:
''The main thing I did was to save the old accumulator containing the EON flags upon arrival, then retrieved them after writing to the FLG DSP register so that they would be written correctly''.

This also means the soundtrack has not been heard in its intended way for almost 30 years! (Differences are for the most part subtle, but some tracks do feature a somewhat very audible echo).
Here I provide an example of just the percussion as well as the lead instrument track of Level 19 music, first as how we hear it in the final game (Original), and then with its intended echo; subtle, but noticeable.
Stage 9 - Track 3 (Original):
https://www.dropbox.com/s/7xvnfrdn57iyp ... 9.mp3?dl=0
Stage 9 - Track 3 (With Intended Echo):
https://www.dropbox.com/s/cd5ndqrsuu41y ... 9.mp3?dl=0
Stage 9 - Track 6 (Original):
https://www.dropbox.com/s/f7fzvw9w8k08g ... 9.mp3?dl=0
Stage 9 - Track 6 (With Intended Echo):
https://www.dropbox.com/s/yqmo96wlbyv06 ... 9.mp3?dl=0
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Custom Music for SNES

Post by Norbert »

Nice that your looking into it paid off with a fix and hearing differences in the original soundtrack.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

I just realized that I didn't upload my updated document here. Here goes, probably there could be more corrections/add the remaining few mystery bits, but I think it's an already good enough guide to make music in the game.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Custom Music for SNES

Post by Shauing »

An update of the documentation, with more clarifications and corrections overall, specifically on the instrument data bytes, which are pretty much completely figured out.
Attachments
How The SNES Music Is Written In The ROM (Simplified Rev 2W).pdf
(295.13 KiB) Downloaded 72 times
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
Post Reply