{"id":89,"date":"2010-01-23T17:12:48","date_gmt":"2010-01-23T22:12:48","guid":{"rendered":"http:\/\/lazytrap.com\/?p=89"},"modified":"2020-06-13T02:22:48","modified_gmt":"2020-06-13T07:22:48","slug":"pybuzz-scripts-various","status":"publish","type":"post","link":"http:\/\/www.lazytrap.com\/trapped\/?p=89","title":{"rendered":"PyBuzz scripts (various)"},"content":{"rendered":"<p><a href=\"http:\/\/www.lazytrap.com\/img\/pybuzz.png\" rel=\"lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" style=\"margin: 7px;\" title=\"PyBuzz\" src=\"http:\/\/www.lazytrap.com\/img\/pybuzz.png\" alt=\"\" width=\"101\" height=\"159\" \/><\/a>I&#8217;ve put together a collection of\u00a0some PyBuzz scripts I have created over the past few years (most from 2005-2006).\u00a0 A few others are included as well by Dukajoe (PyDrum) and Kazuya. One or two the scripts might not work in the latest version of PyBuzz, but the code is still relevant so I&#8217;ve included everything in this zip I could put together.<\/p>\n<p><a href=\"http:\/\/www.lazytrap.com\/files\/lazytrap_pybuzz_scripts.zip\">lazytrap_pybuzz_scripts.zip<\/a><\/p>\n<p>PyBuzz is a native meta-controller of sorts\u00a0written by Leonard Ritter for the modular audio application Jeskola Buzz. It the Buzz world, these control\u00a0signal-type modules\u00a0and their data are\u00a0commonly referred to as Peer Controllers or Control Machines. PyBuzz is basically an empty shell of a machine that gives a Python scripter access to\u00a0the Peer\u00a0interface, making it\u00a0possible to integrate custom\u00a0Python scripts\u00a0in order\u00a0to control, react, or automate other \u00a0machines within\u00a0a Buzz project.<\/p>\n<p>Below is an example of one of the more\u00a0complete and useful scripts in the .Zip. It&#8217;s called master&amp;servant and the principle is pretty simple. You assign\u00a0Master and Slave \u00a0targets then control it with the Master parameter slider. Anytime the value of\u00a0 Master goes above the Threshold, the Master parameter slider will begin to\u00a0also control the Slave target.<\/p>\n<p><!--more--><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#\r\n# master &amp; servant 1.0\r\n#\r\n# assign a slave and master (gen, effect, vst, whatever). Do not assign\r\n# anything to THRESHOLD (at least not until u understand whats goin on).\r\n# When the value of master (1-byte) goes above the threshold value (2-byte)\r\n# the value of the slave (0-byte) will rise accordingly.\r\n#\r\n#\r\n\r\nfrom buzz import *\r\n\r\nthresh=80\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0             #default threshold value \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\nSendPeerCtrlChange(2,1,thresh)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #set default threshold\r\n\r\ndef mMAX(num):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mach = GetPeerCtrlTarget(num)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tar = mach&#x5B;2]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 y = GetMachineInfo (mach&#x5B;0])\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 z = UnpackMachineInfo(y)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 m = z&#x5B;10]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #realname\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 p = z&#x5B;7]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #paramlist\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 named = GetMachineName(mach&#x5B;0])\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mac = p&#x5B;tar]&#x5B;4]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pnamed = p&#x5B;tar]&#x5B;1]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return (mac, pnamed)\r\n\r\ndef servant(track,index,value):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 results = mMAX(0)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 max = results&#x5B;0]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pname = results&#x5B;1]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 diff = float(max \/ 128.0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 value = value * diff\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SendPeerCtrlChange(track,index,value)\r\n\r\ndef master(track,index,value):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 results = mMAX(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 max = results&#x5B;0]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pname = results&#x5B;1]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 diff = float(max \/ 128.0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 value = value * diff\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SendPeerCtrlChange(track,index,value)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\ndef OnParameter(track,index,value):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 global thresh\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (index == 1 and track == 0):\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (value &lt; thresh): servant(0,1,0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 servant(track,index,value) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (index == 1 and track == 1):\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (value &gt; thresh): servant(0,1,value)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (value &lt; thresh): servant(0,1,0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 master(track,index,value)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (index == 1 and track == 2):\u00a0thresh = value\r\n\r\nSetEventTarget(&quot;OnParameter&quot;,OnParameter)\r\nSetPeerCtrlName(0,&quot;Slave&quot;)\r\nSetPeerCtrlName(1,&quot;Master&quot;)\r\nSetPeerCtrlName(2,&quot;Threshold&quot;)\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve put together a collection of\u00a0some PyBuzz scripts I have created over the past few years (most from 2005-2006).\u00a0 A few others are included as well by Dukajoe (PyDrum) and Kazuya. One or two the scripts might not work in the latest version of PyBuzz, but the code is still relevant so I&#8217;ve included everything\u2026 <span class=\"read-more\"><a href=\"http:\/\/www.lazytrap.com\/trapped\/?p=89\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":597,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,38,33,6],"tags":[44,43,41,42],"jetpack_featured_media_url":"http:\/\/www.lazytrap.com\/trapped\/wp-content\/uploads\/2020\/06\/download-1.jpg","_links":{"self":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/89"}],"collection":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89"}],"version-history":[{"count":31,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":610,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/89\/revisions\/610"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/media\/597"}],"wp:attachment":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}