Universal Dynamic Music Mod

For high-res texture/sprite projects, sprite-fix patches, music add-ons, music randomizers, and other graphic/sound-only projects.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
snackerfork
Posts: 25
Joined: Thu Jun 29, 2017 8:40 am

Universal Dynamic Music Mod

Post by snackerfork »

Universal Dynamic Music Mod

This is instructions and a base file for how to build a universal dynamic music mod for Zdoom, which (like in Doom 2016) will automatically play combat music when the player is in combat or has recently been in combat, and play ambient music when all enemies are dead or the player has left combat for a period of time. It is based around Doom 2016 and is intended for use with Embers of Armageddon, but it can be used with any mod and any music from any game (or an arbitrary number of games or music sources).

Since this is based around Doom 2016, it assumes that you have access to the Doom 2016 OST as well as its ambient/miscellaneous tracks, and provides instructions for how to upload them to the PK3. For copyright and bandwidth reasons, no music is provided. The Doom 2016 OST can easily be bought from your music store of choice, and it's not difficult to find the other tracks. Of course, you can use any game's music if you don't wish to purchase the Doom 2016 OST.

Credit goes to Apeirogon, who created the base version of all the code and extensively helped with writing it. Please do not reupload this without crediting Apeirogon and myself.
User avatar
Dr_Cosmobyte
Posts: 2759
Joined: Thu Jun 04, 2015 9:07 pm
Location: Killing spiders.

Re: Universal Dynamic Music Mod

Post by Dr_Cosmobyte »

There is another early game which does that, but considering the year (1996), i bet it was made through map sectors and hackery, as doom clones tended to do back then (jump for 3:27 for actual gameplay):



I more than often mention this game, mostly because this was my first FPS game, followed by PSX Hexen and only then the fatidic SNES Doom. But it has a extremely cool soundtrack (often epic and heroic, sometimes dark and moody), and so i think this mini-mod might be a helluva good thing to work with.

Thanks for giving us this!
User avatar
BROS_ETT_311
Posts: 218
Joined: Fri Nov 03, 2017 6:05 pm

Re: Universal Dynamic Music Mod

Post by BROS_ETT_311 »

Ho boy have I been anxious for something like this. I actually originally found this on the EOA server, but I'm glad that it's posted here as well because this absolutely deserves more exposure.

Anyway, I followed the instructions to the letter using the Doom 2k16 OST and all seems to work as intended...and I must say it's pretty kickass! Only nitpick for me is whenever there's a transition, the music completely fades out before the next track fades in, though that could be just an engine limitation. Ideally, the next track should start fading in just as the previous is about to fade out, so basically an audio crossover.

However, I think this mod would be even more effective if there were a way to both: 1. use a selection of tracks per level (ie. if stems were available), then; 2. this step pertains more to stems, find a way to trigger the tracks to align with the bpm (perhaps by tics? Not sure how feasible this is).

I can actually provide stems from my music pack to tinker with should the idea spark your interest. Regardless, this is a downright amazing tool and can't wait to experiment with more music for it. Thank you for this awesome mod!
XLightningStormL
Posts: 384
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

Re: Universal Dynamic Music Mod

Post by XLightningStormL »

BROS_ETT_311 wrote:However, I think this mod would be even more effective if there were a way to both: 1. use a selection of tracks per level (ie. if stems were available), then; 2. this step pertains more to stems, find a way to trigger the tracks to align with the bpm (perhaps by tics? Not sure how feasible this is).

I can actually provide stems from my music pack to tinker with should the idea spark your interest. Regardless, this is a downright amazing tool and can't wait to experiment with more music for it. Thank you for this awesome mod!
A user called Travis was working on something akin to UDMM here: viewtopic.php?f=19&t=61261

Still it'd be nice if there was a way to split battle into "Suspicious" and "Combat" would be useful for mods that have "forgetful" enemies, though the issue is properly detecting how combat is initiated (tokens? Detecting when the player or an entity is attacked by "legal" damagetypes"?

I could also see this being useful as a basepoint for a custom dynamic music controller where you can set specific tracks to specific levels, would be very useful for mappers.
CaptainNurbles
Posts: 274
Joined: Sat Jan 27, 2018 9:12 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: The Deepest Reaches of Space
Contact:

Re: Universal Dynamic Music Mod

Post by CaptainNurbles »

Fuckin' SWEET

I've given this a go and as an experiment I decided to take the battle music from GTFO and split it up into its individual 4 measure bars (The combat music in GTFO is split up into dozens of small tracks just 7.2ish seconds long each and are seamlessly switched around and played in different orders depending on how well the players are doing in combat.)

A good idea in theory, but in practice the script here just takes one of the 7 second loops and plays it over and over again. Is there a way to make it switch randomly between the clips I've thrown into it instead of looping one for forever? I don't know anything about coding and especially ZScript so looking through the code itself is just turning my brain to mush simply by looking at it.

EDIT: Shoulda played with it longer than just a few moments, it does swap around the tracks, but it loops individual songs several times before it fades out and fades into the next. How would I go about removing the looping feature and have it transition seamlessly, with the fadeout removed in favor of just changing songs instantly.
snackerfork
Posts: 25
Joined: Thu Jun 29, 2017 8:40 am

Re: Universal Dynamic Music Mod

Post by snackerfork »

