home/ atoms/ sonic-pi-slicer-probability

The :slicer FX's probability: opt gates each phase on or off deterministically for random-sounding rhythms

probability: on the :slicer FX makes it roll a deterministic pseudo-random test before each phase: on success it applies the control wave, on failure it holds the amplitude (or the prob_pos: value). Values near 0 leave more space between sounds; near 1 fire almost every phase. Like all Sonic Pi randomisation it is deterministic — the same probability yields the same pulse rhythm every Run — but the FX has its own seed: opt (working like use_random_seed but local to that FX) to pick a different pattern. prob_pos: sets the resting wave position when the test fails.

Examples

with_fx :slicer, phase: 0.125, probability: 0.6, prob_pos: 1 do synth :tb303, note: :e1, cutoff_attack: 8, release: 8 end

Assessment

Set a :slicer with probability: 0.4 and describe how the pulse density changes versus 0.9. Explain why two Runs sound identical and how seed: changes that.

“its ability to use probability to choose whether or not to turn the slicer on or off”
corpus · sonic-pi-built-in-tutorial · chunk 47