Chapter 5

Iteration and Lists

Topics: Iteration, Python for loop, arpeggiators, constants, list operations, range(), frange(), FX-35 Octoplus, DNA music.

5.1 Overview

Most processes in nature and in human culture involve iteration or repetition at different levels of scale. For example, consider a tree and how it starts with a single branch (trunk), which gets split into 4–5 sub-branches at 60 (or so) degree angles, and it repeats this process until we reach the level of leaves. Another example is the human body, which starts from a single cell, which gets subdivided repeatedly, eventually giving rise to the complex organism that is reading these words.

5.2 Iteration

Iteration or repetition is integral to making complicated and interesting things. ...

Get Making Music with Computers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.