MZ Plugin that lets you change between soundtrack versions like Final Fantasy Pixel Remasters

I am not sure what a fix might be though
since the plugin has been altered i cant say line names. try and follow this.
go to where AudioManager.saveBgm is defined and change the line in the function that reads
Code:
name: bgm.name + Sakuya.SoundtrackSwap.suffix(),
to
Code:
name: bgm.name,
im not sure why saveBgm was written to add the suffix when playBgm also adds the suffix to the file its looking for
Thanks so much, that fixed it! I will let you know if I have any other issues, but I think if I have the OST swap working, and now it isn't giving me errors going from overworld to combat and back, it'll just be a matter of doing a playtest with the synth OST enabled to make sure I have all the events for music set up properly now. It's a short game at least. My first was about 4.5 hours (for me at least, on Steam someone left a positive review and they had more than twice that, though that can be for a lot of reasons). This one *might* break 2 hours.

EDIT1: I am not sure what protocol is, would it be safe to share the updated MZ version of Sakuya's plugin in the thread they submitted the original in? I don't want to step on any dev's toes. Or Robro, if you want to do this, since you're the one that told me what to edit, it's your work. If I submitted I would credit you.

EDIT2: So looking at the documentation for VisuStella Options Core, it looks like I would need to know JavaScript to make a new option in their menu. So, if this needs to be moved to the want ad section now, that is fair... but, if anyone could create a VisuStella options entry and give me the info so I can copy-paste it in on my end. To have an option under Audio labeled probably Soundtrack, then have it say 8-bit for one option and Synth for another. And have Synth turn switch 100 on (or whatever # and I might be able to figure out how to edit that specifically)... I guess then the 8-bit option would then need to turn switch 100 off. I am assuming the change wouldn't apply until a new audio track is loaded, if that is case having some kind of message about that in the options or maybe if a popup is possible on changing, that would also be good. I am willing to pay for this, if you're interested in doing it that way, you can PM me and we can see if something can be figured out. If it ends up being projected as too expensive I would just have the switch at the start of the game to control this.

EDIT3: So after the 1st battle, everything is fine, it goes back to the overworld OK with the changes so far. But, after the 2nd battle, it is adding another _synth on the filename it is looking for.

EDIT4: Where it says
AudioManager.updateCurrentBgm

I edited that same line mentioned before to make it read

name: bgm.name,

This makes it not add the extra suffix anymore (did 3 battles), but it is making it so when the combat music starts, it plays for a couple seconds, mutes for a second, then resumes.
This makes it not add the extra suffix anymore (did 3 battles), but it is making it so when the combat music starts, it plays for a couple seconds, mutes for a second, then resumes.
odd. is it consistent, does it only happen with the battle theme, and can you replicate this with only the soundtrack swapper plugin installed?

it looks like I would need to know JavaScript to make a new option in their menu
generally yes, but not really in your case? the options core has the entire options menu preconfigured. all you really have to do is copy one of the already existing, working binary options (such as always remember under general), make a new option under audio, and paste it there. then you just change the name, symbol, and the ok process to include flipping the switch (and maybe changing the bgm right then and there)
Code:
$gameSwitches.setValue(100, !$gameSwitches.value(100))
this.setConfigValue(symbol, $gameSwitches.value(1));
Although without a meta switches plugin, the value of switches are bound to the save file. so this wouldnt really have a use on the title options menu. I dont know if VS already has a meta switches plugin available, but the alternatives are to do nothing, just disable the option on the title screen, or to edit the soundtrack manager plugin to look at a ConfigManager value instead of a switch.

I am not sure what protocol is, would it be safe to share the updated MZ version of Sakuya's plugin in the thread they submitted the original in?
always safest to ask the author, although im unsure if you'd get a response. last login was 2 months ago, which isnt very recent but they might still get email notifications from PMs
odd. is it consistent, does it only happen with the battle theme, and can you replicate this with only the soundtrack swapper plugin installed?


generally yes, but not really in your case? the options core has the entire options menu preconfigured. all you really have to do is copy one of the already existing, working binary options (such as always remember under general), make a new option under audio, and paste it there. then you just change the name, symbol, and the ok process to include flipping the switch (and maybe changing the bgm right then and there)
Code:
$gameSwitches.setValue(100, !$gameSwitches.value(100))
this.setConfigValue(symbol, $gameSwitches.value(1));
Although without a meta switches plugin, the value of switches are bound to the save file. so this wouldnt really have a use on the title options menu. I dont know if VS already has a meta switches plugin available, but the alternatives are to do nothing, just disable the option on the title screen, or to edit the soundtrack manager plugin to look at a ConfigManager value instead of a switch.


always safest to ask the author, although im unsure if you'd get a response. last login was 2 months ago, which isnt very recent but they might still get email notifications from PMs

All I had time for right now is testing #1 - yes, it does happen with the soundtrack swap being the only plugin running, and it happens every time a battle starts.
look for AudioManager.isCurrentBgm and remove the function entirely.

I imagine the author meant to add to the existing function instead of overwriting it, but what they did just seems to break it. building off of what rpgLord69 said earlier, the battle bgm is actually queued more than once as the fight starts. the subsequent calls usually never matter because the game doesnt restart the track if the current one is the same one as the new one, but the change to the function makes it so that it could never recognize that as being true
When I delete that, there is still the combat audio hiccup. Now that I am paying more attention what's happening is, the combat audio starts, stops, is silent for about half a second, then restarts, and then plays fine.
When I delete that, there is still the combat audio hiccup. Now that I am paying more attention what's happening is, the combat audio starts, stops, is silent for about half a second, then restarts, and then plays fine.
I had tested the changes before the last post, was able to get the issue and removing the function had seemed to have worked for me with a blank project. Just to be certain we're on the same page with the changes, this is what ive been working with. does it not work for you?
That is working! I did 4 test battles, music is playing fine, no issues with _synth getting added on repeatedly. I will keep you posted, when I have time I am going to do a full playtest of everything I have made so far to test the synth soundtrack, make sure it's all good. If I have any more issues, I will let you know.

If you're interested, you can PM your PayPal, or whatever I'd be able to use PayPal to transfer to, I'm up for giving you a few bucks for helping me out with this and getting a huge feature I wanted to be able to showcase more of my music in a game (the main reason I got into game dev was to have my own music in games lol).
I will keep you posted, when I have time I am going to do a full playtest of everything I have made so far to test the synth soundtrack, make sure it's all good. If I have any more issues, I will let you know.
if you find anything in the future lmk and ill take a look. i hadnt given the plugin much of an examination past what youve been reporting, so if theres any unintended consequences of these changes youll have to share them

If you're interested, you can PM your PayPal, or whatever I'd be able to use PayPal to transfer to, I'm up for giving you a few bucks for helping me out with this
that wont be necessary. Like the others, I help out around here because i choose to.
keep your money or put it towards your game if needed.
Thanks a lot!

So I have the option in the menu to change between the two soundtracks, so have removed the prompt from the start of the game. The change doesn't apply until a new track is loaded though. I have 8-bit option turning the switch off, and Synth turning the switch on. All I did was rename them and use Google to figure out where to put the line to do the switch change.

I also haven't tested if this would change the menu music or not, will check shortly.

Okay, it doesn't apply to the menu unless you load into gameplay, then go back to the menu. The change doesn't apply to the menu on fresh launches. Not sure if there's a way to address that. Worst case the menu is always 8-bit.

This plugin is creating an issue on deployed builds, but only when the build is encrypted.

When I deploy the project without encrypting anything, it loads fine.

When I encrypt it, I get the following error:

Failed to load
audio/se/James.ogg

The thing is, that ogg file isn't an actual file being used anywhere, so I don't know why it's looking for it. If I make an ogg file with that name in the specified dir, it then adds characters to that name and says it can't load it either - same thing, not an actual audio file being used by the game anywhere, so doesn't exist in the directory.

When I disable this plugin, the encrypted build is fine.

Any ideas?

Oops, sorry about bumping, I should have edited that last post.

EDIT: I have also narrowed it down to it being this plugin, when I disable all other plugins but FOSSIL and this one, still have the issue.
If I make an ogg file with that name in the specified dir, it then adds characters to that name and says it can't load it either - same thing
thats the bigger issue and is the cause of the other problem.

before a sound file is buffered, the plugin checks to see if the file exists. if it doesnt, it assumes that youre trying to load a suffixed file and chops off the last few characters. the sound file its looking for would actually be "James" followed by some 6 characters. itd be either your ok, buzzer, cancel, or cursor sound effect. the reason the plugin does it is so that it can make the game not give you an error for not having suffixed versions of every sound file.

When you encrypt the project, the extension the plugin expects changes and it messes with what the plugin does to search for the files. unfortunately it doesnt seem to be the case that making it look for the updated extension seems to work either... somehow. the only recourse i could think of besides not encrypting the audio files would be to remove the part of the plugin that checks to see if the files exist and then have you make suffixed files for each sound file in the project
I already have that done for BGM and ME files. At least, if I am understanding you correctly. So I would need some edit to the js file, then also duplicate all the SE files and add _synth to them? The only reason I care to encrypt audio is it would help encourage people to support me by buying the soundtrack.
I already have that done for BGM and ME files. At least, if I am understanding you correctly. So I would need some edit to the js file, then also duplicate all the SE files and add _synth to them?
this edit has the changes you need made, but yes. youll need the suffixed version of each SE as well when the switch is active and the game is looking for those files.

The only reason I care to encrypt audio is it would help encourage people to support me by buying the soundtrack.
its up to you if you want to do it. I wont tell you whether or not if you should or shouldnt, but I feel like most people who would seriously consider buying the soundtrack would buy it if it were available. The ones that want the soundtrack but absolutely have no intention of paying for it wont be lacking ways to get them, even if the files are encrypted. It does remove the easiest way though.
Yeah, I mean I do put my music on streaming services, including YouTube. Did the same thing with the soundtrack for my first game. The fact is if people want it for free, even if it isn't the highest audio file quality (which I don't think most people care about), it is easy to rip for free, especially when it's on YouTube. I will just not encrypt the audio.

EDIT: Is there any way to hide just the sound option when on the main menu? Since the soundtrack toggle does nothing to the switch unless you are in gameplay, it would be less confusing for players if I could just have it not show up when you're accessing the options on the main menu.
I actually was playing with a similar idea recently, and wrote a little plugin that can do alternate audio for MZ. It also seems to work even with audio encryption on. Feel free to give it a try!
update: posted a thread for it. if you use it and have any issues or whatever, feel free to post them there 🙂
This is awesome! I made a post in your thread on your plugin to hopefully help keep things more organized for you. And in my brief testing, it is working OK with encrypted audio.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-that-lets-you-change-between-soundtrack-versions-like-final-fantasy-pixel-remasters.179933/