Accidental is a sharp (♯ ), double-sharp ( ), flat (♭ ), double-flat ( ), or natural (♮ ) placed in front of the head of a note to show that the note is to be raised, lowered, or restored to its former state. They were originally called accidentals because they occur only occasionally in the course of a musical composition, and are thus distinguishable from the signs of similar import written in the key signature and forming part of the normal scale. A sharp raises the pitch of a note one half step; a double-sharp raises it two half-steps; a flat lowers it one half step; a double-flat lowers it two half steps; and a natural sign cancels all prior sharpings or flattings, including those in the key signature. Rarely used, there are examples such as triple flats, such as in the works of French composer Charles-Valentin Alkan).
The accidental sign changes only the note that follows it and any repetition of that note on the same staff degree (line or space) within the measure. The sign has no effect on the note should the note appear in the next measure, unless the sign has been held over by a tie. The sign also has no effect on a note with the same letter name but a different line or space.
The first accidental to be used was derived from the notation of Italian music theorist Guido of Arezzo, who advocated the flat, which was first applied to the note B. Since B was for a long time the only note to be flatted, the sign for B-flat, a rounded b (rotundum), which later came to be used whenever any note was to be flatted. The sharp sign was not used until about 1500, and originally consisted of a twofold overlapped 'x', replaced by the # in the 18th century. With the development of chromaticism, it became necessary to introduce additional notation. The natural, double-sharp, and double-flat came into music around the year 1700. The natural was indicated by a square (quadratum).
Before the introduction of accidentals, composers expected performers to raise or lower tones according to what their ears told them to do. This practice was called musica ficta (contrived music).