more PPMCK questions (loops and fades)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
more PPMCK questions (loops and fades)
by on (#119216)
Hi all,
A few years ago I started off making nsf chips with PPMCK. Since then I've dropped off of it, but now i'm trying a new hand at it. In one of my latest chips, I have put the L command in the mml, which is supposed to set an indefinite loop. Sure enough, it works as expected, except 2 things. I'm also trying to see if fade-outs and fade-ins are possible, but I'll gge my loop questions first.
I've read that under certain circumstances, loops made with this command may have problems because tracks may go out of sync. Sure enough, this is what's happening. I don't know if the fact that i'm using several expantions has anything to do with it. But the loops on some tracks are definitely out of sync... musically everything is lined up so it's just a matter of getting rid of the annoying frame differences. So, is there a way too adjust things on the offending track, without changing the notation I have written?
And also, most video game music players will play the looped section twice and start to fade out on the third repeat. However, with the nsf files I've made with MCK, this does not happen. Currently I'm using NSFPlug for Winamp, at default settings. From my understanding, it's supposed to repeat the looped section twice and fade out like I mentioned above. However, when it plays my NSF files, it keeps repeating the loop for 5 minutes which I believe is the maximum duration setting. I'm pretty sure it's not a prolem with the plug-in... I've tried a few others which did the same thing more or less. I'll look more into how it handles other nsf files but it seems like an odd behavior for it to do that by default. Maybe the L command in PPMCK doesn't do quite what I thought?
And now for the fades. I gather there is no way to fade in/out using a volume envelope that you've already set up. I believe the only way to fade at all is to set static volumes and keep entering lower and lower static volumes until you reach 0. Is this correct?
Let me know if I ramble too much, didn't explain clearly enough, whatever... any help is greatly appreciated!
Re: more PPMCK questions (loops and fades)
by on (#119234)
You are allowed to create desynchronized loops with the "L" command (as well as loops that are synchronized but have different lengths; one is a multiple of another), and I sometimes find this useful.

The output of ppMCK should tell you the length of each channel; this can help to find errors in the length entry of the music.

Sometimes frame errors are due to the tempo setting, because the note length isn't evenly divisible into a number of frames, so it approximates it. Changing the tempo slightly can fix this.

Hopefully these answers are helping you. Is it?
Re: more PPMCK questions (loops and fades)
by on (#119239)
Hi,
I'm no expert at MCK... haven't really looked at its output in full. Adjusting tempo does help.
I am not at all familiar with how MCK decides on how many frames each note is. I'm not too keen on the thought of figuring out all the math behind it unless it's relatively simple. I'm just worried that something will come up that will be harder to get the frame counts in sync. Sometimes I have to use 32nd and 64th notes for certain articulations so I'm not sure how much that complicates things... like I said I do make sure that everything lines up at least on the musical side.
My tempo started at 123, where the sync issue was intolerably bad, putting it to 124 helps but i suspect 125 will be even better... I'll try it in a bit. I'd think that certain tempos and their beat divisions would line up with the frame boundaries better, if that makes any sense.
Any ideas on the other things I mentioned?
Re: more PPMCK questions (loops and fades)
by on (#119245)
I do not know about Winamp (I have played my own NSF files in VirtuaNES).

For fading, the only way I know is what you said, which is to enter static volumes manually. Maybe I should add a automatic fading macro.
Re: more PPMCK questions (loops and fades)
by on (#119256)
Does looping work properly in your player i.e. it loops a certain number of times and starts a fade-out? Or does it play indefinitely until the maximum duration is reached? I find it odd that all the Winamp plugs I've tried just ignore the loop count setting with my nsf files, when game-ripped nsf files work fine. I suspect it has something to do with how the loops are set in MCK but that's just a guess.
sorry about all the questions but I am just curious.
Re: more PPMCK questions (loops and fades)
by on (#119261)
NSF lacks timing information, unlike NSFE. How would a player even know when a loop has occurred?
Re: more PPMCK questions (loops and fades)
by on (#119263)
Now I am confused. Is the music which is ripped out of game roms in NSFE format? The extention is just nsf.
Re: more PPMCK questions (loops and fades)
by on (#119266)
raygrote wrote:
Now I am confused. Is the music which is ripped out of game roms in NSFE format? The extention is just nsf.
It is NSF. Loops can be partially detected (and I don't like that NSFplay has no options to tell it to just play forever) (All NSFs must eventually loop (even if the loop is just of silence) due to the finite amount of RAM available, although it might take several millenia before this happens (I have not calculated the actual time limit; maybe it is less than that, I don't know, but I expect it to be very long time).)
Re: more PPMCK questions (loops and fades)
by on (#119267)
raygrote wrote:
Does looping work properly in your player i.e. it loops a certain number of times and starts a fade-out?
VirtuaNES just repeats forever until manually stopped (although the loop may consist of silence, making it sound to be stopped (there is no visual indication on the screen that this happened); this is automatic if the MML source contains no "L" command). I do think this way is better. (VGM does have loop count and that stuff in it, although it only supports two of the NSF sound chips: 2A03 and Sunsoft 5B.)

I don't know if it "works properly" with your file, though, since I don't have a copy of it to test.