Âè 15 ¾Ï: MIDI ¥µ¡¼¥Ó¥¹¤ÎÄó¶¡


 

Âè 13 ¾Ï¡Ö¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î³µÍספǡ¢javax.sound.sampled.spi ¤È javax.sound.midi.spi ¤Î 2 ¤Ä¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï¥µ¥¦¥ó¥É¥µ¡¼¥Ó¥¹¤Î³«È¯¼Ô¤¬»ÈÍѤ¹¤ëÃê¾Ý¥¯¥é¥¹¤òÄêµÁ¤·¤Æ¤¤¤ë¤³¤È¤òÀâÌÀ¤·¤Þ¤·¤¿¡£¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¤Ï¤³¤ì¤é¤ÎÃê¾Ý¥¯¥é¥¹¤Î¤¦¤Á¤Î¤¤¤º¤ì¤«¤Î¥¯¥é¥¹¤Î¥µ¥Ö¥¯¥é¥¹¤ò¼ÂÁõ¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¼Â¹Ô¥·¥¹¥Æ¥à¤Îµ¡Ç½À­¤ò³ÈÄ¥¤¹¤ë¿·¤·¤¤¥µ¡¼¥Ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Âè 14 ¾Ï¤Ç¤Ï javax.sound.sampled.spi ¥Ñ¥Ã¥±¡¼¥¸¤Î»ÈÍÑÊýË¡¤òÀâÌÀ¤·¤Þ¤·¤¿¡£¤³¤Î¾Ï¤Ç¤Ï¡¢MIDI ¥Ç¥Ð¥¤¥¹¤È MIDI ¥Õ¥¡¥¤¥ë¤ò¼è¤ê°·¤¦¤¿¤á¤Î¿·¤·¤¤¥µ¡¼¥Ó¥¹¤òÄ󶡤¹¤ë javax.sound.midi.spi ¥Ñ¥Ã¥±¡¼¥¸¤Î»ÈÍÑÊýË¡¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£

´û¸¤Î MIDI ¥µ¡¼¥Ó¥¹¤À¤±¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤ë¥×¥í¥°¥é¥Þ¤Ï¡¢¤³¤Î¾Ï¤òÆɤޤʤ¯¤Æ¤âº¹¤·»Ù¤¨¤¢¤ê¤Þ¤»¤ó¡£MIDI ¤Î³µÍפȥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ë¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¤Î MIDI ¥µ¡¼¥Ó¥¹¤Î»ÈÍÑÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë (¡ØJava Sound API ¥×¥í¥°¥é¥Þ¡¼¥º¥¬¥¤¥É¡Ù) ¤ÎÂè­¶Éô¡ÖMIDI¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾Ï¤Ç¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¤Î MIDI ¥µ¡¼¥Ó¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬¸Æ¤Ó½Ð¤¹ JavaTM Sound API ¥á¥½¥Ã¥É¤Ë¤Ä¤¤¤Æ¤ÎÃ챤¬¤¢¤ë¤³¤È¤òÁ°Äó¤È¤·¤Þ¤¹¡£

¤Ï¤¸¤á¤Ë

javax.sound.midi.spi ¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¼¡¤Î 4 ¤Ä¤ÎÃê¾Ý¥¯¥é¥¹¤¬Â¸ºß¤·¡¢MIDI ¥·¥¹¥Æ¥à¤òÄ󶡤¹¤ë 4 ¼ïÎà¤Î¥µ¡¼¥Ó¥¹¤òɽ¤·¤Æ¤¤¤Þ¤¹¡£

¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢¥µ¡¼¥Ó¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òľÀܺîÀ®¤¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¥µ¡¼¥Ó¥¹¥ª¥Ö¥¸¥§¥¯¥È¤¬ MidiDeviceProvider ¤Î¤è¤¦¤Ê¥×¥í¥Ð¥¤¥À¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤â¡¢¥×¥í¥Ð¥¤¥À¥ª¥Ö¥¸¥§¥¯¥È¤«¤éÄ󶡤µ¤ì¤ë Synthesizer ¤Î¤è¤¦¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤â¡¢Æ±ÍͤǤ¹¡£¤Þ¤¿¡¢¥×¥í¥°¥é¥à¤¬ SPI ¥¯¥é¥¹¤òľÀÜ»²¾È¤¹¤ë¤³¤È¤â¤¢¤ê¤Þ¤»¤ó¡£¤½¤ÎÂå¤ï¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï javax.sound.midi ¥Ñ¥Ã¥±¡¼¥¸Æâ¤Î MidiSystem ¥ª¥Ö¥¸¥§¥¯¥È¤ËÍ×µá¤ò¹Ô¤¤¤Þ¤¹¡£MidiSystem ¤Ï¡¢¤½¤ÎÍ×µá¤ò¼õ¤±¤Æ¡¢javax.sound.midi.spi ¥¯¥é¥¹¤Î¶ñ¾Ý¥µ¥Ö¥¯¥é¥¹¤ò»È¤Ã¤Æ¤³¤ì¤é¤ÎÍ×µá¤ò½èÍý¤·¤Þ¤¹¡£

