degrade and degradeBy randomly drop events from a pattern with a given probability
degrade p randomly removes events from pattern p with a 50% probability per event per cycle — equivalent to the ? mini-notation modifier on an event. degradeBy prob p sets a custom drop probability from 0 (nothing dropped) to 1 (everything dropped). This introduces controlled unpredictability: the pattern plays most hits but occasionally skips, giving the feel of human imperfection or generative variation, and it differs cycle to cycle because the choice is random each cycle. The ? shorthand also accepts a probability (clap?0.8 = 80% chance of dropping the clap). degrade belongs to a wider probabilistic family — degradeBy, sometimes/sometimesBy, often, rarely, somecycles — that gives finer control over drop or transform probability and can be layered for multi-level stochastic variation.
Examples
d1 $ degrade $ sound "bd*8" -- 50% of hits dropped
d1 $ degradeBy 0.6 $ sound "bd*8" -- 60% dropped
d1 $ sound "kick clap? kick snare" -- clap drops 50% of the time
d1 $ sound "kick clap?0.8 kick snare" -- clap drops 80% of the time
slow 2 $ degrade $ sound "[feel:5*8,feel*3]"
Assessment
Write a 16th-note hi-hat pattern that keeps roughly 70% of its hits per cycle, using degradeBy (or the ? shorthand with a probability). Explain why the pattern differs cycle to cycle, and contrast the result of degrade vs degradeBy 0.3 on the same pattern.