Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29
So i'm noticing a lot of tempo unevenness in a project. I have the speed set at 2, the tempo defaulted to 150. Instead i'm using the Fxx command set to 'FE0'. Looking online I thought the Fxx command was safe from these errors, but I may be misreading something. I tried a few solutions:
Alternating tempos:
FE0
FE1
FE0
FE1
(etc.) and
FE1
FE0
--- [spaces]
---
FE1
FE0
---
--- (etc)
No, Fxx has two functions. If it's a low value it sets the "speed", but if it's a high value it sets the "tempo". Tempos that are not 150 are generally uneven. FE0 = tempo 224, FE1 = tempo 225.
If you want an even tempo, keep tempo at 150 and try alternating F01 and F02, for instance.
First of all, the NES runs at 60 frames per second, so there's not alot of resolution for temporal adjustment. (That's why slight variations in BPM don't do anything.) Basically, what you are wanting is a tempo where every note (or every pair of notes) is the same number of frames. Like rainwarrior said, keeping the tempo at 150 and using the speed effect (Fxx, where xx = 01 to 1F) is the easiest way to do this. F04 = 4 frames per tracker row, or 225 bpm.
[quote=Necrophageon]Check your e-mail. ;P[/quote]
Omg <3!
He gave me 2~ pages worth of background, so I think this issue has been resolved :P
And thanks everyone else! I've read how it effects tempo too but the information is so twisted on google ><.
I trust you also gave the [url=http://www.famitracker.com/wiki/index.php?title=Fxx]relevant wiki article a thorough reading?
Also, if that's not too much asking Necro, would you mind awfully pasting the contents of your private message here? I doubt there's any sensitive information in there, and I suspect it could benefit any future user who might be looking for info on the subject.
_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
@jrlepage - I had actually thoroughly considered doing exactly this for the benefit of the community... and so at your behest, I shall.
This is a conglomeration of things I have learned about the tracker (almost entirely from this site) over the years:
E-mail Start -
I should probably preface this by mentioning that as this software emulates the NES's audio, it also conforms to all the same rules. The NES's APU has a clock speed of ~60Hz (the NTSC version, anyway), which means the audio can only be updated every 1/60th of a second (one 'frame'). Basically this means you are working on a grid, and are confined to a limited number of tempi, and stepping outside of those [limits] results in those pesky hiccups you're undoubtedly experiencing.
So we'll use your example of Speed 2, Tempo 150, and an FE0 command.
Fxx controls both the speed and the tempo settings depending on what you input; it will set the *speed* from 01 - 1F (1 - 31), and set the *tempo* from 20 - FF (32 - 255). So FE0 will override your tempo setting of 150 and replace it with 224 (E0).
The actual BPM is derived from this formula:
6 * Tempo / Speed = BPM
So what you've done here is accidentally set your BPM to 672 (you can see this in the right side of the status bar at the bottom of the window), which FamiTracker uses to decide how many frames will occupy each row. It does so by keeping track of the total time spent, so we need two more values first - the amount of time each frame will span, and the amount of time each row should span ideally:
You don't really need to know any of this, I'm just showing you what's going on behind the scenes - the real reason it sounds jerky.
1000 ms (1 second) / engine speed (60Hz) = *time per frame* (16.6667 ms)
60000 ms (1 minute) / beats per minute (672) / rows per beat (4) = *time per row* (22.3214 ms)
It uses an accumulator that starts at 0, and every frame will add the value of your time-per-frame until the value of the accumulator is greater than the ideal time-per-row, at which point it will subtract the time-per-row from the accumulator and start the loop over, adding the time-per frame again on the next frame:
Start Playback = 0
Frame 1 = 16.6666
Frame 2 = 33.3333
Since 33.3333 is greater than 22.3214, FamiTracker decides that row is finished playing and moves on to the next row and continues after subtracting the time-per-row:
33.3333 - 22.3214 = 11.0119
Frame 3 = 27.6785
Again, the time per row limit has been reached, so your second row only contains one frame. Continuing:
27.6785 - 22.3214 = 5.3571
Frame 4 = 22.0237
Frame 5 = 38.6903
Next row (38.6903 - 22.3214 = 16.3689)
Frame 6 = 33.0355
Next row (10.7141)
Frame 7 = 27.3807
Next row (5.0593)
Frame 8 = 21.7259
Frame 9 = 38.3925
Next row
So you can see, your first row contains 2 frames, the second, 1, the third, 2, and after that you get a pattern of 1, 1, 2 for a while. Rows with two frames will be twice as long as rows with one frame, obviously. Since every third row will be twice as long, and you are presumably working with four rows per beat, it ends up sounding kind of wonky (little hiccups all over the place).
This explains what went wrong, but how do we fix it?
We turn the table and tell FamiTracker how many frames will be in each row instead of letting it tell us! As long as your tempo is set to 150 @ 60Hz, your Speed setting is effectively the number of frames per row, which can also be controlled by Fxx. The technique is basically just to spam Fxx commands based on the BPM you're trying to achieve. In the example above FamiTracker decided on 1, 1, and 2 (with some variation somewhere down the line to get 672) so that would translate to:
F01
F01
F02
F01
F01
F02
By combining speed 1 (900 BPM) and speed 2 (450 BPM) we wind up somewhere in between. When calculating rates involving more than two numbers, you should always find the harmonic mean, not the average. I just cheat and go here: [url=http://easycalculation.com/statistics/harmonic-mean.php]http://easycalculation.com/statistics/harmonic-mean.php
So then, entering FamiTracker's example - 900, 900, 450 - you can see that we wind up with 675 BPM (we're ignoring that variation I mentioned).
This is good if we are working at 3 rows per beat, but we want it to fit snugly in 4, so we'll have to make a sacrifice and choose one way or the other:
900, 450 gives us 600
and
900, 900, 900, 450 gives us 720
Since 720 is a bit closer, that would be my recommendation. Personally, I like to arrange things so that the oddball row is the one the beat lands on, so:
F02
F01
F01
F01
Over and over and over.
It will be faster than you originally intended, but quite smooth by comparison. Alternatively, we could try halving the BPM to see if some other combinations might get us closer.
672 / 2 = 336.
Speed 2 = 450
Speed 3 = 300
F02
F03
F03
F03
Or 450, 300, 300, 300 will give us ~327, and if we double that, we get ~654. Even closer (but a little slower, this time)!
The trouble with doing this is, by halving the BPM, you've also halved the resolution of your pattern, which means you'll have to squish all of your notes together (you can do this by doing 'Select All', right-clicking, and then clicking 'shrink pattern'). If you have any notes that will fall in between rows with this new configuration, you'll have to work around that.
- E-mail End
My only concern is whether or not my explanation of FamiTracker's frame/row deciding feature conforms to rainwarrior's, though I'm fairly certain it does, because an NSF import of a track with the same settings yields exactly the same results as I have described.
tl;dr - Don't mess with the 'Tempo' setting unless you know what you're doing. :P
_______________________
The only things certain in life are death and uncertainty.
_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
I guess my PAL problem would be not as off-topic in here, so I'll just go ahead and ask...Does Famitracker automatically try to "match" to NTSC speed using thistechnique? Cause I noticed a lot of hiccups when I wanted to hear how my songs would sound on a 2A07, so I went on and tried to resolve this by using tempo 150*0.833333... = 125.
I think PAL mode should just automatically set tempo to 125 and let the user try to match the song speed to NTSC manually.
The only time engine speed comes into play is when figuring the length in time of each frame, I think, which will screw with how many frames fit in a row. When you mess with it, you have to set the tempo like you've done, there.
New Engine Speed / 60 = X
X * 150 = New Tempo
But yeah, being that NTSC and PAL are both built-in settings, it would probably make sense for FamiTracker to automatically adjust the tempo setting when switching back-and-forth.
[quote=jrlepage]Quick note - this:
F02
F03
F03
F03
can be expanded by doing this:
F01
F01
F02
F01
F02
F01
F02
F01
See attached example.[/quote]Oh duh! Leave it to me to overlook obvious details like that. :P
_______________________
The only things certain in life are death and uncertainty.
za909: Yeah 125 should be used to get the same effect in PAL mode, where the speed setting is equal to the number of ticks/row. This is mentioned in the help files, although it's hidden in the control panel section. A new page dedicated to the speed and tempo settings would probably be a good idea.