I wanted to make a 'chord filter' that would group all the events (pitches) at a particular time, and output them in just one line. In other words, it would just alter those events which are identical (time identical) and leave the other elements in the same order.
So if you had this list (already processed so only time and pitch remain):

[time, pitch]
500 69
500 70
500 73
600 54
600 64
700 20

The processed list would be like this:

500 69 70 73
600 54 64
700 20

Do you think it is possible?