MIDI ¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¥µ¡¼¥Ó¥¹¤ÎÄó¶¡

ɸ½à MIDI ¥Õ¥¡¥¤¥ë·Á¼°¤Ï Type 0¡¢Type 1¡¢Type 2 ¤Î 3 ¼ïÎब¤¢¤ê¡¢Java Sound API ¤Î¼ÂÁõ¤Ç¤â¤³¤ì¤é¤Î¤¹¤Ù¤Æ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë·Á¼°¤Ï¡¢¥Õ¥¡¥¤¥ëÆâ¤Î MIDI ¥·¡¼¥±¥ó¥¹¥Ç¡¼¥¿¤ÎÆâÉôɽ¸½¤Ë¤è¤Ã¤Æ°ã¤¤¡¢¥·¡¼¥±¥ó¥¹¤Î¼ïÎà¤Î°ã¤¤¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î 3 ¼ïÎà¤Î¥Õ¥¡¥¤¥ë·Á¼°¤Î¤¤¤º¤ì¤«¤¬¼ÂÁõ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë·Á¼°¤Î¥µ¥Ý¡¼¥È¤ò¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¤¬Ä󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£É¸½à MIDI ¥Õ¥¡¥¤¥ë·Á¼°¤Ë¤Ï¡¢°ìÉôÆȼ«·Á¼°¤òÄɲ䷤ƲþÊѤµ¤ì¤¿¤â¤Î¤¬¤¢¤ê¡¢É¸½à¤Î·Á¼°¤ÈƱÍͤˡ¢¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤ò¼õ¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

MIDI ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ßµ¡Ç½¤Ï MidiFileWriter ¤Î¶ñ¾Ý¥µ¥Ö¥¯¥é¥¹¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤Þ¤¹¡£¤³¤ÎÃê¾Ý¥¯¥é¥¹¤Ï javax.sampled.spi.AudioFileWriter ¤È¤Û¤ÜƱ¤¸¤Ç¤¹¡£¤³¤³¤Ç¤âƱÍͤˡ¢¥á¥½¥Ã¥É¤Ï½ñ¤­¹þ¤á¤ë¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥×¤òÃΤ뤿¤á¤Î¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤È¼ÂºÝ¤Ë¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤à¤¿¤á¤Î¥á¥½¥Ã¥É¤Ëʬ¤±¤é¤ì¤Þ¤¹¡£AudioFileWriter ¤Î¾ì¹ç¤ÈƱÍͤˡ¢¼¡¤Î 2 ¤Ä¤Î¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤Ï¶ñ¾Ý¥á¥½¥Ã¥É¤Ç¤¹¡£

