A mark placed before a note which indicates that the previously understood pitch of the note should be altered by one or two half steps (semitones). To raise the unaltered pitch by one half step (semitone ) the sharp is used, to lower it by one half step (semitone ) the flat is used. To raise the pitch by two half steps (semitones), a double sharp is used and to lower it by two half steps (semitones) a double flat is used. If the key signature indicates that a note be played sharp or flat and the unaltered tone is desired, a natural is used to indicate this.
Typically, the accidental alters the pitch of the note that it is attached to as well as any subsequent occurence of the same note (identical line or space) in the same measure. Notes with the same pitch name, but higher or lower octave should not be effected. Any note with an accidental that also has a tie across a barline carries the accidental to the note on the other side of the barline . Notes in the new measure that are not tied to altered notes from the previous measure are performed using the current key signature.
Often, notation can get very complicated and composers or editors will use a courtesy accidental (accidental or reminder accidental) to remind the performer that the accidental attached to a previous note has been added or removed.