PyBuzz scripts (various)

By | January 23, 2010

I’ve put together a collection of some PyBuzz scripts I have created over the past few years (most from 2005-2006).  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’ve included everything in this zip I could put together.

lazytrap_pybuzz_scripts.zip

PyBuzz is a native meta-controller of sorts written by Leonard Ritter for the modular audio application Jeskola Buzz. It the Buzz world, these control signal-type modules and their data are commonly referred to as Peer Controllers or Control Machines. PyBuzz is basically an empty shell of a machine that gives a Python scripter access to the Peer interface, making it possible to integrate custom Python scripts in order to control, react, or automate other  machines within a Buzz project.

Below is an example of one of the more complete and useful scripts in the .Zip. It’s called master&servant and the principle is pretty simple. You assign Master and Slave  targets then control it with the Master parameter slider. Anytime the value of  Master goes above the Threshold, the Master parameter slider will begin to also control the Slave target.

#
# master & servant 1.0
#
# assign a slave and master (gen, effect, vst, whatever). Do not assign
# anything to THRESHOLD (at least not until u understand whats goin on).
# When the value of master (1-byte) goes above the threshold value (2-byte)
# the value of the slave (0-byte) will rise accordingly.
#
#

from buzz import *

thresh=80                                       #default threshold value         
SendPeerCtrlChange(2,1,thresh)         #set default threshold

def mMAX(num):
         mach = GetPeerCtrlTarget(num)
         tar = mach[2]
         y = GetMachineInfo (mach[0])
         z = UnpackMachineInfo(y)
         m = z[10]          #realname                          
         p = z[7]          #paramlist                          
         named = GetMachineName(mach[0])
         mac = p[tar][4]
         pnamed = p[tar][1]
         return (mac, pnamed)

def servant(track,index,value):
         results = mMAX(0)                          
         max = results[0]
         pname = results[1]
         diff = float(max / 128.0)
         value = value * diff                 
         SendPeerCtrlChange(track,index,value)

def master(track,index,value):
        
         results = mMAX(1)                          
         max = results[0]
         pname = results[1]
         diff = float(max / 128.0)
         value = value * diff                 
         SendPeerCtrlChange(track,index,value)
        
def OnParameter(track,index,value):
         global thresh
        
         if (index == 1 and track == 0):        
                 
                  if (value < thresh): servant(0,1,0)                   servant(track,index,value)          if (index == 1 and track == 1):                           if (value > thresh): servant(0,1,value)
                 
                  if (value < thresh): servant(0,1,0)
                  master(track,index,value)
         if (index == 1 and track == 2): thresh = value

SetEventTarget("OnParameter",OnParameter)
SetPeerCtrlName(0,"Slave")
SetPeerCtrlName(1,"Master")
SetPeerCtrlName(2,"Threshold")

 

Leave a Reply

Your email address will not be published.