boolean isFileTypeSupported(int fileType)
boolean isFileTypeSupported(int fileType, Sequence sequence)
1 ¤ÄÌܤΥ᥽¥Ã¥É¤Ï¡¢»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤Î MIDI ¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¥é¥¤¥¿¡¼¤¬½ñ¤­¹þ¤á¤ë¤«¤É¤¦¤«¤Ë¤Ä¤¤¤Æ¤Î°ìÈÌŪ¤Ê¾ðÊó¤òÄ󶡤·¤Þ¤¹¡£2 ¤ÄÌܤΥ᥽¥Ã¥É¤Ï¡¢¤è¤êºÙ¤«¤¯ÆÃÄꤹ¤ë¤â¤Î¤Ç¤¹¡£»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤Î MIDI ¥Õ¥¡¥¤¥ë¤ËÆÃÄê¤Î Sequence ¤ò½ñ¤­¹þ¤á¤ë¤«¤É¤¦¤«¤òÌ䤤¹ç¤ï¤»¤Þ¤¹¡£Ä̾ï¤Ï¡¢¤³¤Î 2 ¤Ä¤Î¶ñ¾Ý¥á¥½¥Ã¥É¤Ï¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£¥Ç¥Õ¥©¥ë¥È¼ÂÁõ¤Ç¤Ï¡¢2 ¤Ä¤Î¥á¥½¥Ã¥É¤Ï¤½¤ì¤¾¤ìÂбþ¤¹¤ë 2 ¤Ä¤Î¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤Î°ìÊý¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢ÊÖ¤µ¤ì¤¿·ë²Ì¤ò·«¤êÊÖ¤·Ä´¤Ù¤Þ¤¹¡£¤³¤Î 2 ¤Ä¤Î¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤ÏÃê¾Ý¥á¥½¥Ã¥É¤Ê¤Î¤Ç¡¢¥µ¥Ö¥¯¥é¥¹¤Ë¼ÂÁõ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
abstract int[] getMidiFileTypes()
abstract int[] getMidiFileTypes(Sequence sequence)
1 ¤ÄÌܤΥ᥽¥Ã¥É¤Ï°ìÈ̤˥µ¥Ý¡¼¥È¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£°ìÈÌŪ¤Ê¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥é¥¤¥¿¡¼¤Î¥³¥ó¥¹¥È¥é¥¯¥¿Æâ¤Ç¤³¤ÎÇÛÎó¤ò½é´ü²½¤·¤Æ¡¢¤³¤Î¥á¥½¥Ã¥É¤«¤é¤³¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£¼¡¤Î¥á¥½¥Ã¥É¤Ï¡¢°ìÏ¢¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ÎÃ椫¤é¡¢¥Õ¥¡¥¤¥ë¥é¥¤¥¿¡¼¤¬½êÄê¤Î Sequence ¤ò½ñ¤­¹þ¤à¤³¤È¤Î¤Ç¤­¤ë¥µ¥Ö¥»¥Ã¥È¤òõ¤·¤Þ¤¹¡£MIDI »ÅÍͤˤè¤ê¡¢¤¹¤Ù¤Æ¤Î¥¿¥¤¥×¤Î¥·¡¼¥±¥ó¥¹¤ò¤¹¤Ù¤Æ¤Î¥¿¥¤¥×¤Î MIDI ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤á¤ë¤È¤Ï¸Â¤ê¤Þ¤»¤ó¡£

MidiFileWriter ¥µ¥Ö¥¯¥é¥¹¤Î write ¥á¥½¥Ã¥É¤Ï¡¢½êÄê¤Î Sequence ¤ò»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤Î MIDI ¥Õ¥¡¥¤¥ë¤ËŬ¹ç¤¹¤ë¥Ç¡¼¥¿·Á¼°¤ËÉä¹æ²½¤·¡¢¥³¡¼¥É²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ò¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£

abstract int write(Sequence in, int fileType, 
                   java.io.File out) 
abstract int write(Sequence in, int fileType, 
                   java.io.OutputStream out) 
¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢write ¥á¥½¥Ã¥É¤Ï¡¢¥È¥é¥Ã¥¯¤ò·«¤êÊÖ¤·Ä´¤Ù¤Æ Sequence ¤ò¹½Ê¸²òÀϤ·¡¢Å¬±þ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ø¥Ã¥À¤ò¹½ÃÛ¤·¡¢¥Ø¥Ã¥À¤È¥È¥é¥Ã¥¯¤ò½ÐÎϤ˽ñ¤­¹þ¤àɬÍפ¬¤¢¤ê¤Þ¤¹¡£MIDI ¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À·Á¼°¤ÏÅöÁ³¡¢MIDI »ÅÍͤÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Ø¥Ã¥À¤Ë´Þ¤Þ¤ì¤ë¾ðÊó¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬ MIDI ¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡Ö¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¡×¡¢¥Ø¥Ã¥À¤ÎŤµ¡¢¥È¥é¥Ã¥¯¿ô¡¢¥·¡¼¥±¥ó¥¹¤Î¥¿¥¤¥ß¥ó¥°¾ðÊó (½ü»»·Á¼°¤Èʬ²òǽ) ¤Ê¤É¤Ç¤¹¡£MIDI ¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ï¡¢MIDI »ÅÍͤˤè¤êÄêµÁ¤µ¤ì¤¿·Á¼°¤Î¥È¥é¥Ã¥¯¥Ç¡¼¥¿¤Ç¤¹¡£

