buzz forums

forums of the buzz
It is currently Mon Jun 25, 2018 2:01 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: pyBLOK
PostPosted: Wed Jun 01, 2016 8:31 am 

Joined: Thu Dec 08, 2011 8:15 pm
Posts: 15

Here's a small set of python functions to create BLOK patches (.blkx) programmatically. Conceptually similar in some ways to SuperCollider or Chuck, declaring a node tree via code has the potential to take some of the tedium from otherwise complex trees. At the same time it is convenient to have the ability to drag sliders on a UI to play with the parameters afterwards.

pyBLOK doesn't talk directly to any BLOK instance, instead it writes .blkx files to disk at a given path.

from blok_functions import Connect, pBlk, pCompile

out = pBlk('Mono.Out', (320, 110))

env1 = pBlk('Env.basic', (30, 110))
env1.set_params(attack=0.08, decay=0.45, release=0.6)

oscillators = []
for freq, y in zip([0, 0.5, 1], [120, 200, 280]):
    osc = pBlk('Osc', (170, y))
    Connect(env1, osc, index=1)
    Connect(osc, out, index=0)

pCompile(path=r'C:\Users\zeffi\Desktop\fluxo3.blkx', silent=0)


There's a todo which may or may not happen:

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group