buzz forums

Page 1 of 1

Author:  zeffii [ Wed Jun 01, 2016 8:31 am ]
Post subject:  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.

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:

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group