¤³¤³¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¡¢MIDI ¥·¥¹¥Æ¥à¡¢¤ª¤è¤Ó¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¤¬ MIDI ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤Ç¤É¤Î¤è¤¦¤ËÏ¢·È¤¹¤ë¤«¤ò´Êñ¤ËÀâÌÀ¤·¤Þ¤¹¡£ÉáÄÌ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¥Õ¥¡¥¤¥ë¤ËÊݸ¤¹¤ë¤¿¤á¤Î MIDI Sequence ¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤â¤¦¤È¤¹¤ëÁ°¤Ë¡¢¤³¤Î Sequence ¤Ë»ÈÍѤǤ­¤ë MIDI ¥Õ¥¡¥¤¥ë·Á¼°¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¡¢MidiSystem ¥ª¥Ö¥¸¥§¥¯¥È¤ËÌ䤤¹ç¤ï¤»¤Þ¤¹¡£MidiSystem.getMidiFileTypes(Sequence) ¥á¥½¥Ã¥É¤Ï¡¢¥·¥¹¥Æ¥à¤¬ÆÃÄê¤Î¥·¡¼¥±¥ó¥¹¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¤¹¤Ù¤Æ¤Î MIDI ¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë MidiFileWriter ¥µ¡¼¥Ó¥¹¤Î¤½¤ì¤¾¤ì¤ËÂбþ¤¹¤ë getMidiFileTypes ¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢·ë²Ì¤ò¼ý½¸¤·¡¢À°¿ô¤ÎÇÛÎó¤ÇÊÖ¤¹¤³¤È¤Ë¤è¤ê¤³¤ì¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤ÎÇÛÎó¤Ï¡¢½êÄê¤Î Sequence ¤ËÂбþ¤¹¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Î¥Þ¥¹¥¿¡¼¥ê¥¹¥È¤È¹Í¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Õ¥¡¥¤¥ë¤Ë Sequence ¤ò½ñ¤­¹þ¤à¤È¤­¤Ï¡¢¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤òɽ¤¹À°¿ô¤È¡¢½ñ¤­¹þ¤Þ¤ì¤ë Sequence ¤È¡¢½ÐÎÏÀè¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë°ú¿ô¤¬ MidiSystem.write ¤Ø¤Î¸Æ¤Ó½Ð¤·¤ËÅϤµ¤ì¤Þ¤¹¡£MidiSystem ¤Ï¡¢»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤ò»È¤Ã¤Æ½ñ¤­¹þ¤ßÍ×µá¤ò½èÍý¤¹¤ë¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß MidiFileWriter ¤òȽÃǤ·¡¢Âбþ¤¹¤ë write ¤òŬÀÚ¤Ê MidiFileWriter ¤Ë¥Ç¥£¥¹¥Ñ¥Ã¥Á¤·¤Þ¤¹¡£

MIDI ¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß¥µ¡¼¥Ó¥¹¤ÎÄó¶¡

MidiFileReader Ãê¾Ý¥¯¥é¥¹¤Ï javax.sampled.spi.AudioFileReader ¥¯¥é¥¹¤ËÎà»÷¤·¤Æ¤¤¤Þ¤¹¡£¤É¤Á¤é¤Î¥¯¥é¥¹¤â 2 ¤Ä¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É¥á¥½¥Ã¥É¤Ç¹½À®¤µ¤ì¡¢¤½¤ì¤¾¤ì¤¬ File¡¢URL¡¢InputStream ¤Î¤¤¤º¤ì¤« 1 ¤Ä¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£1 ¤ÄÌܤΥª¡¼¥Ð¡¼¥í¡¼¥É¥á¥½¥Ã¥É¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë·Á¼°¤òÊÖ¤·¤Þ¤¹¡£MidiFileReader ¤Î¾ì¹ç¡¢API ¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£

abstract MidiFileFormat getMidiFileFormat(java.io.File file) 
abstract MidiFileFormat getMidiFileFormat(
    java.io.InputStream stream) 
