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 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > Command mathematics / physics Owner: Naff_Natty New post
Page 1 of 2 Sort: Goto Page: [1] [2] Next >>
Command mathematics / physics Posted: 2012-11-04 21:05 Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41746
I was wondering if someone could explain to me the basic mathematics of ?xx commands. Obviously they vary from command to command depending on what xx / xy denote, but I was thinking specifically of those that denote speed and/or period (if that signifies a different thing).
For example, if I type Q22, then my note will slide up two semitones, but over what period?

It's probably best if you explain it as if you were talking to a child that was hit around the head a lot shortly after birth.

PS, how long is a tick? I've always been curious....

Thanks!

_______________________
ERROR 404: signature not found.
Posted: 2012-11-04 21:15 Reply | Quote
za909

Avatar

Member for: 3962 days
Location: Hungary
Status: Offline

#41747
A tick is a frame basically (60 frames are 1 second in NTSC and 50 in Pal), Speed actually controls how many frames to spend on each row and that's important to know when you use frame-timed commands, like Sxx, Gxx or Xxx.

_______________________
Rectangular sh*t ©
Posted: 2012-11-04 21:59 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#41748
[quote=za909]Speed actually controls how many frames to spend on each row and that's important to know when you use frame-timed commands, like Sxx, Gxx or Xxx.[/quote]
This is only true if you leave the tempo to 150 for NTSC or 125 for PAL (if you use a special frame rate, a simple rule of 3 will tell you what tempo to use).

_______________________
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.
Posted: 2012-11-05 01:56 Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41755
so, does that mean in the case of Q26, the 2 signifies 2 ticks?

_______________________
ERROR 404: signature not found.
Posted: 2012-11-05 01:58 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#41756
If that were true, QF6 would take longer to accomplish, when in fact the reverse occurs.

_______________________
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.
Posted: 2012-11-05 02:38 Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41758
Okay, we're getting somewhere. So what does the 2 in Q26 signify?

_______________________
ERROR 404: signature not found.
Posted: 2012-11-05 02:48  (Last Edited: 2012-11-05 02:49) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#41759
Q06 slides up by subtracting the frequency register value by 1 once very frame. Q16 subtracts 3 per frame, Q26 subtracts 5 per frame etc.

This is something you could find out by yourself. Just make a test NSF with whatever command you want to investigate, open it in NSFPlay, look at the keyboard view, set it to the slowest speed and watch what happens.

_______________________
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.
Posted: 2012-11-05 18:21 Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41772
[quote=jrlepage] This is something you could find out by yourself. Just make a test NSF with whatever command you want to investigate, open it in NSFPlay, look at the keyboard view, set it to the slowest speed and watch what happens.[/quote]

Well, that's very pretty, it slides up. I already knew it slides up. This still doesn't give me the information I need.

[quote=jrlepage] slides up by subtracting the frequency register value by 1 once very frame. Q16 subtracts 3 per frame, Q26 subtracts 5 per frame etc. [/quote]

What is "the frequency register value"? I've already made it clear I don't know these terms.

Sheesh, I miss Gyms already. He would have explained it in terms I could have understood, and by now I would have understood the term "frequency register value" if it was important. Instead I have to try and bleed it out of a reluctant forum.

It's a shame. You guys understand this information. With no background in chip technology and no one willing to part with information it's very hard for someone to learn this stuff.



_______________________
ERROR 404: signature not found.
Posted: 2012-11-05 18:30  (Last Edited: 2012-11-05 18:31) Reply | Quote
za909

Avatar

Member for: 3962 days
Location: Hungary
Status: Offline

#41773
It's like an alarm clock, you set it to 6 AM, so it wakes you up at 6 AM, registers are like that, frequency register for example tells the sound generator how often to make a pulse, which of course means how high/low the sound should be. Programs like Famitracker automatically set them when you play a note.

I don't know, but I don't think we're here to teach you everything, I looked up stuff for myself if I didn't get them the first time.

Or do you want to hear it like this: ders dis thingo dat setz dad thingo dat maks da saund und itz kool mon!

_______________________
Rectangular sh*t ©
Posted: 2012-11-05 18:42  (Last Edited: 2012-11-06 00:25) Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41775
[quote=za909] I don't know, but I don't think we're here to teach you everything, I looked up stuff for myself if I didn't get them the first time.

Or do you want to hear it like this: ders dis thingo dat setz dad thingo dat maks da saund und itz kool mon! [/quote]

Erm, I don't think you're here to teach me everything. I've read a lot, done a lot of practising by myself and listened a lot to what people on this forum have to say. Mostly I use commands like Qxx by feel and put a lot of patient trial-and-error into getting the sound right and it works out fine. But there's just no way I can seem to learn exactly what the 2 means in Q26.

That's why I asked here.

If someone doesn't understand something, then break it down in terms that they do understand, or don't tell them. Elsewise you're just posturing.

What you've just done there is given me jargon, and then an offensive sentence that wastes both our time. I'll wager I understand the English language a damn sight better than you and could give you a lesson or two in it, If you asked nicely, like I did about this question at the start.

_______________________
ERROR 404: signature not found.
Posted: 2012-11-05 19:07 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#41776
[quote=Naff_Natty]But there's just no way I can seem to learn exactly what the 2 means in Q26.[/quote]
It's what I said: an arbitrary value assigned by jsr to signify that larger values = faster slide. 0 slides by 1 freq. register value, 1 slides by 3 values, 2 by 5 values and so on.

