MIDI†
とりあえずSMFを鳴らす。†
import java.io.File;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Sequence;
import javax.sound.midi.Sequencer;
public class SMFTest {
public static void main(String[] args) throws Exception {
// read SMF file
File myMidiFile = new File(args[0]);
Sequence mySeq = MidiSystem.getSequence(myMidiFile);
// load sequencer
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.setSequence(mySeq);
sequencer.start();
while (sequencer.isRunning()) {
Thread.sleep(1000);
}
sequencer.stop();
sequencer.close();
}
}
Counter: 6224,
today: 1,
yesterday: 2