Pattern Guide Cookbook 06: Phrase Network:
Filter:
Tutorials/A-Practical-Guide | Streams-Patterns-Events > A-Practical-Guide

Pattern Guide Cookbook 06: Phrase Network

Sequencing by a network of phrases, Articulating notes with PmonoArtic

Sequencing by a network of phrases

Articulating notes with PmonoArtic

Two for one here!

Most conventional synthesizers have a mode where playing a note while the previous note is still sustaining slides from one note to the other. The PmonoArtic pattern does this based on the event's sustain value. The delta value is the number of beats until the next event; sustain is the number of beats until the note releases. If sustain is shorter than delta, the note should cut off early and the next event should produce a new synth.

The example uses Pfsm (finite state machine) to arrange a set of predefined phrases in a partially randomized order. Each phrase is followed by a list pointing to the phrases that could legitimately follow the current phrase. That is, it might make musical sense to go from phrase 1 to phrase 2, but not from 1 to 3. Defining the successors for 1 appropriately makes sure that a nonsense transition will not be made.

This is a long example, but it's only because there are lots of phrases. The structure is very simple: just a set of phrases chosen in succession by Pfsm.

- Third-party extension alert : In this example, the selection of the next phrase is explicitly weighted by repeating array elements, such as #[1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5]. A more elegant way to do this is using the WeighBag class in the MathLib quark.

Example

Previous: Pattern Guide Cookbook 05: Using Samples

Next: Pattern Guide Cookbook 07: Rhythmic Variations