Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > Famitrackers BPM accuracy. Owner: elsh New post
Page 2 of 2 Sort: Goto Page: << Previous [1] [2]
Posted: 2013-06-23 22:47 Reply | Quote
cak

Avatar

Member for: 5723 days
Location: oregon
Status: Offline

#48772
Both 3 and 5 divide into 3600, so there should be no issue at all unless you're using a tempo other than 150. Besides which, you might as well be using F04.

_______________________
Famicom tunes
Posted: 2013-06-23 23:04 Reply | Quote
rainwarrior

Avatar

Member for: 5559 days
Location: Canada
Status: Offline

#48773
How does it need to be fixed though?

Posted: 2013-06-24 03:08 Reply | Quote
CoolCockatiel

Avatar

Member for: 4916 days
Location: Cockatielia
Status: Offline

#48780
To me, it just doesn't seem natural to be constantly alternating tempo to make something sound right

:\

_______________________
-The Bird
Posted: 2013-06-24 15:39  (Last Edited: 2013-06-24 15:44) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 6392 days
Location: Canada
Status: Offline

#48793
That's not exactly what's happening. Say for instance you have tempo=150 and speed=9. You could just as well have one row at speed=5 and one at speed=4, giving you an extra row for more flexibility while preserving the same tempo originally. Or nine rows at speed=1, that adds up to the same too.

Also there are some tempo values that the NES can't deal with without inserting an extra frame every few beats (this is due to the fact most NES music runs at 60 or 50 frames per second). If you leave the tempo value to 150, you can be sure there will be no irregularities regardless of the speed value. To get different tempos, however, you can insert extra frames manually (alternating Fxx commands). You still get irregularities, but it's easier to tell when they'll happen since you have a visual cue (the Fxx commands).

It's important to realise that whether you do it this way or modify the tempo value directly doesn't change anything. The tracker will still add extra frames every few beats if tempo !=150.

_______________________
Follow me on Twitter.
I record (some) NSFs on hardware. Feel free to request a hardware render.
Posted: 2013-06-29 13:09 Reply | Quote
Loliconst



Member for: 4736 days
Location: None
Status: Offline

#48923
Two related questions:

1. How does the NSF determine the correct speed given the tempo value and speed value? Does FamiTracker go through the same calculations as the NSF, or is the NSF slightly off due to float errors?

2. A tempo value of 150 gives the smoothest tempos in 60 Hz, but isn't it more feasible to change the refresh rate in the exported NSF's header to scale 150 BPM to whatever speed desired by the user (even many decimal ones), rather than set the tempo to 2.5 times the engine speed? Does 150 BPM work equally well in other engine speeds?

Posted: 2013-06-30 08:17 Reply | Quote
rainwarrior

Avatar

Member for: 5559 days
Location: Canada
Status: Offline

#48941
1. They both use the same algorithm for tempo, so that NSF will be the same as in Famitracker.

2. Changing the engine speed is something that is supported by the NSF specification, but it is not something that NES games could normally do (generally everything is driven by the 60hz video refresh). Many NSF players, and some hardware NSF players do not support custom engine speeds. For this reason, it would not be a good default to have Famitracker automatically adjust the engine speed for you.

Posted: 2014-12-25 23:20 Reply | Quote
Xyz_39808

Avatar

Member for: 5589 days
Location: South Texas
Status: Offline

#64557
Bumping this thread because I don't believe jsr has ever been aware of this. Also can a mod move this to bugs?

Posted: 2014-12-26 16:03 Reply | Quote
jsr
Administrator

Avatar

Member for: 7333 days
Location: Sweden
Status: Offline

#64570
I am aware of the bug rainwarrior found, if that's what you mean.

_______________________
Programmer and developer
Posted: 2014-12-27 13:22 Reply | Quote
jsr
Administrator

Avatar

Member for: 7333 days
Location: Sweden
Status: Offline

#64589
I've (finally) made a fix for this now so all speeds will be stable for tempo 150. It will be available in the next release.

Special thanks to rainwarrior for finding this issue.

_______________________
Programmer and developer
Posted: 2015-02-28 13:12  (Last Edited: 2015-02-28 13:17) Reply | Quote
SirPrimalform



Member for: 5289 days
Location: UK
Status: Offline

#66404
Wasn't sure whether to make a new thread or post in here because I'm unsure if it's the same bug or not. At least it's a related issue...

Famitracker doesn't seem to export at the stated BPM when you export a WAV (it might not be playing at the stated BPM either but that's harder to detect).

As a test I exported a minute of crotchets at the default speed of 6 (at 150BPM obviously, I'm well aware of the rounding issues that can be caused by changing that without a bit of maths beforehand).
I then imported them into my DAW with the tempo set to 150BPM and sure enough it's audibly out of sync with the metronome after a minute.

I worked it out and it's actually running at ~150.078BPM. I know that's a very small level of error, but it obviously compounds into a much bigger error eventually. I wouldn't consider that kind of drift a bug in live playback, but during an offline render there shouldn't be any drift unless there's an error in the maths right?

It's not like it's an insurmountable problem to work around but I still felt like I should report it because a bug is a bug. Sorry!

EDIT: Oh yeah, extra info that I forgot! The error seems consistent. That is to say that tracks exported separately stayed perfectly in sync, they were all running at ~150.078BPM. So this seems more like a mathematical error than something like system load delaying things (which makes sense for an offline render).

Posted: 2015-02-28 20:01 Reply | Quote
cak

Avatar

Member for: 5723 days
Location: oregon
Status: Offline

#66414
I believe it's not a math error per se, but a simple side effect of the frame rate not being exactly 60 fps (though much closer to it than the NES true frame rate of ~60.1).

_______________________
Famicom tunes
Posted: 2015-03-01 02:26 Reply | Quote
SirPrimalform



Member for: 5289 days
Location: UK
Status: Offline

#66420
Well in that case the BPM readout on the statusbar is inaccurate... either way there's some maths going wrong, it's just in a different place.

Posted: 2015-03-01 17:05 Reply | Quote
SirPrimalform



Member for: 5289 days
Location: UK
Status: Offline

#66437
I was thinking about what you said and wondered if perhaps when the engine speed was set to NTSC it might actually be running a little fast deliberately. So I tried manually setting it to 60Hz using the custom engine speed option.

Firstly, default '60Hz' and custom '60Hz' are the same, it seems to be consistently 150.078 BPM which I make to be the engine running at 60.0312Hz.

Interestingly, running the PAL engine at custom '60Hz' gives a BPM of 150.028. I don't know what undesirable effects might come from running the PAL engine at the wrong speed though.

Posted: 2015-03-01 21:09 Reply | Quote
jsr
Administrator

Avatar

Member for: 7333 days
Location: Sweden
Status: Offline

#66447
SirPrimalform: It's true that the BPM value is still rounded and not exactly as displayed, the problem discussed here earlier was of a different kind. The tempo calculation is based on what's possible to achieve when exporting to NSF, rather than having it as accurate as possible. The NSF format (and NES) have limited timing resolution so there will always be some rounding differences.

Running PAL at 60Hz is fine, the difference you see is that the playback speed is derived from the PAL clock (1.66 MHz) instead of NTSC clock (1.79 MHz). The next version of famitracker will base this on the actual NSF clock (1 MHz) instead, so then it should be exactly the same in both cases.

_______________________
Programmer and developer
Page 2 of 2 Sort: Goto Page: << Previous [1] [2]