
3. The Bass
The Bass
is a low-pitched sound in music. It is not always the guitar you see in music bands. In electronic music, for example, a synthesizer often serves as a bass
. You can think of a bass like the one in the image on the right: both serve similar functions. They have a low-pitched sound, mark the rhythm, and define the harmonic foundation.
In Another One Bites the Dust
by Queen, you can hear an electric bass, the typical one you see in music bands, especially rock bands.
In the song Blinding Lights
by The Weeknd, you can hear a synthetic bass, which means that the sound was not generated by a "real" instrument but rather by a computer or synthesizer. Identify it by listening to the lower sounds of the track.
In electronic music, the bass is one of the most important elements because it serves two functions at once: it marks the rhythm and defines the harmony.
The drum kit we've seen so far only keeps the rhythm. You can't play melodies with a drum kit. In contrast, the bass allows you to create rhythms and play any note at the same time.
In the rhythmic part, the bass works together with the bass drum. Sometimes both sound at the same time, reinforcing each other. Other times they alternate: when the bass drum hits, the bass steps back.
In the harmonic part, the bass establishes the root note: the foundational note upon which everything is built. For example, imagine the bass plays the note C: all the music develops around that note as the base.
Harmonic Part
Now that we understand the role of the bass in music, let's see how we can use it in our code. Just as we use the sound()
function to play a sound, we will now use the note()
function to play musical notes.
The letters c1, d1, e1... represent musical notes. We will look at this in detail later. For now, notice how the bass can play different notes, unlike the drums.
Listen to Billie Jean
by Michael Jackson. You will see at the beginning of the song how the bass repeats a small melody.
Rhythmic Part
Now let's look at the rhythmic part of the bass. We have our usual basic rhythm, but now we add the bass.
In this case, the bass plays the note C2 (a C). We will see what C2 exactly means in the next lesson. For now, think of it as simply a musical note.
Listen to the bass in Around the World
by Daft Punk, it's practically matching the kick rhythm with a bit of drums.
Duration of Bass Notes
In addition to playing notes, the bass has another important difference: duration. While the 'bd' (bass drum) is a hit whose sound disappears quickly, the bass, on the other hand, can sustain the note for much longer.
Notice the following example: the bass drum sound disappears quickly, but the bass sound sustains throughout the entire cycle.
Combining Rhythm and Melody
In the previous examples, we saw how the bass can play notes and create rhythm separately. Of course, you can also do both at the same time, combining the rhythmic and harmonic function of the bass into a single pattern.
Simplifying Our Code
Now that we are writing more complex patterns, it's time to learn some shortcuts. Look at this pattern: [hh hh] [hh hh] [hh hh] [hh hh]
. We have 8 hi-hats (hh) in a cycle. In fact, it's the same as writing hh*8
:
[hh hh] [hh hh] [hh hh] [hh hh] = hh*8
Similarly, the same happens with [c2 c2]
: they are 2 notes in one beat. You can simply write c2*2
.
Another less obvious simplification is:
"[- sd]*2" = "- sd - sd"
Remember that what we put in quotes "" lasted one cycle. If we only put one beat in the cycle "[- sd]"
, this beat will last the entire cycle, but with the brackets we have divided the beat into 2, so each sound will last half of a cycle. By multiplying by 2, it's like having "[- sd][- sd]"
(2 beats of one cycle divided into 2) which is time-equivalent to "- sd - sd"
.
"[- sd]*2" = "[- sd][- sd]" = "- sd - sd"
Use the form that is clearest and most comfortable for you. Both are correct and produce exactly the same result.
Comments
As the code gets longer, you might want to add some comments to document your work. Comments have no effect on the output. They are only there to help you (and others who read it) understand it better.
A comment starts with the characters //
and then you can write whatever you want.
The Bass of Billie Jean
To bring together what we have learned so far, we are going to try to reconstruct the bass line of Michael Jackson's Billie Jean
, a legendary and easily recognizable bass.
The drum part you already know, we have just replaced the hi-hat hh
with some maracas sh
.
As for the bass, we have only added the notes from the Billie Jean theme. But to fully understand what we are writing, we will need to learn what these notes are. In the next chapter, you will get to know the notes in greater depth, the foundation for creating your own melodies. 👉>>