{"id":213,"date":"2013-07-02T23:09:49","date_gmt":"2013-07-02T21:09:49","guid":{"rendered":"http:\/\/www.joanillo.org\/?p=213"},"modified":"2020-09-16T12:39:04","modified_gmt":"2020-09-16T10:39:04","slug":"solucion-portatil-para-un-saxo-electronico-raspberry-pi-soft-o-hard-sinte","status":"publish","type":"post","link":"https:\/\/www.joanillo.org\/?p=213&lang=es","title":{"rendered":"Soluci\u00f3n port\u00e1til para un saxo electr\u00f3nico: Raspberry PI + soft o hard sinte"},"content":{"rendered":"<div id=\"attachment_736\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.joanillo.org\/wp-content\/uploads\/2013\/07\/ewi-usb-fluid1.jpg\"><img aria-describedby=\"caption-attachment-736\" loading=\"lazy\" src=\"http:\/\/www.joanillo.org\/wp-content\/uploads\/2013\/07\/ewi-usb-fluid1-300x225.jpg\" alt=\"EWI-USB and Raspberry Pi\" title=\"EWI-USB and Raspberry Pi\" width=\"300\" height=\"225\" class=\"size-medium wp-image-736\"><\/a><p id=\"caption-attachment-736\" class=\"wp-caption-text\">EWI-USB and Raspberry Pi<\/p><\/div>\n<p>Para tocar el controlador de viento <strong>EWI-USB<\/strong> normalmente me conecto al port\u00e1til. Ejecuto el <strong>fluidsynth<\/strong> o cualquier otro soft sinte. Por tanto, la soluci\u00f3n para practicar es EWI-USB + port\u00e1til + auriculares. Existe una soluci\u00f3n m\u00e1s portable y aut\u00f3noma? Definitivamente s\u00ed utilizando la <strong>Raspberry Pi<\/strong>, buscando una soluci\u00f3n puramente consola y totalment desatendida: enchufar y tocar. En esta ocasi\u00f3n no utilizo JACK, es una soluci\u00f3n purament <strong>ALSA<\/strong>. Se trata de instalar fluidsynth, alg\u00fan soundfont que suene bien y que no pese demasiado, configurar el usuario <em>pi<\/em> con prioridad realtime, desinstalar cualquier servicio que no tenga que utilizar.<\/p>\n<p>Con un script en <em>\/etc\/udev\/rules.d\/ewiusb.rules<\/em> conseguimos que en el momento que conecto el EWI-USB por el puerto USB se ejecuten los comandos que me permitir\u00e1n tocar autom\u00e1ticamente: ejecutar fluidsynth y conectar la salida midi del EWI-USB a la entrada midi del fluidsynth. He tenido bastantes problemas con la letencia, pero el script que se muestra m\u00e1s abajo a mi em funciona bien sin latencia.<\/p>\n<p>Adem\u00e1s, con un poco de electr\u00f3nica simple y utilizando los pins GPIO se podr\u00eda cambiar f\u00e1cilmente el programa midi y poder escoger entre diferentes instrumentos: saxo, midi, flauta,&#8230;<\/p>\n<p>Otra posibilidad, como se ve en la fotograf\u00eda, es utilizar un sinte hardware com el <strong>Roland JV-1010<\/strong>. Como la entrada del JV-1010 es puramente midi se necesita un cable conversor <em>USB2MIDI<\/em> (por ej, http:\/\/www.amazon.com\/dp\/B0017H4EBG), que muestra sus puertos a ALSA. Con esta soluci\u00f3n no has de temer por la latencia, es una magn\u00edfica experiencia de usuario, y podemos escoger entre centenares de sonidos.<\/p>\n<p><strong>\/etc\/udev\/rules.d\/ewiusb.rules<\/strong><\/p>\n<blockquote><p>#\/etc\/udev\/rules.d\/ewiusb.rules<br \/>\nACTION==&#8221;add&#8221;, SUBSYSTEMS==&#8221;usb&#8221;, ATTRS{product}==&#8221;EWI-USB&#8221;, RUN+=&#8221;\/home\/pi\/ewiscript.sh&#8221;<\/p><\/blockquote>\n<p><strong>\/home\/pi\/ewiscript.sh<\/strong><\/p>\n<blockquote><p>#!\/bin\/sh<br \/>\n#\/home\/pi\/ewiscript.sh<br \/>\n#script que s&#8217;ha d&#8217;executar quan connectem el EWI-USB. Dos casos: a) synth hardware (roland); b) synth software (fluidsynth)<\/p>\n<p>#mirem si tenim connectat el cable usb-midi<br \/>\nif [ -z `\/usr\/bin\/aconnect -iol | grep USB2.0-MIDI | awk &#8216;\/client\/{print $1}&#8217;` ]; then<\/p>\n<p>#no est\u00e0 connectat: b) synth software (fluidsynth)<br \/>\nif [ -z `pidof -s fluidsynth` ]; then<br \/>\nscreen -d -m -S fluidsynth -t &#8220;fluidsynth&#8221; \/usr\/bin\/fluidsynth -a alsa -m alsa_seq -g 1 -c 4 -z 256 -r 48000  \/home\/pi\/Natural_Oboe.sf2<br \/>\n\/bin\/sleep 3<br \/>\n\/usr\/bin\/amixer set Master 40%+ &gt; \/dev\/null<br \/>\n\/bin\/sleep 2<br \/>\nFLUIDSYNTH=$(\/usr\/bin\/aconnect -o -l | awk &#8216;\/FLUID\/{print $2.&#8221;0&#8243;}&#8217;)<br \/>\n\/bin\/sleep 2<br \/>\n#echo $FLUIDSYNTH<br \/>\nEWIUSB=$(\/usr\/bin\/aconnect -o -l | awk &#8216;\/client\/&#8217; | awk &#8216;\/EWI-USB\/{print $2.&#8221;0&#8243;}&#8217;)<br \/>\n\/bin\/sleep 2<br \/>\n\/usr\/bin\/aconnect $EWIUSB $FLUIDSYNTH<br \/>\n\/bin\/sleep 2<br \/>\nfi<br \/>\nelse<br \/>\n#a) synth hardware (roland)<br \/>\nUSBMIDI=$(\/usr\/bin\/aconnect -o -l | awk &#8216;\/client\/&#8217; | awk &#8216;\/USB2.0\/{print $2.&#8221;0&#8243;}&#8217;)<br \/>\n\/usr\/bin\/aconnect EWI-USB:0 $USBMIDI<br \/>\n\/bin\/sleep 2<br \/>\nfi<\/p><\/blockquote>\n<p>M\u00e1s informaci\u00f3n, aunque en catal\u00e1n, en la <a href=\"http:\/\/wiki.joanillo.org\/index.php\/EWI-USB_amb_la_Raspberry_Pi\" title=\"wiki\">wiki<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para tocar el controlador de viento EWI-USB normalmente me conecto al port\u00e1til. Ejecuto el fluidsynth o cualquier otro soft sinte. Por tanto, la soluci\u00f3n para practicar es EWI-USB + port\u00e1til + auriculares. Existe una soluci\u00f3n m\u00e1s portable y aut\u00f3noma? Definitivamente s\u00ed utilizando la Raspberry Pi, buscando una soluci\u00f3n puramente consola y totalment desatendida: enchufar y [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[310,324,320,330,182,348],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=213"}],"version-history":[{"count":1,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}