Thus far, the notes displayed herein have been natural. That is, played as they are named, without changing their pitch. A note of the same name, but played higher or lower is called an octave. Pitch is measured in tones and semitones. A semitone is the difference in pitch between one note and another. For instance, on a piano, a semitone is the step from an ivory key to an ebony or another ivory key (if the ivory keys are next to one another without being separated by an ebony key). On a guitar or bass, a semitone is the step from one fret to the next on a string. Two semitones make up one tone or whole tone. The general name for the difference in pitch from one note to another is called an interval.
The intervals between the notes (from A to G) are two steps or one tone, with the exception from B to C, and from E to F, these notes are separated by only one step or a semitone. Raising the pitch of any note a half step (on a guitar or bass from one fret to the next, and on a piano, from one ivory key to the next ebony or ivory key) is known as a sharp, annotated as #.
The diametric to a sharp is a half step down, called a flat annotated as b.
When these symbols appear next to a note on a line, it tells the musician to raise or lower the note from a natural to a sharp or flat respectively. Often in the beginning of the score, there will be a series of sharps and flats, called key signatures (usually between the treble or bass clef and the time signature).
These indicate that the note relative to their position on the staff is sharp or flat throughout the piece. There is a simple reason for this — the piece is much easier to read (instead of placing a sharp or flat sign before every note that is supposed to be raised or lowered). This precept of raising or lowering assigned notes by a half step is “overturned” by a natural sign. When this sign appears by a note in a piece, it is to alert the musician to play the note naturally, and disregard the sharp or flat in the beginning of the score.
However, this sign is for that note only, for that value only, not for the rest of the piece. This is also referred to as an accidental. By the same token, if there are no sharps or flats at the beginning of the piece (which is unique to the key of C), and a sharp or flat sign is placed on a note, that too, is an accidental (because the note was supposed to be played naturally). Accidentals only affect that particular note, and do not affect the rest of the piece, as do the sharps and flats in the key signature.
When intervals share the same pitch, such as C# and Db, this is known as enharmonic.