helps to have an APU doc ;P
http://www.slack.net/~ant/nes-emu/apu_ref.txt
The looping you're referring to is the decay unit which controls the output volume. What's happening is the decay unit decreases the volume by steps of 1 at regular intervals. Enabling decay looping (which is what you do when you set $400C.5 and clear $400C.4) causes the volume to wrap from 0->F
So normal decay you have:
F, E, D, C, B, A, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 ....
whereas with looping decay you have
F, E, D, C, B, A, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, F, E, D, C, B, A, 9 ....
The speed at which the decay unit clocks is controlled by the low 4 bits of $400C (not $400E or $400F like you guessed). The higher the value, the slower the decay.
So...
Code:
LDA #%00100000 ; decay loop, decay enabled, period=0 (fast)
STA $400C ; decay unit will decay quickly and loop
-----
LDA #%00101111 ; decay loop, decay enabled, period=F (slow)
STA $400C
Note that when decay is enabled, the decay unit controls the output volume. The low 4 bits of $400C double as the fixed output volume if decay is disabled -- which allows you to directly control the output volume. You disable the decay unit by setting bit 4:
Code:
LDA #%00110000 ; decay disabled, volume=0 (silent)
STA $400C
-----------
LDA #%00111111 ; decay disabled, volume=F (loud)
STA $400C
The decay units and volume setup on the square channels operate the exact same way, only you use regs $4000 and $4004 instead (and the high bits of those regs set the duty cycle)
$400E controls the period (aka the frequency, tone, or pitch -- whatever term floats your boat). You only have 16 pre-set frequencies to choose from on the noise channel. The low 4 bits select the pitch (higher values = lower tone... beware of the highest tones 0 and 1 -- they can be somewhat ear-piercing if you play them too loud)
Additionally, the high bit of $400E selects the mode. Clearing it gives you the normal "shhhh" noise, whereas setting it gives you a more of a "bzzzz" noise (the rhythmic buzzing in Quickman's level music in Megaman 2 uses the buzz mode -- listen to that song again to see what I mean)
$400F does nothing but handle the length counter and start up the channel once the length counter expires. I don't feel like going into detail on what the length counter does right now... so blah =P
EDIT -- whoopsie... actually, $400F also resets the decay unit back to $F ^^. Forgot about that. What that means is that when the decay unit has decayed the volume all the way to 0 (or even before then), writing any value to $400F will snap it back to $F. But if decay is disabled, then this is relatively unimportant.
Anyway yeah.. playing around is good. Getting a hands-on feel for how it all works helps a lot. But don't be afraid to use the docs as a guide ;D