Well that is the key, when you hear the pinging, the timing is too far advanced.
You can't tune it by ear, pinging is pre-ignition, the mixture is firing before piston is high enough, some of the mixture is firing earlier and fighting the rest. The multiple flame fronts are hitting each other etc. This is my recollection of how to explain it.
Pure detonation is when the combustion is way early and is pushing down on the piston well before it gets to the top. Pinging is the symptom that you hear which hints that you are about to have true detonation, which will destroy pistons etc.
The big point to learn is that pinging is bad at any time. With a basically stock vehicle the tune is conservative enough that typically any pinging heard won't be catastrophic.
When you are truly altering the tune(which you are), the difference between harmless pinging like stock and basically detonation is too small to tell. Don't try to tune it simply by ear, rely as much as possible on the tune parameters from James. He uses tools like the A/F ratio and experience to massage the curves. Actual time trials are the best. Moving in any direction from the best timing will hurt times.
The power will fall off when the timing gets too advanced, and still before any pinging is heard. Thus if you hear pinging, let off the gas quickly. Work on it slowly to get it right.