abstract MidiFileFormat getMidiFileFormat(java.net.URL url) 
¶ñ¾Ý¥µ¥Ö¥¯¥é¥¹¤Ë¤Ï¡¢ÆÃÄê¤Î MIDI ¥Õ¥¡¥¤¥ë (¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ä URL) ¤Î·Á¼°¤òµ­½Ò¤¹¤ë MidiFileFormat ¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¤³¤ì¤é¤Î¥á¥½¥Ã¥É¤ò¼ÂÁõ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤¿¤À¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥ê¡¼¥À¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢¥Õ¥¡¥¤¥ë¤ËÍ­¸ú¤Ê¥Ø¥Ã¥À¾ðÊ󤬴ޤޤì¤Æ¤¤¤ë¤³¤È¤¬¾ò·ï¤Ç¤¹¡£¤³¤Î¾ò·ï¤¬Ëþ¤¿¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢InvalidMidiDataException ¤òȯ¹Ô¤·¤Þ¤¹¡£

¤â¤¦ 1 ¤Ä¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É¥á¥½¥Ã¥É¤Ï¡¢½êÄê¤Î¥Õ¥¡¥¤¥ë¡¢¥¹¥È¥ê¡¼¥à¡¢¤Þ¤¿¤Ï URL ¤«¤é MIDI Sequence ¤òÊÖ¤·¤Þ¤¹¡£

abstract Sequence getSequence(java.io.File file) 
abstract Sequence getSequence(java.io.InputStream stream) 
abstract Sequence getSequence(java.net.URL url) 
getSequence ¥á¥½¥Ã¥É¤Ï MIDI ÆþÎÏ¥Õ¥¡¥¤¥ëÆâ¤Î¥Ð¥¤¥È¤Î¹½Ê¸²òÀϤκî¶È¤ò¼ÂºÝ¤Ë¹Ô¤¤¡¢Âбþ¤¹¤ë Sequence ¥ª¥Ö¥¸¥§¥¯¥È¤ò¹½À®¤·¤Þ¤¹¡£¤³¤Îºî¶È¤ÏËܼÁŪ¤Ë¡¢MidiFileWriter.write ¤Ç»ÈÍѤµ¤ì¤ë½èÍý¤ÎÈ¿ÂФǤ¹¡£¤³¤Îºî¶È¤Ï MIDI »ÅÍͤÇÄê¤á¤é¤¿ MIDI ¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤È Java Sound API ¤ËÄê¤á¤é¤ì¤¿ Sequence ¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ï 1 ÂÐ 1 ¤ÎÂбþ´Ø·¸¤¬¤¢¤ë¤¿¤á¡¢¹½Ê¸²òÀϤξܺټê½ç¤Ï´Êñ¤Ç¤¹¡£getSequence ¤ËÅϤµ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¥Ç¡¼¥¿¤ò¥Õ¥¡¥¤¥ë¥ê¡¼¥À¤¬²ò¼á¤Ç¤­¤Ê¤¤¾ì¹ç (¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤¿¤ê¡¢MIDI »ÅÍͤ˽¾¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ê¤É) ¤Ï¡¢InvalidMidiDataException ¤òȯ¹Ô¤·¤Þ¤¹¡£

ÆÃÄê¤Î MIDI ¥Ç¥Ð¥¤¥¹¤ÎÄó¶¡

MidiDeviceProvider ¤Ï¡¢ÆÃÄ꥿¥¤¥× (1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô) ¤Î MIDI ¥Ç¥Ð¥¤¥¹¤òÄ󶡤¹¤ë¥Õ¥¡¥¯¥È¥ê¤È¹Í¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï¡¢MIDI ¥Ç¥Ð¥¤¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÊÖ¤¹¥á¥½¥Ã¥É¤È¡¢¤½¤Î¥×¥í¥Ð¥¤¥À¤¬Ä󶡤Ǥ­¤ë¥Ç¥Ð¥¤¥¹¤Î¼ïÎà¤ò³Îǧ¤¹¤ë¤¿¤á¤Î¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£

