One of the foundational skills of a good guitarist is "Knowing what chords sound good together."
The most complete understanding of this skill comes from reading books on harmony. I recommend Harmony for Computer Musicians by Michael Hewitt. It's my favorite book on the subject, and it's a very practical modern approach to understanding chord progressions and harmony. Knowing how chord progressions work provides a solid guide for understanding what does and doesn't sound good.
Even when you know the rules, though, it still needs to be applied or it's useless. This means digging into music we know and figuring out how to play the things our favorite musicians have put into our heads.
Whether you know it or not, your own musical ideas in your head are imitations of songs you've already heard and like. That's why it's so important to learn how to cover your favorite songs, or at least pieces of them, because the musical ideas in those songs have pieces of what you want to play in your own music.
Today's example is the rising bass lines from the songs "Everlong" by the Foo Fighters.
So you can see the frets rising on the 5th string: frets 4-5-7-9-10-12.
Even though you can play this riff with two fingers, a lot of things are happening musically.
What's happening is that Everlong is in D major. So the D's on the 4th and 6th string are ringing in the background. On top of that, octaves are being played. An octave might be the simplest chord, and they sound good with distortion. Adding the complexity of playing them over the D's and it sounds awesome.
What octaves are being played certainly matters. On the 5th string, fret 4 is C#, which is degree 7 of a D major scale. On the same string, fret 5 is D again, which is degree 1 of the D major scale, obviously. Then it continues ascending. Fret 7 is E, fret 9 is F#, fret 10 is G, and 12 is A.
Looking at that sequence of notes, C# - D - E - F# - G - A, it's clear that it's just climbing the D major scale, which makes sense because the song is in D major.
The fact that the line ends on A is important, because A is the root of degree 5, which is the most dominant degree of the key. The strongest chord relationship in music is the relationship between the I chord, and the V chord of any key. The I chord feels like resting, and the V chord feels strong, or tense. In order to sound interesting, a song has to take us through these states of rest and tension.
These rising chord progressions have a very energetic feeling to them. It's like they're building us up. That's why they're used a lot in fast punk music where the goal is to get the crowd going. It's just how the music feels. Dave Grohl, of the Foo Fighters, has a long history of playing just that kind of music, and so naturally, these rising progressions show up a lot his music.
"My Hero" also has these rising octaves in the chorus. Coincidentally, it was also on the same album as Everlong.
Think of this as a songwriting tool. So if you're trying to develop a musical idea that's stuck in your head, and if it needs a powerful building sound, a rising chord progression is a place to start. Start at I and walk up to V. Now you know a song where you've heard it before, and how to do it.
Being a musician is about taking the music in your head and getting it to come out of the instrument just like you imagined it. A big part of being able to do that is knowing why music you already know sounds the way it does.