Separate names with a comma.
I've got a MIDI file and need to convert it into noteblock code. How should I do that?
I believe that NoteBlock studio may be able to help.
I have no experience with MIDI files, but if you're looking to create your music player from scratch, javax.sound.midi.spi.MidiFileReader looks promising. I believe you could get the file's sequence from the reader, and from that sequence get the timing and note from each NOTE_ON (0x90) event in the sequence's tracks. Then, it would be up to you to create a player than properly times and plays the notes that you read from each track.
javax.sound.midi.spi.MidiFileReader - MidiFileReader javadocs
MIDI Event Table - List of MIDI events, although in your case, you should only need NOTE_ON (0x90)
Note Names, MIDI Numbers and Frequencies - Conversion table for MIDI note ID into music note name
Note Block - Minecraft Wiki - Conversion table for music note names into pitches (for last parameter in org.bukkit.entity.Player.playSound())
If you would rather look at existing implementations, then help is only a Google search away ("spigot midi player").