¤Û¤«¤Î javax.sound.midi.spi ¥µ¡¼¥Ó¥¹¤ÈƱÍͤˡ¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó³«È¯¼Ô¤Ï MidiSystem ¤Î¥á¥½¥Ã¥É¡¢¤³¤Î¾ì¹ç¤Ï MidiSystem.getMidiDevice ¤È MidiSystem.getMidiDeviceInfo ¤Ø¤Î¸Æ¤Ó½Ð¤·¤ò²ð¤·¤Æ MidiDeviceProvider ¥µ¡¼¥Ó¥¹¤Ë´ÖÀÜŪ¤Ë¥¢¥¯¥»¥¹¤·¤Þ¤¹¡£MidiDeviceProvider ¤ò¥µ¥Ö¥¯¥é¥¹²½¤¹¤ë¤³¤È¤ÎÌÜŪ¤Ï¿·¤·¤¤¼ïÎà¤Î¥Ç¥Ð¥¤¥¹¤òÄ󶡤¹¤ë¤³¤È¤Ê¤Î¤Ç¡¢javax.sound.sampled.spi ¥Ñ¥Ã¥±¡¼¥¸¤Î MixerProvider ¤Î¾ì¹ç¤ÈƱÍͤˡ¢¥µ¡¼¥Ó¥¹¤Î³«È¯¼Ô¤ÏÊÖ¤µ¤ì¤ë¥Ç¥Ð¥¤¥¹¤Ë´Ø¤¹¤ë¥¯¥é¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤Î¥¯¥é¥¹¤Ï javax.sound.sampled.Mixer ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤·¤Þ¤¹¡£¤³¤³¤Ç¤Ï javax.sound.midi.MidiDevice ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤·¤Þ¤¹¡£Synthesizer ¤ä Sequencer ¤Î¤è¤¦¤Ê MidiDevice ¤Î¥µ¥Ö¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£

MidiDeviceProvider ¤Îñ°ì¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤âÊ£¿ô¤Î¼ïÎà¤Î MidiDevice ¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤³¤È¤«¤é¡¢¤³¤Î¥¯¥é¥¹¤Î getDeviceInfo ¥á¥½¥Ã¥É¤ÏÍøÍѲÄǽ¤ÊÊ£¿ô¤Î MidiDevices ¥Ç¥Ð¥¤¥¹¤òÎóµó¤·¤¿ MidiDevice.Info ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£

abstract MidiDevice.Info[] getDeviceInfo() 

ÊÖ¤µ¤ì¤¿ÇÛÎó¤Ë´Þ¤Þ¤ì¤ëÍ×ÁÇ¤Ï 1 ¤Ä¤Î¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£°ìÈÌŪ¤Ê¥×¥í¥Ð¥¤¥À¤Î¼ÂÁõ¤Ç¤Ï¡¢¥³¥ó¥¹¥È¥é¥¯¥¿Æâ¤ÇÇÛÎó¤ò½é´ü²½¤·¡¢¤½¤ì¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤Ã¤Æ¡¢MidiSystem ¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¤Î MidiDeviceProviders ¤ò¤¹¤Ù¤Æ·«¤êÊÖ¤·¤Æ¡¢¤¹¤Ù¤Æ¤Î¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¥Ç¥Ð¥¤¥¹¤Î¥ê¥¹¥È¤ò¹½ÃۤǤ­¤Þ¤¹¡£¤½¤Î¸å¡¢MidiSystem ¤Ï¤³¤Î¥ê¥¹¥È (MidiDevice.Info[] ÇÛÎó) ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤ËÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

MidiDeviceProvider ¤Ë¤Ï¡¢¼¡¤Î¶ñ¾Ý¥¯¥¨¥ê¡¼¥á¥½¥Ã¥É¤â´Þ¤Þ¤ì¤Þ¤¹¡£

boolean isDeviceSupported(MidiDevice.Info info) 
¤³¤Î¥á¥½¥Ã¥É¤Ë¤è¤ê¡¢¥·¥¹¥Æ¥à¤ÏÆÃÄê¤Î¼ïÎà¤Î¥Ç¥Ð¥¤¥¹¤Ë¤Ä¤¤¤Æ¥×¥í¥Ð¥¤¥À¤ËÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°ìÈ̤ˡ¢¤³¤ÎÊØÍø¤Ê¥á¥½¥Ã¥É¤Ï¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£¥Ç¥Õ¥©¥ë¥È¼ÂÁõ¤Ç¤Ï¡¢getDeviceInfo ¤«¤éÊÖ¤µ¤ì¤¿ÇÛÎó¤ò·«¤êÊÖ¤·¤Æ¡¢³ÆÍ×ÁǤȰú¿ô¤È¤òÈæ³Ó¤·¤Þ¤¹¡£

