set - pat
When called on a pattern a, with a input pattern b (a.set(b)),
combines a and b such that anything defined in b
and anything defined in a that is not defined in b
will be in the resulting pattern.
The structure is maintained from a,
because the default pattern alignment is in,
see the section on Pattern Alignment
in the technical manual in the docs
This is the inverse of keep
See examples below
// because input pattern has `s` set,
// it overrides the "sine" declared earlier
note("c a f e").s("sine").set(s("triangle")) | parameter | type |
|---|---|
| pat | |
| returns |