ModPlug Central

OpenMPT => Help and Questions => Topic started by: Wurlit on November 04, 2014, 12:21:59

Title: High resolution output
Post by: Wurlit on November 04, 2014, 12:21:59
So, i've read an old topic here about the 24 and 16 bit debate but i'm still confused as to what happens if i want to use plug-ins inside OpenMPT, like equaliser etc which process the sound at higher depth. I have tracks with 16 bit samples with various sampling rates (somehow usampling the hz causes weird modulation so i decided to leave them at their original values). Will i gain the whatever "air" the plug-ins are adding if i mixdown the final stereo files to 24/96, or should i mixdown the channels to 24/96 without the plug-in effects and import them into a DAW and work there? I mean, if the engine of the tracker doesn't somehow convert the signal back to 16 bit internally before the export, there's no reason for the additional use of another program. But since this way i'll be converting the sampling rate too, wouldn't the extra step of using a DAW be a better approach in the end?
Title: Re: High resolution output
Post by: Saga Musix on November 04, 2014, 13:16:00
OpenMPT's mixer always runs at 32 bit integer precision, no matter what the sample bit depth are (you have to add 12 bit of volume amplification on top of those 16 bit anyway, so that's 28 bit dynamic range for 16 bit samples). VST plugins always run at an internal resolution of 32 floating point bit as well (which is equivalent to 24 bit integer precision), so there's not thing to worry about.
Title: Re: High resolution output
Post by: Wurlit on November 04, 2014, 18:11:38
That clarified things a... bit! But what about the rate? Most of the samples are around 8 to 20khz, so that's really low. And i can't upsample through the "samples" tab because it causes undesirable mangling on a few. It doesn't affect all of them and not the samples themselves, it rather gives a tremolo effect on playback, don't know why. So, assuming a couple of VSTs do oversampling, how does OpenMPT handles it, is it the same working with such a low rate and mixdown to 96khz? Or would be better to export and work on already 96khz upsampled files?
Title: Re: High resolution output
Post by: Saga Musix on November 04, 2014, 19:07:04
You have to keep in mind that low-quality samples do not suddenly get pristine by merely upsampling them. Much of their charm comes from the fact that trackers in the past used very cheap resampling algorithms - such as no interpolation at all or simple linear interpolation. Even OpenMPT's best resampling algorithms - Polyphase and XMMS - are merely 8-tap filters, while modern resamplers (such as the one in r8brain or sampler VSTs) often use dozens, sometimes even hundreds of taps for "perfect" resampling.
But this kind of perfect resampling simply destroys the sound of the original samples which were meant to sound rough and edgy (mostly because bad resampling adds aliasing frequencies in the treble range of the spectrum, so the samples sound "fresher" than with perfect resampling, which would just result in no treble at all). I don't quite know what you are doing, but it sounds like you are doing some kind of remix project with oldskool modules, so I would recommend to stick with the original sample tracks and bouncing them to WAV in OpenMPT using its own resampling algorithms, and then do the postprocessing somewhere else, or even right in OpenMPT if you like.
Title: Re: High resolution output
Post by: Wurlit on November 04, 2014, 20:01:54
I agree. I do not expect the samples to sound better just by resampling, but i rely on equalisation and possibly some subtle reverb to do that, at least up to a degree. I want to prepare the ground and retain as much quality as i can from the enhancing. Having the sound rough and edgy is one thing and certainly has its place on the vintage side of things (which i also like) but the thing here is i had to deal with lots of broadband noise. Now i want to give some sparkle back to the mix and spruce it up a bit. I'm remastering an old game soundtrack and i want to remain faithful to the feeling and intentions of the composer so, yes, i work only with the provided samples. So you say it's best to work with the resampled versions instead of messing with the plug-ins before the upsampling. I guess i wanted to make it easier by having to use just the tracker as it is, without any bouncing out and in again. But anyway. Thanks, man.
Title: Re: High resolution output
Post by: Saga Musix on November 04, 2014, 20:40:39
You should probably also play around with using different export sampling frequencies when bouncing out of OpenMPT, since you will probably get slightly different aliasing artefacts depending on whether you export at e.g. 48 KHz vs 96 KHz. Maybe it makes a difference that would be useful for your project. This kind of stuff is always subject to a lot of experimentation. :)
Title: Re: High resolution output
Post by: Wurlit on November 07, 2014, 14:31:36
So there i thought everything was peachy... There's another issue with the bouncing. Some tracks have two or three sections and i can't find a way to make the tracker see them, it plays and exports only the first section from each track. The old ModPlug Player does the job fine though (!) but unfortunately doesn't export individual instruments or channels and only goes up to 48khz. Did i overlook something through the options?

