{"id":211,"date":"2013-07-02T23:06:46","date_gmt":"2013-07-02T21:06:46","guid":{"rendered":"http:\/\/www.joanillo.org\/?p=211"},"modified":"2020-09-15T23:08:22","modified_gmt":"2020-09-15T21:08:22","slug":"solucio-portatil-per-a-un-saxo-electronic-raspberry-pi-soft-o-hard-sinte","status":"publish","type":"post","link":"https:\/\/www.joanillo.org\/?p=211","title":{"rendered":"Soluci\u00f3 port\u00e0til per a un saxo electr\u00f2nic: 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>Per tocar el controlador de vent <strong>EWI-USB<\/strong> normalment em connecto al port\u00e0til. Faig c\u00f3rrer el fluidsynth o qualsevol altre soft synth. Per tant, la soluci\u00f3 per practicar \u00e9s EWI-USB + port\u00e0til + auriculars. Existeix una soluci\u00f3 m\u00e9s portable i aut\u00f2noma? Definitivament s\u00ed utilitzant la <strong>Raspberry Pi<\/strong>, buscant una soluci\u00f3 purament consola i totalment desatesa: enxufar i tocar. En aquesta ocasi\u00f3 no utilitzo JACK, \u00e9s una soluci\u00f3 purament <strong>ALSA<\/strong>. Es tracta d&#8217;instal\u00b7lar el <strong>fluidsynth<\/strong>, algun soundfont que soni b\u00e9 i que no pesi massa, configurar l&#8217;usuari <em>pi<\/em> amb prioritat realtime, i desinstal\u00b7lar qualsevol servei que no hagi de fer servir.<\/p>\n<p>Amb un script a <em>\/etc\/udev\/rules.d\/ewiusb.rules<\/em> aconseguim que en el moment que connecto el EWI-USB pel port USB s&#8217;executin les comandes que em permetran tocar autom\u00e0ticament: executar fluidsynth i connectar la sortida midi del EWI-USB a l&#8217;entrada midi del fluidsynth. He tingut bastants problemes per tal de no tenir lat\u00e8ncia, per\u00f2 el script que es d\u00f3na m\u00e9s avall a mi em funciona b\u00e9 sense lat\u00e8ncia.<\/p>\n<p>A m\u00e9s, amb una mica d&#8217;electr\u00f2nica senzilla i utilitzant els pins GPIO es podria canviar f\u00e0cilment el programa midi i poder triar entre diferents instruments: saxo, midi, flauta,&#8230;<\/p>\n<p>Una altra possibilitat, com es veu a la fotografia, \u00e9s utilitzar un sinte hardware com ara el <strong>Roland JV-1010<\/strong>. Com que l&#8217;entrada del JV-1010 \u00e9s purament midi es necessita un cable conversor <em>USB2MIDI<\/em> (per ex, http:\/\/www.amazon.com\/dp\/B0017H4EBG), que mostra els seus ports a ALSA. Amb aquesta soluci\u00f3 no has de t\u00e9mer per la lat\u00e8ncia, \u00e9s una magn\u00edfica experi\u00e8ncia d&#8217;usuari, i podem triar entre centenars de sons.<\/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\u00e9s informaci\u00f3 a 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>Per tocar el controlador de vent EWI-USB normalment em connecto al port\u00e0til. Faig c\u00f3rrer el fluidsynth o qualsevol altre soft synth. Per tant, la soluci\u00f3 per practicar \u00e9s EWI-USB + port\u00e0til + auriculars. Existeix una soluci\u00f3 m\u00e9s portable i aut\u00f2noma? Definitivament s\u00ed utilitzant la Raspberry Pi, buscant una soluci\u00f3 purament consola i totalment desatesa: enxufar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,16,12,22,5,10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/211"}],"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=211"}],"version-history":[{"count":1,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=\/wp\/v2\/posts\/211\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joanillo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}