buzz forums

forums of the buzz
It is currently Tue Jun 27, 2017 8:49 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: 13
https://github.com/zeffii/pyBLOK

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.

Code:
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))
    osc.set_params(tuning=freq)
    Connect(env1, osc, index=1)
    Connect(osc, out, index=0)
    oscillators.append(osc)

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


Image

There's a todo which may or may not happen: https://github.com/zeffii/pyBLOK/issues/2


Top
 Profile  
 
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:  
cron
Powered by phpBB® Forum Software © phpBB Group