< Back to IRCAM Forum

Randomly filter out notes

Hello all,

I have a chord-seq with which I’d like to randomly filter out some percentage of the notes (for instance, to assign each note a probability of removal). I can’t quite figure out a good way to do this --any help would be much appreciated. An image of what I’d like to do is attached.


Hi Justin

I am no expert in probabilities, but it seems your problem is rather a markovian appraoch.
Maybe you should check out omalea and patterns libraries for this.


Seems to me the basic approach would be:
The chordseq is a list of lists.
Simply re-sort that list of lists.
Lop off the last X lists in the list.
Then re-sort in time order and display.

I guess the tricky thing is that you are doing this to multiple lists ( midicents, onsets, durtions, dynamics, etc) at once. So you need some way to do the same sorting / cutting/ re-assembling operation to all of the chordseq lists at once.

One way could be to set up a random probability 0.0->1.0, and if it’s above your threshold don’t collect the note. Check attached sketch.

A minor complication - possibly a bug in #'objfromobjs - is that feeding a list of chord objects (ie. from a call to 'inside) to the second input of a chord-seq doesn’t assign their already set 'offset-values to the same chords in the new chord-seq. Meaning you’ll have to assign those 'manually through the offset-slot as in the example. The other slots - chan, dur, dyn, port - seem ok however


Hello all,

Thanks for the quick replies. I re-created anders’ patch and it works perfectly for me!