Hi, I'm looking for someone who can help me record gameplay footage for a new version of this mod that adds support for Doom Eternal music and more variable music (i.e. different tracks for more intense and less intense combat encounters).

I need someone to download the mod and record themselves playing a map or series from maps from beginning to end without any deaths, and the map(s) must show off both the ambient music as well as the minor, major, and boss music - so they must have small encounters, large encounters, and either a Cyberdemon and/or Spider Mastermind. They can't be a single slaughter map or arena map because those will only play major/boss music, it must be a map with varying levels of combat difficulty. The difficulty settings and the mod you use don't matter, and you can replace the Doom 2016/Eternal music with any music - just as long as it shows off the features.

If this is something you think you can help me with, please private message me so we can talk and I can send you the mod.

ETA:
EDIT: Shoulda played with it longer than just a few moments, it does swap around the tracks, but it loops individual songs several times before it fades out and fades into the next. How would I go about removing the looping feature and have it transition seamlessly, with the fadeout removed in favor of just changing songs instantly.
Very delayed response, but if you want the fadeout to be instant, find "musvol -= 0.025;" and "musvol += 0.025;" and set 0.025 (or whatever it's set to) to 1.
Divada2
Posts: 1
Joined: Wed Mar 24, 2021 7:59 pm
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Universal Dynamic Music Mod

Post by Divada2 »

Hey there

Thanks for the mod, it's a really cool idea, I just have a little issue, in which the songs keep changing willy-nilly for no apparent reason, so the ambient tracks keep switching every 5-15 seconds and the combat tracks take too long to trigger when the hp threshold is reached (I tried changing it), and also keep switching every 5-15 seconds. I don't know if it was something I did wrong when changing the code (As I put music from Doom Eternal that I edited a bit) or if it's something else entirely.

Cheers
User avatar
ZikShadow
Posts: 574
Joined: Wed Jul 13, 2016 1:43 am
Location: Could be the chair, the floor, or the bed.

Re: Universal Dynamic Music Mod

Post by ZikShadow »

This mod's pretty cool so far, been playing it with Conflict: Desert Storm's soundtrack and the Hideous Destructor mod. Quite fascinating having quiet tracks play while you do quiet things instead of having the soundtrack always on mach 11 no matter what you do.

https://cdn.discordapp.com/attachments/ ... -39-36.mp4
https://cdn.discordapp.com/attachments/ ... -35-51.mp4
https://cdn.discordapp.com/attachments/ ... -32-61.mp4

That said, I wonder if it's possible to only have 1 set of ambient/combat tracks in a map, having them change as you swap maps. Seems odd sometimes to have ambience and combat tracks change constantly like it couldn't decide what mood the map should have.
snackerfork
Posts: 25
Joined: Thu Jun 29, 2017 8:40 am

Re: Universal Dynamic Music Mod

Post by snackerfork »

Divada2 wrote:Hey there

Thanks for the mod, it's a really cool idea, I just have a little issue, in which the songs keep changing willy-nilly for no apparent reason, so the ambient tracks keep switching every 5-15 seconds and the combat tracks take too long to trigger when the hp threshold is reached (I tried changing it), and also keep switching every 5-15 seconds. I don't know if it was something I did wrong when changing the code (As I put music from Doom Eternal that I edited a bit) or if it's something else entirely.

Cheers
The new version adds a longer timer before a track will switch, although I can possibly make it even longer to ensure that these kind of sudden changes don't happen. It's difficult to balance with how fast Doom's gameplay is.
Zikshadow wrote:That said, I wonder if it's possible to only have 1 set of ambient/combat tracks in a map, having them change as you swap maps. Seems odd sometimes to have ambience and combat tracks change constantly like it couldn't decide what mood the map should have.
This is entirely possible and I've considered it for the upcoming Doom Eternal version. I'd just have to make it so that the random music that's chosen is selected only at the start of the map and kept saved/stored until a new map is loaded. Ideally, I'd also be able to make truly dynamic music that continues playing in the background on mute once it starts and then picks back up rather than starting over every time, but I don't think this is possible? If it was, then I could even have the option for multiple "tracks" that fade in and out based on the situation.
User avatar
Ashat Maself
Posts: 61
Joined: Fri Apr 02, 2021 5:32 am

Re: Universal Dynamic Music Mod

Post by Ashat Maself »

i've tried modifying it to add my own music but it seems to struggle finding midi files, any ideas on potential fixes

edit: turns out that for midi the file names cant be over a certain limit, maybe include this in the guide? also, as a suggestion, combat music should play when holding a bfg, or similar weapons in other games (i.e Wexen's Wraithverge, Quietus and Bloodscourge)
ParadoX6891
Posts: 3
Joined: Sat Jan 01, 2022 4:48 pm

Re: Universal Dynamic Music Mod

Post by ParadoX6891 »

Hi, wanna say, i really liked your mod, especially option for setting boss fight music. I haven't seen this feature in similar mods. But mod really lacks of option for setting one ambient \ battle music set for one map, like Zikshadow already said. Constantly switching music become annoing :(
There are another mod for same function - "DoomDynMus - a dynamic music mod" by cyber_cool. It has needed option (1 music set for 1 map), and, also, has death music option.
Between these two mods i defenetly select yours, if it will not change music sets "on fly".
So... Any progress on that?
Post Reply

Return to “Graphic/Audio Patches”