Almost all guitars have frets, which are metal strips (usually nickel alloy or stainless steel) embedded along the fretboard and located at exact points that divide the scale length in accordance with a specific mathematical formula. The exceptions include fretless bass guitars and very rare fretless guitars. Pressing a string against a fret determines the strings' vibrating length and therefore its resultant pitch. The pitch of each consecutive fret is defined at a half-step interval on the chromatic scale. Standard classical guitars have 19 frets and electric guitars between 21 and 24 frets, although guitars have been made with as many as 27 frets. Frets are laid out to accomplish an equal tempered division of the octave. Each set of twelve frets represents an octave. The twelfth fret divides the scale length exactly into two halves, and the 24th fret position divides one of those halves in half again.
On guitars that have them, these components and the wires that connect them allow the player to control some aspects of the sound like volume or tone using knobs, switches, or buttons. The most basic electronic control is a volume knob. Some guitars also have a tone-control knob, and some guitars with multiple pickups have pickup selector switches or knobs to determine which pickup(s) are activated. At their simplest, these consist of passive components, such as potentiometers and capacitors, but may also include specialized integrated circuits or other active components requiring batteries for power, for preamplification and signal processing, or even for electronic tuning. In many cases, the electronics have some sort of shielding to prevent pickup of external interference and noise.
Unlike many string instruments which use a bow to create a sound, guitars are played by plucking or strumming the strings on the instrument, which vibrate to create a sound. Chords are played when the guitarist holds their fingers down on more than one individual string to change its length, which in turn changes the frequency of the vibration created - in other words, it creates a different note. Performers often use guitar tabs, rather than sheet music, when learning music: this acts as a kind of 'map' to teach guitarists where to put their fingers on the strings.