NEXT_TRACK audio tag

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
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

Post by Major Cooke »

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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: NEXT_TRACK audio tag

Post by Nevander »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: NEXT_TRACK audio tag

Post by Graf Zahl »

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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: NEXT_TRACK audio tag

Post by Nevander »

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. :wink:

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.
User avatar
Rachael
Posts: 13968
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: NEXT_TRACK audio tag

Post by Rachael »

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!
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: NEXT_TRACK audio tag

Post by Nevander »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: NEXT_TRACK audio tag

Post by Graf Zahl »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: NEXT_TRACK audio tag

Post by Graf Zahl »

Nevander wrote:People expressed interest in running my mod in that old (1.8.6) of a version...
Ugh...
If those owners of old hardware are even using old versions of the engine, I think we might ditch OpenGL 2 support for good. :twisted: Obviously the target base this is meant for have decided to stay behind not only in hardware but also in software...
User avatar
Rachael
Posts: 13968
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: NEXT_TRACK audio tag

Post by Rachael »

Nevander wrote:Well the map in question is the titlemap, so it can't be paused with escape or console.
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.
Graf Zahl wrote:
Nevander wrote:People expressed interest in running my mod in that old (1.8.6) of a version...
Ugh...
If those owners of old hardware are even using old versions of the engine, I think we might ditch OpenGL 2 support for good. :twisted: Obviously the target base this is meant for have decided to stay behind not only in hardware but also in software...
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)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: NEXT_TRACK audio tag

Post by Graf Zahl »

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!)
dpJudas
 
 
Posts: 3177
Joined: Sat May 28, 2016 1:01 pm

Re: NEXT_TRACK audio tag

Post by dpJudas »

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

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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: NEXT_TRACK audio tag

Post by Nevander »

Rachael wrote:
Nevander wrote:Well the map in question is the titlemap, so it can't be paused with escape or console.
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.
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?

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.
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: NEXT_TRACK audio tag

Post by Chris »

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?
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.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: NEXT_TRACK audio tag

Post by Nash »

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.
I've submitted a mod playlist suggestion a while ago. :D
User avatar
Rachael
Posts: 13968
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: NEXT_TRACK audio tag

Post by Rachael »

Chris wrote:
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?
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.
Pretty much this.
Nevander wrote:Getting real tired of your condescending replies that don't help anyone but you and your elitist friends.
I'm going to put my reply in PM since it's very long-winded.
Post Reply

Return to “Feature Suggestions [GZDoom]”