An ostinato can be a repeated group of notes or just a rhythm . It is similar to a riff in jazz .
Although the term `` riff '' can refer to any short series of notes that create a melody within the melody of the song , it does n't necessarily have to repeat to become a riff , unlike ostinato .