Tutorial

Chords and polyphony

Simultaneity and polyphony within voices

Up until now we can play simultaneous sounds by stacking plays. We can make chords happen in a single play using stack.

How about a nice minor organ chord?

fn myOrgan(n) {
  organ(n.m2h) * env(0.01, 0.2, 0.7, 0.2, dur*0.9)
}

play([stack([a2;w], [e2;w], [c3;w])], myOrgan)

In a stack, each indivdual pattern is stacked together. This also means using a single play, you can have multiple independent voices (polyphony).

 play([stack([a2;w], [e2;w], [d3;h, c3])], myOrgan)

You can also stack stacks

play([
  stack([a2;w], [e2;w], 
  stack([d3;h, c3], [fs3;h, e3]))], 
  myOrgan
)