YYYYYYYYYYYEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSS!
The working code, for those interested:
public static void playMidi(Song song){
String filename = "/music/"+song.name+".mid";
URL tempURL = MusicPlayer.class.getResource(filename);
try {
midiPlayer = MidiSystem.getSequencer();
midiPlayer.setSequence(MidiSystem.getSequence(tempURL));
midiPlayer.open();
midiPlayer.setLoopCount(Sequencer.LOOP_CONTINUOUSLY);
midiPlayer.start();
currentSong = song;
} catch (MidiUnavailableException ex) {
System.err.println("Midi Unavailable! "+ex.toString());
} catch (InvalidMidiDataException ex) {
System.err.println("Midi Invalid! "+ex.toString());
} catch (IOException ex) {
System.err.println("File Not Found! "+ex.toString());
}
}
I realized that the “MusicPlayer.class.getResource” was the way to go. I dunno why those other methods weren’t working, but they weren’t, so that’s that. I was looking over my working texture loading code I wrote months ago and saw that “getResource()” worked there so I tried it here and it’s glorious.
Thank you to all to all who responded! Couldn’t have done it without you! What a confusing mess, truly one for the ages.