Load Midi from local path?
<p>Where filename is the midi file. I want to load a full path (from local harddisk) into the getSequence but it doesn't accept except the filename itself. Sorry that I not good in Java and wish there is a solution for my need.</p>

<p>song = MidiSystem.getSequence(getClass().getResourceAsStream(filename));</p>

<p>and the Stackoverflow's richtext toolbar is missing in my Firefox browse?</p>

<p>[Update]</p>

<p>try {
        song = MidiSystem.getSequence(new FileInputStream(filename));
            sequencer = MidiSystem.getSequencer();
            sequencer.setSequence(song);
            sequencer.open();
            sequencer.addMetaEventListener(this);
            sequencer.start();
        } catch (InvalidMidiDataException e) {
            System.out.println("Bad midi file: "
                + filename);
            System.exit(1);
        } catch (MidiUnavailableException e) {
            System.out.println("No sequencer available");
            System.exit(1);
        } catch (IOException e) {
            System.out.println("Could not read: "
                + filename);
            System.exit(1);
        }</p>
