Bassline
Bassline (also known as a bass line or bass part) is the term used in many styles of music, such as blues, jazz, funk, dub and electronic, traditional, or classical music for the low-pitched instrumental part or line played (in jazz and some forms of popular music) by a rhythm section instrument such as the electric bass, double bass, cello, tuba or keyboard (piano, Hammond organ, electric organ, or synthesizer).
In unaccompanied solo performance, basslines may simply be played in the lower register of any instrument while melody and/or further accompaniment is provided in the middle or upper register. In solo music for piano and pipe organ, these instruments have an excellent lower register that can be used to play a deep bassline. On organs, the bass line is typically played using the pedal keyboard and massive 16' and 32' bass pipes.

Riffs and grooves
Basslines in popular music often use "riffs" or "grooves", which are usually simple, appealing musical motifs or phrases that are repeated, with variation, throughout the song. "The bass differs from other voices because of the particular role it plays in supporting and defining harmonic motion. It does so at levels ranging from immediate, chord-by-chord events to the larger harmonic organization of a [sic] entire work."Bassline riffs usually (but not always) emphasize the chord tones of each chord (usually the root note, the third note, or the fifth note), which helps to define a song's key. Basslines align or syncopate with the drums. Other rhythm instruments join in to create a more interesting rhythmic variations.
The type of rhythmic pulse used in basslines varies widely in different types of music. In swing jazz and jump blues, basslines are often created from a continuous sequence of quarter notes in a mostly scalar, stepwise or arpeggio-based part called a "walking bass line". In Latin, salsa music, jazz fusion, reggae, electronica, and some types of  rock and metal, basslines may be very rhythmically complex and syncopated. In bluegrass and traditional country music, basslines often emphasize the root and fifth of each chord.  

Though basslines may be played by many different types of instruments and in a broad musical range, they are generally played on bass instruments and in the range roughly at least an octave and a half below middle C (roughly the range of the bass clef). In classical music such as string quartets and symphonies, basslines play the same harmonic and rhythmic role; however, they are usually referred to as the "bass voice" or the "bass part".

Instruments
Most popular musical ensembles include an instrument capable of playing bass notes. In the 1890s, a tuba was often used.  From the 1920s to the 1940s, most popular music groups used the double bass as the bass instrument. Starting in the 1950s, the bass guitar began to replace the double bass in most types of popular music, such as rock and roll, blues, and folk. The bass guitar was easier to transport and, given that it uses magnetic pickups, easier to amplify to loud stage volumes without the risk of audio feedback, a common problem with the amplified double bass. By the 1970s and 1980s, the electric bass was used in most rock bands and jazz fusion groups. The double bass was still used in some types of popular music that recreated styles from the 1940s and 1950s such as jazz (especially swing and bebop), traditional 1950s blues, jump blues, country, and rockabilly.
In some popular music bands, keyboard instruments are used to play the bass line. In organ trios, for example, a Hammond organ player performs the basslines using the organ's pedal keyboard. In some types of popular music, such as hip-hop or house music, the bass lines are played using bass synthesizers, sequencers, or electro-acoustically modeled samples of basslines.

Basslines are important in many forms of dance and electronic music, such as electro, drum and bass, dubstep, and most forms of house and trance. In these genres, basslines are almost always performed on synthesizers, either physical, such as the Minimoog and the Roland TB-303, or virtual, such as Sytrus and ZynAddSubFX. In hip hop, producer Rick Rubin popularized the technique of creating basslines by lengthening the bass drum decay of the TR-808 drum machine and tuning it to different pitches.Chinese orchestras use the zhōng ruǎn (中阮) and dà ruǎn (大阮) for creating basslines. Other, less common bass instruments are the lā ruǎn (拉阮), dī yīn gé hú (低音革胡), and da dī hú (大低胡) developed during the 1930s. Russian balalaika orchestra use bass balalaika and contrabass balalaika.
Australia's indigenous music and some World music that is influenced by Australian music uses didjeridus for basslines.