_______________________
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.
Posted: 2012-11-05 19:12 Reply | Quote
Naff_Natty

Avatar

Member for: 3727 days
Location: Behind you
Status: Offline

#41778
Okay. So what does a frequency register value signify in musical terms - a semitone?

_______________________
ERROR 404: signature not found.
Posted: 2012-11-05 19:20  (Last Edited: 2012-11-05 19:31) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#41780
[quote=Naff_Natty][quote=jrlepage] This is something you could find out by yourself. Just make a test NSF with whatever command you want to investigate, open it in NSFPlay, look at the keyboard view, set it to the slowest speed and watch what happens.[/quote]

Well, that's very pretty, it slides up. I already knew it slides up. This still doesn't give me the information I need.[/quote]
Yes it does; you just have to know where to look and apply a little science to the whole process. In the keyboard view's settings, make sure "Display the frequency registers" is checked. Slide that time expansion slider to the maximum value, make a short NSF with the command you want to investigate and quickly play/pause, observing what happens to the frequency register.

[quote=Naff_Natty][quote=jrlepage] slides up by subtracting the frequency register value by 1 once very frame. Q16 subtracts 3 per frame, Q26 subtracts 5 per frame etc. [/quote]

What is "the frequency register value"? I've already made it clear I don't know these terms.[/quote]
If you want to investigate the inner workings of the console you're writing for, you're bound to expect jargon like that.

Each channel has a register that tells the channel what pitch to play. In the case of the 2A03 (I'll skip the expansions for this lesson), specifically the squares, lower values = higher pitch and vice versa. For instance, C-3 is 0x1AB, and F#3 is 0x12D. So as we've established, Q26 subtract 5 from that register value every 60th of a second, until it reaches the note 6 semitones above the base note. Going with the previous example, Q26 on a C-3 would subtract 5 from 0x1AB every 1/60 second until it reached 0x12D:

[b]0x1AB[/b] - 0x1A6 - 0x1A1 - 0x19C - 0x197 - 0x192 - 0x18D ... 0x13C - 0x137 - 0x132 - [b]0x12D[/b]

[quote=Naff_Natty]Sheesh, I miss Gyms already. He would have explained it in terms I could have understood, and by now I would have understood the term "frequency register value" if it was important. Instead I have to try and bleed it out of a reluctant forum.[/quote]
Well sorry, I try as best as I can but at the same time I don't want to be patronising by using baby terms. This is a technical subject and you have to expect a technical answer. The [url=http://wiki.nesdev.com/w/index.php/Nesdev_Wiki]NESDev wiki might help you out by defining certain technical terms (even though I think it's not very well organised in some places).

[quote=Naff_Natty]It's a shame. You guys understand this information. With no background in chip technology and no one willing to part with information it's very hard for someone to learn this stuff.[/quote]
I had no background in chip technology either until very recently. And I'm still very much learning myself. It can be done; it just takes time and willingness on your part.

_______________________
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.
Posted: 2012-11-06 10:03 Reply | Quote
cak

Avatar

Member for: 4314 days
Location: oregon
Status: Offline

#41796
[quote=Naff_Natty]Okay. So what does a frequency register value signify in musical terms - a semitone? [/quote]
It depends upon the register. Higher register = lower note = smaller interval, lower register = higher note = larger interval. Half or double the register is about one octave difference.

Generally-speaking, the difference between adjacent registers is something small like 10 cents, i.e. much smaller than a semitone.

Posted: 2012-11-06 10:10  (Last Edited: 2012-11-06 23:46) Reply | Quote
Xyz_39808

Avatar

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

#41797
ARGH.

Freq registers. it's a 12 bit value. It ranges from 000 to FFF. So a typical freq register would like like 9A7 or something. It DIVIDES the clock to make your hertz.

So, for example, if we had a clock with rate 4096hz, then using a FreqRegister of 001 would divide our 4096 by 1. 4096/1 = 4096, so we get our highest pitch possible which is 4096hz. If we used FreqRegister 002, then it'd be 4096/2 = 2048hz, a much lower note. If we use 100 (100hex is 256 in decimal) , then that's 4096/256 = 16hz, WAYYYY lower note.

Well, in the 2A03, the number isn't 4096, it's actually 111860. And it's actually 11bit, so it ranges from 000 to 7FF. AND, it doesn't use the FreqRegister you say, but rather that number PLUS ONE.

So, a high FreqRegister like 7F1 (2033 in decimal) would mean 111860/2034 = 55.02hz which is an A-0.

If we had a low FreqRegister like 010 (16 in decimal) it'd mean 111860/17 = 6580.04hz which is a G#7.

If you had a PitchMacro in your instrument that was 0 0 0 0 | 1
then for a G#7 (which has FreqReg 010) it'd stay at 010 for 4 frames and then it would go up by one each frame, so it'd then be 011 (G-7) then 012 (F#7) and it would continues sliding downward.

You should notice that for high notes, there's verrrryy little room in FreqReg between two notes. G#7 to G-7 had just one. But that gap is huge for low notes. A-0 is FreqReg 7F1 and A#0 is 77F which is a difference of 082 (130 in decimal). This is why a vibrato doing something like | -1 -2 2 1 1 2 -2 sounds like nothing on low notes and a very wild vibrato for high notes.

[edit: derp math]

Page 1 of 2 Sort: Goto Page: [1] [2] Next >>