A Techno Music Programming Masterclass With The Black Dog

Repetition using loops

Often you want to repeat sequences of notes or drum sounds. We can do this using a loop. The for command is used to count the number of repetitions (in this case, 8)

The symbol i is a variable that contains a number. The first time around the loop it contains 1, then 2 and so on until it reaches 8. Then the loop stops. Now try this - can you see why the sequence is longer and faster?

Expert tips from The Black Dog

The variable in a loop can be accessed inside the loop by writing its name. That means we can use it to control synth parameters.

When controlling synth parameters you can directly use the range of numbers you want in the for command. You can also specify a step. This varies the cutoff parameter from 300 to 1800 in steps of 100.