Diminished sevenths create extra colour and direction to a chord progression by creating tension that then resolves to a diatonic chord (often but not always the dominant). They can also be used to modulate to a new key.
Diminished sevenths always resolve to a chord a semitone above their root so in the example below the F# diminished seventh resolves to ii (G minor) and the B diminished seventh eventually resolves to C (with a 6/4 in between).
Diminished sevenths are effectively chord vii from the key to which they resolve (in this sense they are quite like secondary dominants – they imply a temporary new tonic)
Mozart Piano Sonata in Bb K. 333, first movement
How to write diminished sevenths
- decide on the chord to which your diminished seventh will resolve
in this example an E major chord (V of A major) - write down the note below the root of this chord
in this example D – one note below E - then add a sharp or a natural if necessary so that it is a semitone below the note it will resolve to
in this example add a sharp to the D - add three thirds above the root of your diminished seventh
in this example, F#, A, C# - add accidentals that would apply to the MINOR key whose root is the chord to which the diminished seventh resolves
in this example the chord to which the diminished seventh resolves is an E chord, so you need accidentals that would apply to E minor (change the C# to a C natural). Alternatively, you can make sure that the intervals go up from the root of the diminished seventh in minor thirds.
the root note of the diminished seventh must resolve up a semitone and the seventh should resolve down, as in the example (i.e. if a violin had the C natural it should follow it with a B)