I see what you are talking about. Pretty simple, really.
Here is what I do.
If a game is writing FF or C0 to $4017 then I will use C0.
Otherwise, I will write 80 to $4017.
PHA
LDA #$80
STA $4017
LDA #$0F ; 0F for the first 4 channels, if PCM is used, raw or DPCM then I will write 1F, although this very rarely needs to be done. If a game writes 0F in the driver itself then I will instead write 00.
STA $4015
Other init code if necessary
PLA
JMP init or RTS.
Address Bitfield Description
$4017 MI--.---- Set mode and interrupt (write)
Bit 7 M--- ---- Sequencer mode: 0 selects 4-step sequence, 1 selects 5-step sequence
Bit 6 -I-- ---- Interrupt inhibit flag. If set, the frame interrupt flag is cleared, otherwise it is unaffected.
Side effects After 3 or 4 CPU clock cycles*, the timer is reset.
If the mode flag is set, then both "quarter frame" and "half frame" signals are also generated.
This information is right from the NESdev wiki.
http://wiki.nesdev.com/w/index.php/APU_Frame_Counter
$4017 is pretty much for timing of NES music. Sometimes you can't tell the difference and other times the music will sound smoother and better timed. This is a way better solution than trying to adjust the timing and speed through the header in PB speed for example.
C0 sets both flags for bits 6 and 7.
80 sets bit 7 for a 5 step sequence. 00 will set it back to a 4 step sequence or 40 if you still want to set the interrupt inhibit flag.