Random Thresh
Trigger some noise when the probability is below some threshold
by yotammann
HTML
<script src="https://tonejs.github.io/build/Tone.js"></script>
<script src="https://tonejs.github.io/Logo/build/Waveform.js"></script>
JavaScript
var synth = new Tone.Synth({
'oscillator.type' : 'square10',
'envelope' : {
attack : 0.001,
decay : 0.2,
sustain : 0
}
}).toMaster()
var pattern = new Tone.Pattern(function(time, note){
synth.triggerAttack(note, time);
}, ["C4", "G4", "F#5", "B6", "D3"], "random").start(0)
pattern.interval = 0.1
pattern.probability = 0.4
Tone.Transport.start()