Writing out additional data to a text file using [seq]

Thomas's icon

Is there a way to record additional data into the seq object to later write it out to a text file?
For starters I would like to also store the midi channel number alongside time, pitch and velocity for each midi event.
It would be great however to also store additional information with each midi event.

Thanks,
Thomas

Thomas's icon

By the way, I need this for midi data collection of two pianists in an experimental setting.

So, in case anyone wonders how to solve this
Here is what I came up with so far. It's far from what I would like to have, but it works:
I am recording the midi sequence including timestamps with [seq] and read the data out to a txt file.
At the same time I am recording the midi information from [notein] with a [coll] object. Here I am missing the timestamps, but I can add as much columns to every midi event as I want, such as participant IDs, trial number etc. This can also be read out and written to a txt file.

Finally, these two files only need to be combined. They don't even need to be aligned, as they should be automatically. The alignment, however, can be checked due to the pitch, and velocity information that is present in both txt files.

Alex Keegan's icon

Hi, would you be able to share your patch for this please? Am interested to see what you did.

Thomas's icon

Hej Alex,

sorry for the late reply!
Sure. Just be aware of a lot of problems that might be in there due to my lack of understanding and time constraints that were in place.
It's also super messy and a lot of stuff is in there that is not related to the seq and text file combination you are interested in.

When you open it, to the left you can see the [seq] object and a little further down you can see a [coll] object called "data".

Max Patch
Copy patch and select New From Clipboard in Max.

So here it is:

Cheers,
Thomas