Now that we have a very basic understanding of how your note selection contributes to your bass part, let’s look at what the rhythm can do to a bass line when you play. The rhythm of the piece has nothing to do with you - this is decided by the piece itself and what the drummer/percussionist is doing.
As a bass player you need to provide the link between the rhythm, the melody and the harmony. You can still play the notes that will improve the song but you will need to play them when the drums or percussion are hitting. This will tie the rhythm in with the rest of the music.
If you look at a drum kit or percussion set you will notice that each element is a different size and they should be treated as though they are different notes. Using this approach, we could start to put together a bass rhythm that can highlight the low drum sounds by only playing when a lower drum is played and playing a low note to accentuate it. Alternatively, you could do the same thing with a higher sound.
You could also help reinforce a rhythmic pattern by playing the same rhythm beat-for-beat for a section or let the whole thing breathe by only playing every few beats. The thing you must remember is to tie all of the parts of the song together (rhythm, harmony and melody) - if you can manage this you are well on the way to being a good bass player.
Playing the bass guitar is sometimes looked down on but if you do it well, understand what you need to do and have the technical capability to execute it with the best interests of the song in mind, then you are well on the way to becoming a great bass player.
People often try to be flashy and say things like: “I would play a descending G minor scale over two octaves in that section”. And, while that might sound impressive, you should remember that you should only do this if it makes the song better. I have played some guitar-inspired speed licks at times but only if it enhances the melody and helps tie in the rhythm. Make this your motto: “Just because you can doesn’t mean you should”.