ºÇ¸å¤Î MidiDeviceProvider ¥á¥½¥Ã¥É¤Ï¡¢Í׵ᤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¤òÊÖ¤·¤Þ¤¹¡£

abstract MidiDevice getDevice(MidiDevice.Info info) 
¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢ºÇ½é¤Ë°ú¿ô¤¬¤³¤Î¥×¥í¥Ð¥¤¥À¤¬Ä󶡤Ǥ­¤ë¥Ç¥Ð¥¤¥¹¤òµ­½Ò¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¥Ç¥Ð¥¤¥¹¤òµ­½Ò¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢IllegalArgumentException ¤ò¥¹¥í¡¼¤·¤Þ¤¹¡£°ú¿ô¤ËÂбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬¤¢¤ë¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¥Ð¥¤¥¹¤òÊÖ¤·¤Þ¤¹¡£

¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß¥µ¡¼¥Ó¥¹¤ÎÄó¶¡

SoundBank ¤Ï¡¢Synthesizer ¤Ë¥í¡¼¥É¤Ç¤­¤ë°ìÏ¢¤Î Instruments ¤Ç¤¹¡£Instrument (¥¤¥ó¥¹¥È¥¥¥ë¥á¥ó¥È) ¤Ï¡¢ÆÃÄê¤Î¼ïÎà¤Î¥µ¥¦¥ó¥É¤òºî¤ë¥µ¥¦¥ó¥É¹çÀ®¥¢¥ë¥´¥ê¥º¥à¤Î¼ÂÁõ¤Ç¤¹¡£¤³¤ÎÃæ¤Ë¤ÏÉտ魯¤ë̾Á°¤È¾ðÊó¤Îʸ»úÎó¤â´Þ¤Þ¤ì¤Þ¤¹¡£SoundBank ¤Ï MIDI »ÅÍͤΥХ󥯤ˤۤÜÂбþ¤·¤Æ¤¤¤Þ¤¹¤¬¡¢³ÈÄ¥À­¤¬¤¢¤ê¡¢¥¢¥É¥ì¥¹²Äǽ¤Ê½¸¹ç¤Ç¤¹¡£MIDI ¥Ð¥ó¥¯¤Î½¸¹ç¤È¹Í¤¨¤ëÊý¤¬Å¬ÀڤǤ¹¡£SoundBank ¤È Synthesizer ¤òÍý²ò¤¹¤ë¤¿¤á¤Î¾ðÊó¤Ï¡¢Âè 12 ¾Ï¡Ö¥µ¥¦¥ó¥É¤Î¹çÀ®¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

SoundbankReader ¤Ï 1 ¤Ä¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É¥á¥½¥Ã¥É¤«¤éÀ®¤ê¤Þ¤¹¡£¤³¤Î¥á¥½¥Ã¥É¤ò¥·¥¹¥Æ¥à¤¬¸Æ¤Ó½Ð¤·¤Æ¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ë¤«¤é Soundbank ¥ª¥Ö¥¸¥§¥¯¥È¤òÆɤ߹þ¤ß¤Þ¤¹¡£

abstract Soundbank getSoundbank(java.io.File file) 
abstract Soundbank getSoundbank(java.io.InputStream stream) 
abstract Soundbank getSoundbank(java.net.URL url) 

