If we have a G flat a natural gives a G, if we have a G sharp it gives a G, but what if we have a G double flat or double sharp? Especially if we are working in a key where G is already a flat or a sharp.
A natural sign always completely cancels any accidental that may be or have been on a note, and the note is played natural.
A G natural that comes after a G# is played as a G natural. A G natural following a G double sharp (Gx) is also played as a G natural.
Note that all the accidental symbols are treated the same way: they are absolute. A G# written after a previous G# is not played as a Gx, it's just played as a G#.
This paragraph in the Lilypond (notation software) docs might be relevant:
In accordance with traditional typesetting rules, a natural sign is printed before a sharp or flat if a previous double sharp or flat on the same note is canceled. (To change this behavior to contemporary practice, set the extraNatural property to f in the Staff context.)
(the first measure corresponds to the "traditional" behaviour, the second to the "contemporary" - the played notes in both measures are the same, and they don't depend on the key)
This implies that:
To turn a double flat into a single flat (regardless of the key) the traditional practice is to use a natural-flat pair.
Alternatively (and more contemporarily), the natural can be ommited: a single flat is enough.
A single natural sign always produces the natural note (regardless of previous accidentals or key)
Remember your order of flats/sharps and that a flat or sharp is a "half tone" step.
The order for flats is
B E A D G C F
Sharps are backwards
F C G D A E B
Among other things this can be used as a guide of rarity. Under normal circumstances, to have a B# sound good, you need to also be playing F#, C#, G#, D#, A#, and E#.
Now when applied to say a Piano, there is no B# key. Half a "step" up from a B is a C. So to play a B# you would just play a C.
Now back to your question, it's rare but not unheard of to have a "double" accidental on pieces that are transposed poorly, or as a way of shoving more voices in the same staff.
So an F## would be played as G (F + two half steps up).
I have never seen this in a well transposed piece. (Cramming more voices on a staff, or using F## instead of a G)
What is more Common is something like a A♭ major scale. B, E, and A are flat (order of flats)
So you get something, special in beginner pieces like
B♭, C, D, E♭, F, G, A♭, B♭
If written as
These are not double flats, there just reminders to play flats.
Also in the second measure these are not double flats.
Here in this example we have double flats.
C♭♭ is really a B♭ while the B♭♭ is really a A natural
C down half is a B down half is a B flat
B down half is a B♭ down half is a A natural
Lastly, I have seen, though rare, writing like this.
These two measures sound the same, but the first, is in some opinions easier to read. Keep in mind the second double flat isn't needed, I just included it for demo purposes.
Normally when people write music in this style (example 3) it's due to a beleife that all As in a A flat major piece should be flat, but the music calls for a an A natural. i.e. It's a writing style, not a totally new note. This is fairly common. Even more so in keys that have many flats, but music that needs a "lesser" (more common) flat to be played neutral.
A more contrived example would be something like
In the last measure, notes 3,4, 7, and 8 are all natural, while, 1 is flat because of the key signature, and note 5 had to have the flat reapplied to cancel out the natural from note 3.
All accidentals apply to the rest of the measure unless otherwise changed. So if we take out the naturals, You would play A♭, G, G, G, A♭, G, A♭, A♭.
The raising and lowering by half step for sharps and flats applies only when relative to a natural tone. So, if you started with a
G♮ and then added a sharp
G♯, the change is a half step ascent.
That is just a basic definition. It is especially applicable when first explaining the staff pitch letters and key signatures.
When you get into double sharps/flats we find out that accidentals are literal. You don't add/subtract by half steps with accumulated accidentals. Also, I don't think "cancel" is quite the right word, because that implies canceling to go back to a previous value. You just take the pitch letter from the staff and apply the accidental regardless of anything else around the note.
In those examples...
- the accidentals apply regardless of the key signature
- the accidentals apply regardless of preceding accidentals
- the two blue notes (notes on beat two) are
- enharmonically the first bar is a descent of two half steps (the natural sign did not merely lower by one half step)
- enharmonically the second bar is an ascent of three half steps (the sharp sign did not merely raise by one half step)
Don't accumulate, or add/subtract, half steps.
Just play literally what the note says: the pitch letter and its accidental.