Note: the examples here are to illustrate to advanced students how the spelling of diminished 7 chords is determined by key and by context. Those who are attempting to learn how to form diminished chords but who have not yet used them in music would probably be best advised to skip this altogether.
Here I mention a “flat 9 chord” and show how diminished chords are sometimes played all in the right hand, sometimes are shared by both hands, and finally sometimes appear with a “pedal bass”. In this example, sometimes the repeated notes in the bass clef are part of the chord, but sometimes they are just a drone that is not part of the chord. In addition, I am demonstrating how there may be two equally valid analyses of the same chord.
For example, when E dim7 appears over A, the A can be considered the root of a more compex chord, the A “flat 9″ chord, notated A7(b9). It would stack this way: A C# E G Bb. The G# dim7 chord is missing the B, but by context and spelling it is clearly expressing the complete fully diminished chord. The D# dim7 chord may be worked out by looking at the bottom note (D#) and then stacking all the notes: D# F# A C. The last dimished 7 chord, which I have notated as B dim7, could also be considered as G# dim7/B, meaning that it can be stacked as G# B D F, but B is the root. Most musicians will chose the shorter notation, B dim7, because it is simpler, straight to the point, and it assumes that we may spell any diminshed chord enharmonically while using the root as the name of the chord.