Pipe-based function chaining syntax:
Filter:
PipeFunctionChaining/Overviews (extension) | Libraries > PipeFunctionChaining

Pipe-based function chaining syntax
ExtensionExtension

Implementation of pipe-based function chaining syntax

What it is

Two operators: |> and <|

Forward chaining: |> operator

A way of chaining function calls together. Here, each _ becomes the result of the previous expression.

With UGens

A sine wave that is filtered by a low pass, then high pass, then outputted.

With functions

Backward chaining: <| operator

Executed from the right to the left.

With functions

With UGens

Gotchas

It can get weird - the following is valid.

Brackets

For forward chaining, you need to add brackets around each function

It gets weirder with backwards…

However this mostly goes away if you call messages with a . on the underscore.

Multi-arity functions are messy.