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 YOUR 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.

Universal Dynamic Music Mod

Postby snackerfork » Mon Nov 30, 2020 9:09 pm

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.
snackerfork
 
Joined: 29 Jun 2017

Re: Universal Dynamic Music Mod

Postby Dr_Cosmobyte » Tue Dec 01, 2020 5:02 pm

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
Dr_Cosmobyte
Also known as: GAA1992
 
Joined: 04 Jun 2015
Location: Killing spiders.

Re: Universal Dynamic Music Mod

Postby BROS_ETT_311 » Sat Dec 05, 2020 4:12 pm

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!
User avatar
BROS_ETT_311
 
Joined: 03 Nov 2017

Re: Universal Dynamic Music Mod

Postby XLightningStormL » Sun Dec 06, 2020 8:50 am

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: https://forum.zdoom.org/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.
User avatar
XLightningStormL
Former DUSK Wiki Master
 
Joined: 09 May 2016
Discord: XLightningStormL#7461
Twitch ID: XLightmingStormL

Re: Universal Dynamic Music Mod

Postby CaptainNurbles » Wed Dec 16, 2020 10:00 pm

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.
CaptainNurbles
 
Joined: 27 Jan 2018
Location: The Deepest Reaches of Space
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Universal Dynamic Music Mod

Postby snackerfork » Wed Mar 03, 2021 10:11 pm

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.
snackerfork
 
Joined: 29 Jun 2017

Re: Universal Dynamic Music Mod

Postby Divada2 » Wed Mar 24, 2021 8:06 pm

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
Divada2
 
Joined: 24 Mar 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Universal Dynamic Music Mod

Postby ZikShadow » Thu Mar 25, 2021 5:11 am

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.
User avatar
ZikShadow
 
Joined: 13 Jul 2016
Location: Could be the chair, the floor, or the bed.

Re: Universal Dynamic Music Mod

Postby snackerfork » Thu Mar 25, 2021 5:07 pm

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.
snackerfork
 
Joined: 29 Jun 2017

Re: Universal Dynamic Music Mod

Postby Ashat Maself » Thu Apr 15, 2021 9:29 am

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)
Ashat Maself
 
Joined: 02 Apr 2021


Return to Graphic/Audio Patches

Who is online

Users browsing this forum: No registered users and 1 guest