music.stepped¶
- music.stepped(thresholds, otherwise=0.0)[source]¶
A bond that changes in steps rather than continuously.
Takes the value of the first threshold the frequency is below, which is how a register-dependent decision is usually written: one thing below middle C, another above it.
- Parameters:
- Returns:
callable()A function of one frequency, for
Bonds.
- Parameters:
- Return type:
Examples
>>> register = stepped([(262, 3.0), (523, 6.0)], otherwise=12.0) >>> register(220), register(440), register(880) (3.0, 6.0, 12.0)