I've had a decent look at the midi file format and I thought I understood, so I wrote a python script that removed midis with multiple tracks from my data set in order to have only melodies in single tracks left. I did this by checking the track number bits in the header and if the track number was higher than one.. bingo! I am dealing with a large number of files so I checked a reasonable number of the latter removed files and they were indeed polyphonic with a melody and a chord sequence played simultaneously. I thought that that was mission accomplished but it was not, further data cleansing meant I heard midis as part of the testing and some of my remaining midis were still polyphonic. I can't see how to strip them from the dataset because I cannot figure out what uniquely identifies them as polyphonic midis.
I hope this is clear. Please advise.