Classical music
In classical music, the bassline is always written out for the performers in musical notation. In orchestral  repertoire, the basslines are played by the double basses and cellos in the string section, by bassoons, contrabassoons, and bass clarinets in the woodwinds and by bass trombones, tubas and a variety of other low brass instruments. In symphonies from the Classical period, a single bassline was often written for the cellos and basses; however, since the bass is a transposing instrument, and it is notated an octave higher than it sounds, when cellos and basses play the same bassline, the line is performed in octaves, with the basses an octave below the cellos. By the end of the Classical period, with Beethoven's symphonies, cellos and double basses were often given separate parts. In general, the more complex passages and rapid note sequences are given to the cellos, while the basses play a simpler bassline. The timpani (or kettledrums) also play a role in orchestral basslines, albeit confined in 17th and early 18th century works to a few notes, often the tonic and the dominant below it. In a small number of symphonies, the pipe organ is used to play basslines.
In chamber music, the bassline is played by the cello in string quartets and the bassoon in wind chamber music. In some larger chamber music works, both a cello and a double bass are used to play the bassline. In a Baroque era (ca. 1600-1750) piece accompanied by basso continuo, the accompanying musicians would include a chordal instrument (e.g., harpsichord, pipe organ or lute) and a number of bass instruments might perform the same bassline, such as the cello, viol, double bass, theorbo, serpent (an early wind instrument), and, if an organist was present, the lower manual of the organ and the low-pitched pedal keyboard. In 2000s-era performances of Baroque music, the basso continuo is typically performed by just two instruments: a chordal instrument and one bass instrument (often harpsichord and cello).

[The bass part is] the groundwork or foundation upon which all musical composition is to be erected.
[The bass part is] the base and foundation of the other parts, since one builds them upon it.
[The bass part is] the foundation of harmony.

Popular music
In many genres of modern traditional music (ranging from folk rock to blues) and popular music (ranging from rock and pop to reggae to funk), the bassline is generally played by an electric bass player. In rockabilly, psychobilly, traditional blues and bluegrass music, the bassline is played by a double bass player. The bassline uses low notes that provide a rhythm while simultaneously setting out the foundation of the chord progression. The bassline bridges the gap between the rhythmic part played by the drummer and the melodic lines played by the lead guitarist and the chordal parts played by the rhythm guitarist and/or keyboard player. In most traditional and popular music styles, the bass player is expected to be able to improvise a bassline which they base in the chord progression of a song. When a bassist is playing a cover song, they may play the bassline that was originally used on the recording. A session bassist playing in a music studio is expected to be able to read a bassline written in musical notation. Bass players also perform fills in between the phrases of the vocal melody, and they may also perform bass runs or bass breaks, which are short solo sections. Rhythmic variations by the bass, such as the introduction of a syncopated figure can dramatically change the feel of a song, even for a simple groove.

"In any style, the bass's role in the groove is the same: to keep time and to outline the tonality. When developing bass lines, these two things should always be your goal"
[One] may view in it [(the bass part)] all the other parts in their original essence.Thomas Campion 1967:327

Walking bass
A walking bass is a style of bass accompaniment or line, common in Baroque music (1600–1750) and 20th century jazz, blues and rockabilly, which creates a feeling of regular quarter note movement, akin to the regular alternation of feet while walking. Walking basslines generally consist of unsyncopated notes of equal value, usually quarter notes (known in jazz as a "four feel"). Walking basslines use a mixture of scale tones, arpeggios, chromatic runs, and passing tones to outline the chord progression of a song or tune, often with a melodic shape that alternately rises and falls in pitch over several bars.  To add variety to a walking bassline, bassists periodically interpolate various fills, such as playing scale or arpeggio fragments in swung eighth notes, plucking muted percussive grace notes (either one grace note or a "raked" sequence of two or three grace notes), or holding notes for two, three, or four beats. Some songs lend themselves to another type of variation: the pedal point, in which the bassist holds or repeats a single note (often the tonic or the dominant) under the chord changes.
Walking basslines are usually performed on the double bass or the electric bass, but they can also be performed using the low register of a piano, Hammond organ, tuba or other instruments. They can also be sung, as is done by some a capella vocal groups. While walking bass lines are most commonly associated with jazz and blues, they are also used in rock, rockabilly, ska, R&B, gospel, Latin, country, and many other genres.

