Getting key signature, time signature and different instruments from a midifile #159
-
Hi. I am wondering how i can get the key signature and time signature from a midifile. And i was also wondering how to get the different instruments and the notes belonging to them(for example getting the notes in the treble and bass staff from piano notation into 2 different arrays). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, First of all, there are no such things as treble and bass staff in a MIDI file. MIDI file contains track chunks. We can get of course Key Signature and Time Signature events (there can be multiple such events in a MIDI file) and then you can decide by yourself where treble staff and bass one. Please give me a MIDI file you want to retrieve the info from and I'll be able to say more. And also please say where bass and treble staffs in the file. |
Beta Was this translation helpful? Give feedback.
-
Sorry for a bad example. What i am having trouble with is taking a midi file made in for example Sibelius with multiple instruments(for example Piano and violin). And then getting the notes belonging to them. I have made a function that uses GetNotes() and returns an array with all the notes(see code), but i want to have different arrays for different instruments. Is this posible? public Melanchall.DryWetMidi.Interaction.Note[] GetMidiNotesArray(){
} |
Beta Was this translation helpful? Give feedback.
Hi,
First of all, there are no such things as treble and bass staff in a MIDI file. MIDI file contains track chunks. We can get of course Key Signature and Time Signature events (there can be multiple such events in a MIDI file) and then you can decide by yourself where treble staff and bass one.
Please give me a MIDI file you want to retrieve the info from and I'll be able to say more. And also please say where bass and treble staffs in the file.