NEXT_TRACK audio tag
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8218
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
NEXT_TRACK audio tag
Some songs I would actually like to change to a different song based on specification when it reaches the end. This is mainly for songs which are not meant to loop. I.e. if a song fades out to silence, I would like to change the track to no music once its finished playing so if I want to, I can successfully use the ChangeMus command again without need to first do:
ChangeMus ""
ChangeMus "LumpName"
Right now I've set up the track to have an extra second of silence at the end of it, and that's where LOOP_START goes to emulate having no music. Which, I must admit, is a bit hacky.
ChangeMus ""
ChangeMus "LumpName"
Right now I've set up the track to have an extra second of silence at the end of it, and that's where LOOP_START goes to emulate having no music. Which, I must admit, is a bit hacky.
Re: NEXT_TRACK audio tag
Another thing I'd love is to change music based on the length of the currently playing audio file or MIDI. For example, for some reason there is a difference in tics for a MIDI in older versions of GZDoom than in the latest. What I mean is, if I delay by 57 seconds, the MIDI cuts off too late on 3.2.5 but it's fine on 2.2.0 and cuts off at the end of the MIDI as intended. Not sure what caused the duration to change between those versions.
Anyway, some way to be able to change music to something else based on the length of the MIDI instead of making a guess from a delay would also be really helpful.
Anyway, some way to be able to change music to something else based on the length of the MIDI instead of making a guess from a delay would also be really helpful.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: NEXT_TRACK audio tag
The duration of the music has not changed. What has changed is the game timer which is now exactly 35fps. In older versions it was only milliseconds-precise which led to a slightly accelerated playsim at 35.5 fps.
Bottom line: You cannot sync to the music. Even something banal as switching MIDI synths or sound fonts during play will restart the song.
Bottom line: You cannot sync to the music. Even something banal as switching MIDI synths or sound fonts during play will restart the song.
Re: NEXT_TRACK audio tag
So that means if I shorten the duration, then it will be cutting off early in old versions? That's fantastic!
I suppose I'll fix it for the newest version since most people will be using the latest... or wait, I could do a CVAR to control the duration depending on the version the player is on. If it cuts off early for you, turn the CVAR on.
I know what you'd say... don't do that and let it stay broken on old versions. I understand your point but I like supporting compatibility with as many versions of the engine as possible. I even decided to revert a change to the Lost Souls that made them more accurate to the source material at the cost of breaking compatibility with Zandronum and older versions of GZDoom. I don't like breaking compatibility, even down to a MIDI not playing right.
I suppose I'll fix it for the newest version since most people will be using the latest... or wait, I could do a CVAR to control the duration depending on the version the player is on. If it cuts off early for you, turn the CVAR on.
I know what you'd say... don't do that and let it stay broken on old versions. I understand your point but I like supporting compatibility with as many versions of the engine as possible. I even decided to revert a change to the Lost Souls that made them more accurate to the source material at the cost of breaking compatibility with Zandronum and older versions of GZDoom. I don't like breaking compatibility, even down to a MIDI not playing right.
Re: NEXT_TRACK audio tag
Older versions are completely not a concern for the development team. Graf is right though that you cannot time game sim events to a thread-timed event like the music - one tap of the escape or console key and the timing is already off.
If you're going to support as many versions of the engine as possible, are you going to support ZDoom 1.22 that has literally almost none of the editing elements we have today, except *maybe* Hexen map format, and absolutely no DECORATE support? Have fun with that!
If you're going to support as many versions of the engine as possible, are you going to support ZDoom 1.22 that has literally almost none of the editing elements we have today, except *maybe* Hexen map format, and absolutely no DECORATE support? Have fun with that!
Re: NEXT_TRACK audio tag
Well the map in question is the titlemap, so it can't be paused with escape or console.
My target compatibility for the mod to at least run in, maybe not every little thing working like multi tag sectors (which I don't use because of this) is 1.8.6. People expressed interest in running my mod in that old of a version so that's the one I'd like to target for the low end. I also want it to run flawlessly in the latest since the majority will be using that.
My target compatibility for the mod to at least run in, maybe not every little thing working like multi tag sectors (which I don't use because of this) is 1.8.6. People expressed interest in running my mod in that old of a version so that's the one I'd like to target for the low end. I also want it to run flawlessly in the latest since the majority will be using that.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: NEXT_TRACK audio tag
Well, then you have a problem - because that age-old timing problem has finally been fixed. And we have absolutely no interest whatsoever to bring it back.
If you absolutely have to have synchronized music, you have to play it as a sound effect - with all the problems that may bring.
BTW, even for the titlemap there are ways to interrupt it without stopping the music - and there's certainly ways to restart the music without the map ever realizing.
If you absolutely have to have synchronized music, you have to play it as a sound effect - with all the problems that may bring.
BTW, even for the titlemap there are ways to interrupt it without stopping the music - and there's certainly ways to restart the music without the map ever realizing.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: NEXT_TRACK audio tag
Ugh...Nevander wrote:People expressed interest in running my mod in that old (1.8.6) of a version...
If those owners of old hardware are even using old versions of the engine, I think we might ditch OpenGL 2 support for good.
Re: NEXT_TRACK audio tag
If you must utterly insist on using broken and flawed methods to accomplish timing "tricks" with your music, don't come crying to us when it breaks. And it will.Nevander wrote:Well the map in question is the titlemap, so it can't be paused with escape or console.
If it comes to that, we should probably consider helping dpJudas complete the Hardpoly renderer, since he was working on making it fully API-agnostic - in that the same draw commands could be batched to D3D, OpenGL, or to a Software triangle drawer. That might mean Vulkan support is possible, too - all with a single renderer. We could include a Mesa dll for shader support for those older systems that do not support it, but that would come at a significant cost of performance. (However, Mesa is compiled with LLVM, which means that the CPU shader code will at least be somewhat optimized)Graf Zahl wrote:Ugh...Nevander wrote:People expressed interest in running my mod in that old (1.8.6) of a version...
If those owners of old hardware are even using old versions of the engine, I think we might ditch OpenGL 2 support for good.Obviously the target base this is meant for have decided to stay behind not only in hardware but also in software...
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: NEXT_TRACK audio tag
I somehow doubt that the people this would be meant for, would be able to benefit from it. Don't forget, most of those left-behind systems are not easily upgradeable desktops but bottom-of-the-barrel cheap-ass laptops that are not only stuck with bad graphics support but also with comparatively weak CPUs.
I think that GL2 will bite the dust at the very latest when some multithreading gets added to the renderer. That would necessitate some design changes with moving all the data passing to uniform buffers, but since this old hardware cannot do that it would not even be able to run the multithreaded renderer, unless the old one was kept in as a duplicate. Multithreading will inevitably mean upping the system requirement to GL 3.3 (no, no riskymodernpath anymore!)
I think that GL2 will bite the dust at the very latest when some multithreading gets added to the renderer. That would necessitate some design changes with moving all the data passing to uniform buffers, but since this old hardware cannot do that it would not even be able to run the multithreaded renderer, unless the old one was kept in as a duplicate. Multithreading will inevitably mean upping the system requirement to GL 3.3 (no, no riskymodernpath anymore!)
Re: NEXT_TRACK audio tag
There are differences between the 3D API's (D3D, GL, Vulkan) that affect performance. Those differences aren't particular important in the post processing parts of the code, but they are for the scene drawing. It isn't really possible to abstract those differences away so what I'm trying to do on my master branch is to allow the DFrameBuffer code to boot up with any given 3D backend and then still hand off the actual rendering to a specific renderer.Rachael wrote:If it comes to that, we should probably consider helping dpJudas complete the Hardpoly renderer, since he was working on making it fully API-agnostic - in that the same draw commands could be batched to D3D, OpenGL, or to a Software triangle drawer. That might mean Vulkan support is possible, too - all with a single renderer.
To be clear here: I'm not trying to replace the GL renderer with hardpoly. The abstraction will just make it easier for renderers to share code that don't really have to differ.
Btw. the main concern I have with what I'm doing on my master branch is Linux. The Direct3D 11 implementation I have in place will make everyone on Windows happy except for XP users, but for Linux there's no "SDL 2D mode" fallback. That means Linux versions of GZDoom will always require OpenGL. I don't know how much of a problem that will be. XP can also still be supported, but that would mean XP users also will have to use OpenGL.
Re: NEXT_TRACK audio tag
Then what magic method do you suggest for changing the music on demand when both are MIDI lumps and the only logical and possible way to do it is with a timed delay the same length as the MIDI?Rachael wrote:If you must utterly insist on using broken and flawed methods to accomplish timing "tricks" with your music, don't come crying to us when it breaks. And it will.Nevander wrote:Well the map in question is the titlemap, so it can't be paused with escape or console.
Getting real tired of your condescending replies that don't help anyone but you and your elitist friends.
Last edited by wildweasel on Fri Feb 23, 2018 9:08 pm, edited 1 time in total.
Reason: A warn was issued for this post. We are a community of respect, and a little politeness would have gone a long way here.
Reason: A warn was issued for this post. We are a community of respect, and a little politeness would have gone a long way here.
- Chris
- Posts: 2983
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: NEXT_TRACK audio tag
If a playlist doesn't work, that may be a viable feature request to automatically start a different song after one ends, without any script timing trickery. Along with being able to specify if the whole playlist loops at the end, just the last song in the playlist loops, or it doesn't loop at all and just stops at the end.Nevander wrote:Then what magic method do you suggest for changing the music on demand when both are MIDI lumps and the only logical and possible way to do it is with a timed delay the same length as the MIDI?
Re: NEXT_TRACK audio tag
I've submitted a mod playlist suggestion a while ago. :DChris wrote: If a playlist doesn't work, that may be a viable feature request to automatically start a different song after one ends, without any script timing trickery. Along with being able to specify if the whole playlist loops at the end, just the last song in the playlist loops, or it doesn't loop at all and just stops at the end.
Re: NEXT_TRACK audio tag
Pretty much this.Chris wrote:If a playlist doesn't work, that may be a viable feature request to automatically start a different song after one ends, without any script timing trickery. Along with being able to specify if the whole playlist loops at the end, just the last song in the playlist loops, or it doesn't loop at all and just stops at the end.Nevander wrote:Then what magic method do you suggest for changing the music on demand when both are MIDI lumps and the only logical and possible way to do it is with a timed delay the same length as the MIDI?
I'm going to put my reply in PM since it's very long-winded.Nevander wrote:Getting real tired of your condescending replies that don't help anyone but you and your elitist friends.