Another thing i noticed is that with Foobar, it also plays fine plus it divides the sections on the playlist so you can see the parts. But one section plays different than how ModPlug Player does. They're like two versions which are triggered somehow depending on the way each decoder functions. Well, in any case the "correct" version is the MPP one, Foobar likes to play the tune that isn't used in-game. Welcome to the Twilight Zone...
Title: Re: High resolution output
Post by: Saga Musix on November 07, 2014, 15:01:46
You can select parts of the order list contaning "hidden songs" and then right-click to export them as well.
Title: Re: High resolution output
Post by: Wurlit on November 07, 2014, 16:13:05
Got it. I was using the per instrument export, which misses the "hidden" patterns. Exporting with the channel option works but the outcoming files don't have the same duration as the instrument option, so i have to align them afterwards. I wonder why doesn't work both ways. Oh well, you miss something, you gain something.
Title: Re: High resolution output
Post by: Saga Musix on November 07, 2014, 18:02:04
Huh? That should most definitely not happen. I'll look into it...

EDIT: Nope, can't spot a difference. Whether you use channel export, instrument export or none of the two should have no influence at all over the export length. Maybe you accidentally chose a different amount of order items?
Title: Re: High resolution output
Post by: Wurlit on November 07, 2014, 21:04:37
I'm sorry, i don't understand what you mean by your question. I just open the file and go to export, then i bounce normally to stereo, or select either the channels or the instruments option. The channels one gives me some tracks with smaller duration than the rest, but only this includes the audio the first two choices miss. I could give you an example .s3m if you want, i've already tried it with a couple of files and had the same results. Pity, because the instruments output is ideal for mastering reasons.
Title: Re: High resolution output
Post by: Saga Musix on November 07, 2014, 21:24:50
Quote from: Wurlit on November 07, 2014, 21:04:37
I'm sorry, i don't understand what you mean by your question.
Well, you said you wanted to export sub tunes, and for that you have to specify the orders that are covered by this subtune - so I simply assumed that you might have accidentally chosen a different amount of orders when exporting by instrument.
Anyway, all the per-channel and per-instrument export modes do is muting channels and instruments and doing the export several times. I cannot reproduce them changing the length of the exported files and I would be very surprised if they did that, because there's no code that could cause that.
So, please verify that the application you're trying to load the files into isn't trying to be smart and removes silence at the end of the imported files or whatever. Load the exported files right into OpenMPT's sample editor and look at the sample length there. OpenMPT will definitely not try to cut silence or anything, so you should be able to verify there if the files have the same length indeed. If they don't, please provide an example file and the exact steps you are doing to reproduce this.
Title: Re: High resolution output
Post by: Wurlit on November 07, 2014, 22:38:25
I've loaded the files in two players, an audio editor and the tracker, they all show the same results. Here are some screenshots from the players and the first two channels through OpenMPT.

