Can anyone help me with this strange music glitch?

  • Hacking method: FEBuilder

  • Base Game: Sacred Stones

Hey, this is my first topic, so apologies if I’m not doing something right.
Also second post here in general, first one as also inquiring about the same thing as a reply, but its own topic is probably better.

I’ve been inserting MIDIs without many problems for a while, but ran into a strange one yesterday. My inserted enemy phase BGM, which previously worked just fine, suddenly started sounding weird with one of the instruments constantly cutting out, as if there were too many sounds playing at once (there weren’t).
I experimented with it as much as I can, and know what triggers it and what seems to be at fault, I’m just clueless on how to fix it.

Basically… this only happens when I resume a game after closing it during enemy phase, so exactly when this song plays.
If I restart the chapter normally and this song comes on, everything works fine, but the second I reset or just close the game, and then resume the chapter, that’s when it happens.
Additionally, I found out exactly what causes it, which is the title screen music.
I just replaced the title screen music for the first time recently, something I held off on, until now.
I didn’t overwrite it however, just changed the track ID in the FEBuilder patches from 43 to AD, where my new one was saved in.
The second I switch back to 43, the default title screen BGM, the inserted enemy phase song works perfectly again when I resume with it playing, all instruments working properly.
I tested more, and turns out that if I set the title screen song to my other inserted MIDIs, they lead to the same issue.

At first I thought there was just something weird and different about my inserted MIDIs that doesn’t allow them to be used for the title screen, but turns out when I actually change the enemy phase BGM to any of the other custom tracks, they do not have same instrument issue, regardless of whether I have a custom title screen music or not.
They sound fine, nothing bugging out.
So in the end, it seems the song I want to use as the enemy phase BGM might be the main issue after all, but I don’t know what’s wrong with it.

And again, it works completely fine otherwise, only when resuming a chapter while it plays, and on top of that ONLY if I’ve also changed the title screen music to another custom track, which obviously is the song that would play right before the enemy phase BGM comes on when I resume a chapter, so there could be something strange there.
Outside of this very specific scenario, zero issues with the enemy phase track, so there IS a weird interaction with the title screen music there, which is also why I’m not sure if it’s an issue to be fixed on that end, or the enemy phase BGM itself.

I’m just completely lost here, and hope there’s at least someone out there who might know what the problem could be.
Also can’t attach the .s files, and I really hope that replicating this will help solve the problem, so I assume it’s fine if I post through through a Drive link.

My hope is that this is a really simple thing to fix and I just have no idea what to look for.

I can’t replicate this on my end. I don’t think I have enough information to do so, like any patches you have (or haven’t) applied, etc. Please follow the instructions here to create a report.7z, and send that here.

Okay, I kinda did that, but I actually looked more into it by trying to recreate this exact issue with a fresh copy of the game and only the patches I would need, and managed to do that.
So I hope without anything else from the hack surrounding it, it’s gonna be a lot easier to pinpoint why this is happening.
In fact, in this mostly vanilla game, the song is already bugged without all the steps I needed previously, aka the title screen and resuming the game from enemy phase, so the issue is not related to what I initially thought.
Hopefully that makes things easier.

Have you had a chance to check it out yet?

Sorry, I’ve been busy lately. Just got around to taking a look at this.

Yeah, the issues I’m seeing in your test ROM are twofold: one, you haven’t applied the 16 tracks/12 sounds patch, which would give you a lot more breathing room with your custom music. Two, your song ends up trying to play 16 sounds at once at measure 11, beat 3 by my count. That’s simply too many, and you’ll run into the same issue even with the aforementioned patch applied, though it may be a more subtle effect than without it.

Install that patch, and mess with the MIDI for your enemy phase song until you only have 12 sounds max at any given time. You’ll want to give the ends of notes a bit of breathing room, as they may still be playing their release portion for a short time after the end-of-note signal.

To check how many sounds are being used in your song, at least in Anvil Studio, go to View > Ring tone (SP-MIDI) properties…


Then, in the window that opens, first tick “Allocate voices dynamically” (only need to do this once) for an accurate measurement, then click “Analyze”. The number furthest down in the list is how many sounds will play at once. Edit the MIDI until this number is, at most, 12.

This should be sufficient to solve your issue, but let me know if it isn’t.

No, this is really stupid on my part.
I HAVE that patch applied, obviously, but only for my actual hack, not in the bug test I sent you.
But after applying it for the bug test, yeah, that fixes it and explains what the issue is.
For my hack, when I resume the chapter with this song playing, it behaves EXACTLY as if the patch was missing, even though in that case it isn’t.
Is there anything known like this?
The 16 tracks and 12 sounds not working under specific conditions?

Anyway, now that I can’t replicate this anymore for the bug test ROM either after applying the patch, I guess I have no other choice except for sending a report of the actual hack.
Can I DM you that instead of posting it here?

Anyway, I will try and look into that then if it really plays more than 12 sounds, but like I said, the song plays fine otherwise, even if it might be missing things I hadn’t noticed.
The bug I encountered still goes way beyond that and is missing even more than it normally manages to play.

Posting my response from our private messages here for reference.

Honestly, this is a real head-scratcher. I don’t really know what exactly is causing the underlying issue, but I do know that changing the title screen music to song 0xA9 in your hack and otherwise performing the same steps still has the same issue occur, that putting the song data of song 0xAD (your current title screen music) in the slot of 0x43 completely fixes the bug on my end, and that likewise, setting the title screen song to any value above 0x7F causes the bug to reoccur, and values 0x7F and below fix it. I have no real explanation as to why this occurs, though it may have to do with the number of bits required to contain values above 0x7F.

Point is, put whatever title screen song you want before 0x80 or song 128 in Sappy. It should work fine for… reasons, instead of not working properly for… reasons?

1 Like

Can you change the solution for a post at a later point?
If so, I would temporarily mark yours as one.