SoundbankReader ¤Î¶ñ¾Ý¥µ¥Ö¥¯¥é¥¹¤Ï¡¢¥×¥í¥Ð¥¤¥À¤¬ÄêµÁ¤·¤¿ÆÃÄê¤Î SoundBank¡¢Instrument¡¢Synthesizer ¤Î¼ÂÁõ¤ÈÏ¢·È¤·¤Æ¡¢¥·¥¹¥Æ¥à¤¬¥Õ¥¡¥¤¥ë¤«¤éÆÃÄê¤Î Synthesizer ¥¯¥é¥¹¤Ë SoundBank ¤ò¥í¡¼¥É¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£Synthesizer ¤´¤È¤Ë¹çÀ®µ»½Ñ¤ÏÂ礭¤¯°Û¤Ê¤ê¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢Synthesizer ¤Î¹çÀ®½èÍý¤Ë¥³¥ó¥È¥í¡¼¥ë¤Þ¤¿¤Ï»ØÄê¥Ç¡¼¥¿¤òÄ󶡤¹¤ë Instrument ¤Þ¤¿¤Ï SoundBank ¤ËÊݸ¤µ¤ì¤ë¥Ç¡¼¥¿¤Î·Á¼°¤Ï¿´ô¤Ë¤ï¤¿¤ê¤Þ¤¹¡£¹çÀ®µ»½Ñ¤Ë¤è¤Ã¤Æ¤Ï¡¢É¬Íפʥѥé¥á¡¼¥¿¥Ç¡¼¥¿¤¬¿ô¥Ð¥¤¥È¤À¤±¤Î¾ì¹ç¤ä¡¢ËÄÂç¤Ê¥µ¥¦¥ó¥É¥µ¥ó¥×¥ë¤ò¥Ù¡¼¥¹¤Ë¤·¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£SoundBank Æâ¤Ë¤É¤Î¤è¤¦¤Ê¥ê¥½¡¼¥¹¤¬Â¸ºß¤¹¤ë¤Î¤«¤Ï¡¢¤½¤ì¤é¤Î¥í¡¼¥ÉÀè¤Î Synthesizer ¤ÎÀ­¼Á¤Ë°Í¸¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢SoundbankReader ¥µ¥Ö¥¯¥é¥¹¤Î getSoundbank ¥á¥½¥Ã¥É¤Î¼ÂÁõ¤Ë¤Ï¡¢ÆÃÄê¤Î¼ïÎà¤Î SoundBank ¤Ë´Ø¤¹¤ë¾ðÊó¤Ø¤Î¥¢¥¯¥»¥¹¼êÃʤ¬¤¢¤ê¤Þ¤¹¡£¤µ¤é¤Ë¡¢SoundbankReader ¤ÎÆÃÄê¤Î¥µ¥Ö¥¯¥é¥¹¤Ï¡¢SoundBank ¥Ç¡¼¥¿¤òÊݸ¤¹¤ë¤¿¤á¤ÎÆÃÄê¤Î¥Õ¥¡¥¤¥ë·Á¼°¤òÍý²ò¤·¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë·Á¼°¤Ï¥Ù¥ó¥À¡¼¸ÇÍ­¤ÇÆȼ«·Á¼°¤Î¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£

SoundBank ¤Ïñ¤Ê¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¹¡£SoundBank ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆâÍƤ˴ؤ¹¤ëÀ©Ìó¤Ï¤Û¤È¤ó¤É¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¥µ¥Ý¡¼¥È¤¹¤ëɬÍפΤ¢¤ë¥á¥½¥Ã¥É (getResources¡¢getInstruments¡¢getVendor¡¢getName ¤Ê¤É) ¤Ç¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ë´Þ¤Þ¤ì¤ë¥Ç¡¼¥¿Í×·ï¤Ï´Ë¤¤¤â¤Î¤Ç¤¹¡£¤¿¤È¤¨¤Ð¡¢getResources ¤È getInstruments ¤Ï¶õÇò¤ÎÇÛÎó¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥µ¥Ö¥¯¥é¥¹²½¤µ¤ì¤¿ SoundBank ¥ª¥Ö¥¸¥§¥¯¥È¤Î¼ÂºÝ¤ÎÆâÍÆ¡¢Æä˥¤¥ó¥¹¥È¥¥¥ë¥á¥ó¥È¤È¥¤¥ó¥¹¥È¥¥¥ë¥á¥ó¥È°Ê³°¤Î¥ê¥½¡¼¥¹¤Ï¡¢¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¤Ë¤è¤Ã¤Æ·è¤á¤é¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ë¤ò²òÀϤ¹¤ëµ¡¹½¤Ï¡¢¤½¤Î¼ïÎà¤Î¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ë¤Î»ÅÍͤ˴°Á´¤Ë°Í¸¤·¤Þ¤¹¡£

¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ë¤Ï Java Sound API ¤Î³°Éô¤Ë¡¢Ä̾ï¤Ï¤½¤Î¼ïÎà¤Î¥µ¥¦¥ó¥É¥Ð¥ó¥¯¤ò¥í¡¼¥É¤Ç¤­¤ë¥·¥ó¥»¥µ¥¤¥¶¤Î¥Ù¥ó¥À¡¼¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤Þ¤¹¡£¥µ¥¦¥ó¥É¥Ð¥ó¥¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥¨¥ó¥É¥æ¡¼¥¶¥Ä¡¼¥ë¤ò¥Ù¥ó¥À¡¼¤¬Ä󶡤¹¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£