dinder-mufflin / igtv

MIT License
1 stars 0 forks source link

Lookup Instrument for Each Track #20

Open hopskipnfall opened 10 years ago

hopskipnfall commented 10 years ago
jcgmusic1 commented 10 years ago

I am having a really hard time figure out where the instrument id is located. As far as I can see I have to get the the sequence, the the track array, then the Midi message, and the the byte array of that message. Look through the byte array and find the program change message. I don't see any of those in the file though, I am also sure there is a better way to do this, any ideas? I was looking at the getNotes() method but it doesn't contain the instrument type, just the channel and the track numbers.

hopskipnfall commented 10 years ago

@jcgmusic1 The channel is the instrument number.

jcgmusic1 commented 10 years ago

The channel is the track the the midi note is being played on. It returns a range of 1-16 since there are only 16 allowed tracks in a midi file. Each channel can hold many different instruments though, which I think is the reason it is difficult to extract. I will keep working on this though and I will keep you all posted.

hopskipnfall commented 10 years ago

Oh you're right. My bad.