Question on replacing a pattern element [resolved]

 s("piano!4")
  .n("1 2 3 4"
    .sometimesBy(0.05,x=>irand(9))
  ).scale("Eb2:minor")
  ._pianoroll({playhead:0,labels:1})

// hoped to get a semi-random pattern like "1 2 3 4 1 2 8 9 1 2 5 4" 
// but it doesn't work this way...

How do I randomly replace a value in a pattern? This is clearly not the way

Okay, so it seems that the solution is set()
Thanks Discord chat… :slight_smile:

s("piano!4")
  .n("1 2 3 4"
    .sometimesBy(0.05,x=>set(irand(9)))
  ).scale("Eb2:minor")
  ._pianoroll({playhead:0,labels:1})
// this looks better, eh? :)