Examples
Walking bass in the pedal keyboard part of Baroque organ music (J.S. Bach's Nun komm, der Heiden Heiland, BWV 659, from the Great Eighteen Chorale Preludes):

play 
Other walking bass lines can be heard in the opening movements of Joseph Haydn's Symphony No. 22 (nicknamed "The Philosopher"), Anton Bruckner's Symphony No. 5 and Edward Elgar's Symphony No. 1.Walking bass often alternates quarter notes:

play giving rise to the term.
Many boogie-woogie basslines are walking bass lines:

Play in G  or in C Walking bass often moves in stepwise (scalar) motion to successive chord roots, such as often in country music:

Play In this example, the last two quarter notes of the second measure, D and E, "walk" up from the first quarter note in that measure, C, to the first note of the third measure, F (C and F are the roots of the chords in the first through second and third through fourth measures, respectively).
In both cases, "walking" refers both to the steady duple rhythm (one step after the other) and to the strong directional motion created; in the examples above, from C to F and back in the second, and from root to seventh and back in the first.
In bebop jazz, the walking bass has a stabilising effect, offsetting and providing a foil to the complexity of the improvised melodic lines, for example in Sonny Rollins’ “Blue Seven”.

Bass run
A bass run (or "bass break") is a short instrumental break or fill in which the bass instrument (such as an electric bass or a double bass) or instruments (in the case of a marching band) and the bassline are given the forefront. The bass part for a bass run often differs from the usual bass accompaniment style, in terms of the register, timbre, or melodic style that is used, or the number of notes per beat which are played.
A bass run may be composed by the performer or by an arranger prior to a performance, or it may be improvised onstage by the performer using scales, arpeggios, and standard licks and riffs. In some cases, a bass run may incorporate a display of virtuoso techniques such as rapid passages or high notes. During a bass run, the main vocal or melody line usually stops, and in some cases, the percussion or drums may also stop.  The technique originated in the marches of the "Sousa school", though its resemblance to call and response techniques familiar to African American musicians indicates an earlier origin.

Electric bass
In a rock song in which the bassline consists of low-pitched quarter notes played on the electric bass, a bass run may consist of a rapid sequence of sixteenth notes in a higher register, or of a melodic riff played in a higher register. In some cases, the bassist will select a "brighter"-sounding pickup or increase the treble response of the instrument for a bass run, so that it will be easier to hear.
In a heavy metal song where the bassist was ordinarily playing low notes without overdrive to accompany, for a solo, they may turn on a fuzz bass pedal and use a wah pedal to create a more pronounced tone (an approach used by Cliff Burton), and then play an upper register riff or scale run. Some shred guitar-style bassists may do two-handed tapping during a bass solo (e.g., Billy Sheehan).
In a pop song in which the bassline consists of notes plucked on the electric bass, a bass run may consist of several bars of percussive slapping and popping. Bass solos and guitar solos are rare in pop. In the rare cases that instrumental solos occur in pop, they are often played by synthesizer or, in some bands, by saxophone.
In a EDM, house, dubstep, grime, and related genres, synthesiser bass is used (along with kickdrums).
In a funk song in which the bassline already consists of percussive slapping and popping, a bass run may consist of a virtuosic display of rapid slapping and popping techniques combined with techniques such as glissando, note-bending, and harmonics.

Double bass
In a jump blues tune in which the bassline consists of low-pitched quarter notes played on the double bass in a scalar walking bass style, a bass run may consist of a bar of swung eighth notes played using a percussive slap bass style, in which the right hand strikes the strings against the fingerboard.
In a swing tune in which the bassline consists of low-pitched quarter notes played on the double bass in a scalar walking bass style, a bass run may consist of a descending chromatic scale played in a higher register.
In a bluegrass tune in which the bassline consists of low-pitched quarter notes played on the double bass on the root and fifth of each chord on beats one and three (of a 4/4 tune), a bass run may consist of a walking bass line played for several bars.
In a psychobilly band, a bass solo will often consist of a virtuosic display of triple and quadruple slaps, creating a percussive, drum solo-like sound.

Wind bass
In a marching band context, a bass run may consist of a several bar unaccompanied passage composed for the tubas and sousaphones which displays either rapid passages of notes or higher-register techniques. In New Orleans jazz, the tuba may provide a walking bass line similar to that of the double bass.

See also
Ground bass
Lament bass
Drum and bass
Bassline (music genre)

Notes
References
Buelow, George J. (2004), A history of baroque music, Indiana University Press, p. 40, ISBN 0-253-34365-8
Friedland, Ed (1995), Building Walking Bass Lines, ISBN 0-7935-4204-9
van der Merwe, Peter (1989), Origins of the Popular Style: The Antecedents of Twentieth-Century Popular Music, Oxford University Press, ISBN 0-19-316121-4
Cadwallader, Allen (1998), Analysis of Tonal Music: A Schenkerian Approach, p. 45, ISBN 0-19-510232-0
Santerre, Joe (2001), Slap Bass Lines, ISBN 0-634-02144-3

External links

"Bass Lines" (PDF). Archived from the original (PDF) on 2006-03-18. (41.4 KB) - 244 million bass lines in F
An audio/video example of a walking bass line played on electric bass guitar
Walking Bass Lines and Comping on Guitar