Foobar normal output:
(http://ultraimg.com/images/normalfoobar.png)

Pot Player normal output:
(http://ultraimg.com/images/normalpotplayer.png)

Foobar channel output:
(http://ultraimg.com/images/channelsfoobar.png)

Pot Player channel output:
(http://ultraimg.com/images/channelspotplayer.png)

Foobar instrument output:
(http://ultraimg.com/images/instrumentsfoobar.png)

Pot Player instrument output:
(http://ultraimg.com/images/instrumentspotplayer.png)

OpenMPT channel 1:
(http://ultraimg.com/images/channel1openmpt.png)

OpenMPT channel 2:
(http://ultraimg.com/images/channel2opnempt.png)

There's one minute difference between the normal/per instrument exports and the channels due to the missed parts, and a deviation of some seconds between the channels themselves.
Title: Re: High resolution output
Post by: Saga Musix on November 07, 2014, 23:16:34
Ooops, hahaha, now I know what the problem is. In S3M files, muted channels are not evaluated at all, i.e. also global commands like pattern jumps will not be executed. Hence, per-channel export is a bad idea to use with S3M files the way it is currently being done (I think it's fixable but it may take a while). In the meantime, you may want to convert those S3M files to IT before exporting. The difference between the two formats should be negligible.
Title: Re: High resolution output
Post by: Wurlit on November 08, 2014, 08:49:21
Funny how easy the workaround is sometimes. Now all exports have the same length, well, although i still have to go through every mix and look for hidden mixes. Where's the magic button to surface those submixes instead of auditioning every pattern? It just puzzles me why does the tracker pass by those sections whereas the old player plays and renders perfectly.
Title: Re: High resolution output
Post by: Saga Musix on November 08, 2014, 13:41:21
Simply put, it's not the job of a tracker to do that. The code for detecting sub tunes is there, but there's no real use for it in a tracker (it will at some point be used in libopenmpt though, so that all sub tunes can be played with our XMPlay plugin). Your use case of exporting all sub tunes is not a common one for the tracker software.

However: Looking at your example of K_vision.umx actually reveals that ModPlug Player does not do what you want, either. Simply put (after remembering what the original code looked like), the player ignores backwards jumps in the order list and continues playing the patterns that follow after the last pattern of the first tune. This is incredibly stupid, for several reasons:
In your specific example (an Unreal song), the second subtunes starts at a different location. Unreal engine games usually put the start of each subsong at the beginning of the order list, and the rest of the songs follows later. To visually demonstrate this, the order list usually looks like this (numbers indicate which subsong a pattern belongs to):
[1] [2] [3] [4] [1] [1] [1] [1] [1] [1].......... [1] [2] [2] [2] [2] [3] [3] [3] [3] [3] [4]
What does ModPlug player do? Well, it first plays all the patterns labelled [1], and then plays all the patterns following it. This means that it will cut off the first pattern of each sub songs, and more importantly, it continues playing the patterns after subsong 1 with the same global settings (most importantly the same tempo, which usually may differ between subsongs) as the first subsong. This is not what you want.
If you want all subsongs to be exported to WAV, XMPlay is currently your best friend, as it will split them correctly, unlike ModPlug Player.
Title: Re: High resolution output
Post by: Wurlit on November 08, 2014, 15:35:37
If ModPlug Player handles the patterns so frivolously, you mean for all these years i was listening to a monstrosity? Ouch! And i grew loving exactly that one-tempo-for-all MPP produced, especially near the end of this track.

As for XMPlay, that one recognises all subsongs but cuts the first seconds of the first section unless i manually divide it before the conversion. No big deal but still an issue. The deal breaker is (comparing to natively loading it in Foobar) the additionally cut of another six or so minutes from the end of the last subsong. Heck, so many options, all bear different results.

I understand i'm not a usual case, thus i doubly appreciate your answers. To make it short, i've killed MPP and since XMPlay doesn't offer any improvement over Foobar on my case, if i want to export stereo i'll go with Foobar, no problems here. But i'm sticking with MPT for now, for the various outputs it gives.
Title: Re: High resolution output
Post by: Saga Musix on November 08, 2014, 16:02:24
QuoteIf ModPlug Player handles the patterns so frivolously, you mean for all these years i was listening to a monstrosity? Ouch!
Indeed! ;D But no worries, you are not the only person this world being betrayed  by their favourite mod player... I had no idea what the menu music from Extreme Pinball really was supposed to sound like until I played the actual game, and it was so different... ;D

The way I see it, XMPlay does exactly what it should do, i.e. it doesn't cut off anything that's supposed to be there. Whether you like the "correct" behaviour or not is a different story. ;) It jumps over the second pattern because that's where the second sub song starts, if that's what you mean.
Title: Re: High resolution output
Post by: Wurlit on November 08, 2014, 16:24:44
I mean, if i just load the track and export it cuts the first five seconds or so. If i right-click and divide the sections then export one-by-one, it includes these first seconds but in both cases there's a long part, which i can listen with Foobar but the XMPlay cuts, quite abruptly too. Foobar ends fine by itself but also loops smoothly with the beginning if played on repeat. Well, maybe XMPlay does what indeed the composer wanted (writing music for a game like this, with loops and so), but it doesn't work that well for listening. And where's that six minute part came from?! Ah, the mysteries of numbers...
Title: Re: High resolution output
Post by: Saga Musix on November 09, 2014, 01:44:01
Uhm, XMPlay shouldn't be cutting off anything. However, if you start playback before you enable wav export, XMPlay will not re-start export from the beginning but rather from the part where you stopped playing. Maybe that's the issue you're having? And no, there is definitely no hidden six minutes part in K_vision.umx
Title: Re: High resolution output
Post by: Wurlit on November 09, 2014, 10:51:55
Good day! I surely gave XMPlay another try, you're right about the first part. I figure the behaviour of these programs is a bit finicky, but that's their charm you may say and i would agree up to a point. Unfortunately, i wish you were also true about the missing parts. Man, it's a massacre. Many tracks are affected and i'm not talking about repeating loops, there's another example of a 23s reverb-like tail in another track where XMPlay lowers the cleaver at 8s, something it's not supposed to do. Of all four programs, only Foobar plays it to the end where i can hear the fade-out go on until the volume reaches zero.

Time for another screenshot.
(http://ultraimg.com/images/foobar-xmplay.png)

I've included both tracks, no MPT/MPP. I ahould also mention that the first is S3M while the second is IT. Maybe XMPlay excels in handling other formats, but for these two it malfunctions somehow. Myself, i see no other option than to forget about the instruments and proceed with stereo files. But i'm fine with what i have, it saves me so much time and space, and forces me to be even more creative when restoring the audio.

Just for the sake of conversation i'm willing to mess around more and, you know, i can always send you settings and files if you're curious and have some time to kill. It's about you now!
Title: Re: High resolution output
Post by: Saga Musix on November 09, 2014, 16:02:51
Those extra 6 minutes come from the fact that the third subsong jumps into the first subsong, which both OpenMPT and XMPlay treat as "I've been here before, I can stop playing now", while Foobar apparently treats it as it has never played those patterns before. This third subsong is unused in the original game and is most likely a leftover that has been forgotten while cleaning up the module, hence it jumps back into the first subsong and plays it at half speed. This is one more reason for preferring XMPlay's behaviour over Foobar's.
In the case of EndEx, that shorter subsong jumps into a non-existing pattern and just keeps playing the samples that were triggered before. Again, this tune looks like it's a leftover and is not actually played in the game, hence there is no real definition of what is right and what is wrong. Just because Foobar plays more patterns, that doesn't automatically mean that it's correct. ;)
Title: Re: High resolution output
Post by: Wurlit on November 09, 2014, 17:32:38
Nah, i've stopped thinking about correct versions a few posts ago. Nothing is correct and everything is, that much is clear. About those six minutes now, that was my first impression, too. But the first few seconds do exist in the game (they're used for the change), and then it doesn't just jump there, it feels rather an intentional command (?), having slower tempo et al. The same happens with the EverSmoke track. Another one and a half minute extra. Sure, they're both 95% leftovers, but the software catches them. There's a lot of music in general that didn't make it to the final product, be it a game, movie or whatever, it's a nice thing to be able to enjoy previously unheard material. Something i'd miss, if i was solely relying on XMPlay.

My point is that, besides hiding tunes, if XMPlay was treating these tracks normally, they wouldn't end so spasmodic comparing to other software. If they were supposed to end like XMPlay renders the sound, shouldn't the tracks be presented in-game the same way? And if it only sees what you hear when playing, why even grab the beginning of these unused audio in the first place? I agree, neither software is "correct", but one reveals more and has a smoother playback than the other. If it wasn't for the EndEx fade-out i wouldn't be that much suspicious, really.

EDIT: Listening EverSmoke more carefully, there's a repeat on the half third section of the Foobar version, but still the other half is unique. This and a double export of a third section of another track (two tracks, same exact music) are the flaws i've found in Foobar.
Title: Re: High resolution output
Post by: Saga Musix on November 10, 2014, 00:12:37
Quote from: Wurlit on November 09, 2014, 17:32:38
Nah, i've stopped thinking about correct versions a few posts ago. Nothing is correct and everything is, that much is clear. About those six minutes now, that was my first impression, too. But the first few seconds do exist in the game (they're used for the change), and then it doesn't just jump there, it feels rather an intentional command (?), having slower tempo et al. The same happens with the EverSmoke track. Another one and a half minute extra. Sure, they're both 95% leftovers, but the software catches them. There's a lot of music in general that didn't make it to the final product, be it a game, movie or whatever, it's a nice thing to be able to enjoy previously unheard material. Something i'd miss, if i was solely relying on XMPlay.
Yes, there might be some music that didn't make it into the final product, but the stuff that XMPlay cuts off doesn't really belong into that category. To give a nice analogy, what you are getting here is something like "Look, here are the first 10 seconds of Thriller, followed by Billie Jean at half speed. it's an entirely new song that noone ever heard before!" - well, uhm, I would hardly say that's a new song. You are still enjoying Billie Jean there, but at half speed. ;) Are you really saying now that you are missing something if you didn't listen to it? Using that argumentation, you could say that you always miss something when you don't make use of a bug or undefined behaviour.

Quote from: Wurlit on November 09, 2014, 17:32:38My point is that, besides hiding tunes, if XMPlay was treating these tracks normally, they wouldn't end so spasmodic comparing to other software.
You should probably turn on fade-out in XMPlay so that they don't end so "spasmodic", then also looping songs have a nice ending. In-game, the songs were obviously looping, but at one point you may want to listen to something different in your music player, so fading out after a repetition or two is the way to go here.

Quote from: Wurlit on November 09, 2014, 17:32:38EDIT: Listening EverSmoke more carefully, there's a repeat on the half third section of the Foobar version, but still the other half is unique. This and a double export of a third section of another track (two tracks, same exact music) are the flaws i've found in Foobar.
EverSmoke also has no unique material that is missing in XMPlay - the part that you may identify as being cut off is the main body of the second subsong, but played slightly faster. These things should be easy to understand and visualize if you look at OpenMPT's order list - Grabbing a recent test build (http://buildbot.openmpt.org/builds/) will also help there since they will tell you where the hidden subsongs start if you go to Player -> Estimate Song Length. Then you can closely follow which subsongs starts at which position and where they overlap.
You may even turn off looping in the General tab to better understand where the overlapping beings, as OpenMPT will then stop at the same places as XMPlay does.
Title: Re: High resolution output
Post by: Wurlit on November 10, 2014, 10:28:52
This is what happens through my scope when trying to relate mood with numbers. Maybe it's not the place to speak metaphorically but, hey, i'm pretty sure you have your way to do the translation programming-wise.

Foobar is like a plastic surgeon. It gives something musical to the output, somehow builds a seamless skin around the skeleton. Those ~10 track tunes in question have a continuity, they blend together. Voila, instant soundtrack. Does what i'd do manually myself. Almost what ModPlug Player does but retaining the integrity of given patterns to the likes of OpenMPT and XMPlay. It just helps. Setting the additional material and the ending treatment aside, both Foobar and XMPlay behave exactly the same. No misinterpreted tempo or anything. That is exactly what i was looking for. I mean, after you broke my harmonic relation with MPP! XMPlay treats the numbers like a... robot (ain't them all?), where i suppose for that purpose does indeed what it should.

Quote from: Saga Musix on November 10, 2014, 00:12:37
Are you really saying now that you are missing something if you didn't listen to it? Using that argumentation, you could say that you always miss something when you don't make use of a bug or undefined behaviour.
No, these things don't correlate like that, and this is our argument. As a listener, i'm not missing a bug when i hear a proper fade-out, for example. I did mess with the fading option in XMPlay but what it does is add a loop and fade with it, and still cuts before zero volume - that sounds like a bug to my ears. The additional stuff i hear from Foobar make sense to me, regardless of what both players do to the audio, that's my point.

As for OpenMPT, it served my needs well in exporting and importing back the denoised files, adjusting the loop markers and correcting the clicks, with only a few workarounds. It's too much for me to go through testing every song again. It was a nightmare having to deal with 669 samples individually in the first place. As a side note, i've found ModPlug Player treats four tails better than Foobar, even for just half a second duration. I'll use them. And i'll include as a bonus tracks the three slower tempo "abominations" it renders, as an honoris causa to the deceased.

Composing computer music that period must've been a pain. Though better than composing tunes for the Amstrad CPC-464 back in the day. When i have the time, that would be my next project.