[Feature] Dynamic ZScript Interactivity with Midis
Closed this issue · 1 comments
GZDoom version
4.14.1
Which game are you running with GZDoom?
Doom 2
What Operating System are you using?
Linux x86_64
If Other OS, please describe
No response
Relevant hardware info
No response
Is your feature request related to a problem? Please describe.
It bothers me greatly how there are no options to dynamically alter midi music, other than Setmusicvolume and changing the Midi outright. It would be so cool if midis could seamlessly change and alter based on in-game context.
Let's say, you have a level with really cool music that starts with a quiet intro, then some heavy rock sections or whatever;
Let's say, the player reaches a section with 16 cyberdemons. Really intense. But the midi, has already looped back to the start, and this boring section of the music is now playing whilst you fight for your life, barely hanging on.
Describe the solution you'd like
The ability to change the volume of individual Midi Channels, dynamically, from Zscript.
There could be some function like: SetMidiChannelVolume(int Channel, float Volume)
So people could quieten or louden the drums, or guitars during gameplay.
There could also/instead be the ability to Multiply the Tempo of a currently playing song by a Variable that can be set through Zscript.
I think these would be brilliant additions for the GZDoom modding scene!
Describe alternatives you've considered
I could instead just get a bunch of actors to play pre-compilied music layers, and tell them to get quieter/louder based on certain conditions, but that still has issues, other than the fact it's not midi and can't have the soundfont changed; Having the actors be properly affected by the player's music and sound sliders has proved difficult to me, and to add on to that, the tracks seem to desyncronize as well...
I think the previous solution would work better, and would be much more accessible to modders.
Add any other context or screenshots about the feature request here.
For an example of a tempo multiplier, this midi player has a tempo slider, which multiplies the tempo of the currently playing song.

This is not going to happen.
First, the MIDI code is an external library, second it allows various non-MIDI formats and last but not least, this is an area where an amateur can create lots and lots of garbage. Audio is best left to people who know how it works.