{"id":1658,"date":"2018-05-23T22:56:47","date_gmt":"2018-05-23T20:56:47","guid":{"rendered":"http:\/\/yarogniew.net\/arduino\/?p=1658"},"modified":"2018-06-07T19:30:15","modified_gmt":"2018-06-07T17:30:15","slug":"pyo-muzyczna-biblioteka-dla-pythona","status":"publish","type":"post","link":"https:\/\/arduino.net.pl\/index.php\/pyo-muzyczna-biblioteka-dla-pythona\/","title":{"rendered":"PYO &#8211; muzyczna biblioteka dla Pythona"},"content":{"rendered":"<p>Pyo to \u015bwietna biblioteka muzyczna Python-a stworzona przez kanadyjsk\u0105 firm\u0119 AJAX STUDIO. Podobno najlepsza do tworzenia skrypt\u00f3w DSP. Od kilku dni j\u0105 przegl\u0105dam i m\u00f3j zachwyt jest coraz wi\u0119kszy.<\/p>\n<p><strong>Spis tre\u015bci:<\/strong><br \/>\n<a href=\"#pyo_midi\">Prosty monitor Midi<\/a><br \/>\n<a href=\"#pyo_tables\">PYO Tables<\/a><br \/>\n<a href=\"#pyo_randi\">Randi, Mix, Biquad<\/a><br \/>\n<a href=\"#pyo_linki\">Linki<\/a><\/p>\n<h4>Oscylator sinusoidalny<\/h4>\n<p><strong>Sine(self, freq=1000, phase=0, mul=1, add=0)<\/strong><br \/>\n<strong>freq<\/strong> &#8211; Frequency in Hertz. Sampled at audio-rate.<br \/>\n<strong>phase<\/strong> &#8211; Phase in radians. Sampled at audio-rate.<br \/>\n<em>NOTE: phase values should be within the range +-8pi. If your phase values are larger then simply use .mod(2pi) to wrap them.<\/em><br \/>\n<strong>mul<\/strong> &#8211; Output will be multiplied by this value.<br \/>\n<strong>add<\/strong> &#8211; This value will be added to the output.<\/p>\n<p><strong>Zaczynamy od prostego oscylatora z modulacj\u0105 i ADSR<\/strong><\/p>\n<pre class=\"brush: python; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\r\nfrom pyo import *\r\n\r\ns = Server().boot()\r\nmod = Sine(freq=6, mul=50)\r\nf = Adsr(attack=.9, decay=.2, sustain=.8, release=2, dur=7, mul=.5)\r\na = Sine(freq=mod + 440, mul=f).out()\r\nf.play()\r\ns.start()\r\ns.gui(locals())\r\n<\/pre>\n<p><strong>Poni\u017cej m\u00f3j pierwszy syntezator oparty o modu\u0142y ChenLee i Lorenz-a (cokolwiek to znaczy)<\/strong><\/p>\n<pre class=\"brush: python; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\r\n#!\/usr\/bin\/env python\r\n# encoding: utf-8\r\n&quot;&quot;&quot;\r\nControl window.\r\n\r\nThe ctrl() method (defined in PyoObject) shows a slider window\r\nwith which the user can set the value of the object's attributes.\r\nIf an audio object is given at a particular argument, the attributes\r\nwill not appear in the ctrl window.\r\n\r\n&quot;&quot;&quot;\r\nfrom pyo import *\r\n\r\ns = Server(duplex=0).boot()\r\ns.start()\r\n\r\na = ChenLee(pitch=0.001, chaos=1, stereo=True, mul=.5, add=.5)\r\nb = ChenLee(pitch=1, chaos=a, mul=.5)\r\n\r\nc = Lorenz(pitch=.003, stereo=True, mul=.2, add=.2)\r\nd = Lorenz(pitch=&#x5B;.4, .38], mul=c).out()\r\n\r\na.ctrl(title=&quot;ChenLee A&quot;)\r\nb.ctrl(title=&quot;ChenLee B&quot;)\r\nc.ctrl(title=&quot;Lorenz A&quot;)\r\nd.ctrl(title=&quot;Lorenz B&quot;)\r\n\r\nb.out()\r\n\r\ns.gui(locals())\r\n<\/pre>\n<p><strong>Program wypisuje aktualne wej\u015bcia i wyj\u015bcia MIDI, po wybraniu portu wypisuje numer i warto\u015b\u0107 kontrolera. \u0179r\u00f3d\u0142o: <a href=\"https:\/\/github.com\/belangeo\/pyo\/blob\/master\/examples\/utilities\/02_midi_ctl_scan.py\">02_midi_ctl_scan.py<\/a><\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/yarogniew\/0303edbca496cbd0a959312cc4b261d9.js\"><\/script><\/p>\n<p><a name=\"pyo_midi\"><\/a><br \/>\n<strong>Prosty monitor Midi<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/yarogniew\/6909e43f1d8f2f9174de3963b6781e2b.js\"><\/script><\/p>\n<p><a name=\"pyo_randi\"><\/a><br \/>\n<strong> Randi, Mix, Biquad <\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/yarogniew\/113e2d2da30ad025050ba3adad3383be.js\"><\/script><br \/>\n<a name=\"pyo_tables\"><\/a><\/p>\n<p><strong> Tables <\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/yarogniew\/ece187ed08b56605691c321443ed9304.js\"><\/script><br \/>\n<a name=\"pyo_linki\"><\/a><\/p>\n<p>Linki:<\/p>\n<p><a href=\"http:\/\/ajaxsoundstudio.com\/pyodoc\/index.html\">pyo 0.9.0 documentation<\/a><br \/>\n<a href=\"http:\/\/ajaxsoundstudio.com\/pyodoc\/tutorials\">Pyo tutorials<\/a><br \/>\n<a href=\"http:\/\/ajaxsoundstudio.com\/pyodoc\/gettingstarted.html\">Pyo getting started<\/a><br \/>\n<a href=\"http:\/\/ajaxsoundstudio.com\/pyodoc\/api\/classes\/controls.html#\">Pyo doc. controls<\/a><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"9XefsvkLX6\"><p><a href=\"http:\/\/ajaxsoundstudio.com\/software\/pyo\/\">PYO<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/ajaxsoundstudio.com\/software\/pyo\/embed\/#?secret=9XefsvkLX6\" data-secret=\"9XefsvkLX6\" width=\"600\" height=\"338\" title=\"&#8220;PYO&#8221; &#8212; AJAX SOUND STUDIO\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pyo to \u015bwietna biblioteka muzyczna Python-a stworzona przez kanadyjsk\u0105 firm\u0119 AJAX STUDIO. Podobno najlepsza do tworzenia skrypt\u00f3w DSP. Od kilku dni j\u0105 przegl\u0105dam i m\u00f3j zachwyt jest coraz wi\u0119kszy. Spis&#8230;<\/p>\n","protected":false},"author":3,"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":[65,64,59],"tags":[62,61,55,29],"class_list":["post-1658","post","type-post","status-publish","format-standard","hentry","category-programowanie","category-pyo","category-python","tag-muzik","tag-pyo","tag-sound","tag-syntezator"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/comments?post=1658"}],"version-history":[{"count":27,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1658\/revisions"}],"predecessor-version":[{"id":1726,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1658\/revisions\/1726"}],"wp:attachment":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media?parent=1658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/categories?post=1658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/tags?post=1658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}