home/ atoms/ tidal-hash-operator-controls

Tidal's # operator applies a named control to a pattern; its right side must be a control name, not a bare string

In Tidal, the # operator applies a control pattern to a sound pattern. The right side must be a named control parameter (speed, cutoff, gain, room, etc.), not a bare string pattern. Misusing # by writing sound “bd” # “sn” (applying a string instead of a control) produces a GHCi type error. For combining two number or control patterns, |+| is the correct operator.

Examples

sound "bd" # speed 2 is valid. sound "bd" # "sn" → GHCi type error. sound "bd" |+| speed 0.5 combines two control patterns.

Assessment

Explain the difference between # and |+| in Tidal, and provide an example of a type error caused by misusing #.

“Use `#` to apply a **control** (`# speed 2`), `\|+\|` to combine two **number/control patterns**. The right side of `#` must be a control (`speed`, `cutoff`, …), not a bare string.”
context/ · L5-debug/tidal.md · chunk 1