Apply events to defeat song only?

Putting this under support because I doubt a plugin's required for it.

Is there a way to perform dynamic effects on fanfare, like events that only occur when a specific song is played? I'm trying to go for a SMRPG effect (see below) where the music steadily descends in pitch once your party is knocked out.




Not sure how to go about this. I can add four or five lines that decrease the music's pitch, but there doesn't seem to be a "Game Over" condition for battles.
If, by "events", you mean JavaScript code, then it could either be done as a plugin or within the default code (which you'd risk losing when you took an update and pasted the new version over your existing version).


In any event, it can't be done by "events" in the map editor, so it belongs in the javascript section. So do you want it as a plugin, or do you just want to be told where to make the change in the default scripts?
I guess a plugin would be more useful in the long-run. Would that be hard to make?
Don't know - you'll have to be more specific about what you want to happen, and under what conditions.


I will move it over there for you though.

Original thread: https://forums.rpgmakerweb.com/threads/apply-events-to-defeat-song-only.50144/