In the previous chapter, we saw the Mod function repeat(), which provides one way to do repetition of musical data. Although this works in

many cases, generally, we need something more powerful, exible, and customizable. For this reason, all programming languages provide iteration mechanisms, such as the for loop and the while loop.