Integrations

In the labs we've been looking at systems in something like a clean environment, which made it easier to explore their properties, capacities, and constraints quickly and facilitate rapid prototyping and design. However ultimately you may want to translate these models into other software environments -- perhaps to leverage the increased performance of native C++ or GPU programming, or perhaps in order to integrate with other elements of interaction and display for the final work. I'll be exploring a few examples of this translation into different platforms here.

Cellular systems using Max/MSP/Jitter's jit.gen or jit.gl.pix

There are a few ways to run CAs within Jitter (there's even a [jit.conway] object), but these days I would strongly recommend using jit.gen or jit.gl.pix over all other options. Use jit.gen if you want to work on jitter matrices (i.e. on the CPU) -- jit.gen will be significantly faster than patching things any other way. Use jit.gl.pix if you want to run the simulation on the GPU, purely using OpenGL textures -- this is probably the fastest option available if you have a decent graphics card.

Note that you can also export jit.gen code as C++, and jit.gl.pix code as a GLSL fragment shader, so it is also possible (with a bit of glue) to prototype things in Max and then embed them in another application.

Here is the canonical Game of Life implemented in jit.gl.pix -- notice how we can run this at far higher resolutions and still get a good frame rate:

Note, to open this in Max, select all the compressed patcher code below and copy it to the clipboard, then in Max choose File -> New from Clipboard.


----------begin_max5_patcher----------
3180.3oc2ckzaiiiE9ryuBBeppoSkQbSKClpmEfFCFfAyk5vbnPi.YKZGVkr
jgjbpTci9+9vM4Hm3EpHZVx9hbDkD0688V3iO9DyueyjoyJehUOE7W.eFLYx
ueyjIpljMLwb9joqReZddZs51lNub0JVQyza0Wqg8Tip8pMEssU278blpw1V
J1rhWjyZTcAzz35JVsnmRa3kE2Wwl2nICHL3N5sfP3cA2BBLG.+5y8T4ll1t
JnsqRal+.uX4d5FjrGBU8CpaGwyTTX4ru7AbvTYa+wM2HOb6PABAW0zSnvZt
BCirkqPItjq9WoqXfxEf+CeACvK.eg2b2x76Vyep8VWTVzTy+ME2hH2EzODP
9zEh2g5N+GU7zbv+rLOC7uaRy4ym1WbBozdDfk3HFRU+fO.NE4RbZAOOGTOu
hwbj4.MvP8jgYOPnIp9IIV9SB7npNDmBILVFXV57uBDr3i7xM0fZAax.uKqb
yrbFX1lEKXUuu8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mOarxo
zgISgnnNbp5rwJmhGp1qhSIvmOazxoCT6MHoKmJOarxoH5.0doc3T0YiV6zg
wo57aYLSkmLV4y3XGvmFA5O.9DZabVgim4MDF1GZFMNnYqGIez.yv9fxiinY
CsMieJUnQhlAtOz7HAmsMaCgiG04PZev4QhIn0d5FOYozdcCzEHMOdlEbnsY
0Ib7jsgPXen4wANSrFmCFOYcO5xiloWf3L8BDmQ39PyiCaPTzkGMiuDoYzkG
MS60pHMRnYbeVgwQx3f39rJ+iDZNtOqX9HwFLtOUsxHgl6UEMMRFSItOqJ5H
glI8YEFGIyg01wAgtZd2fe8lmaQczTHe6VDeJh9UrilU1Caril6gXgctmWQ8
ulxMT2s8mbh6FP4gHGj2nGTv3BdhrfbdAMe1EWnSAOQ9kdBFQzCwF5I1eziM
jyoTmewJ9fZ+2PBQ+g.nJtfcOq8iy0rQuKO6YhvcLGzRaUnebcXimLuI4swv
.MpzCwuQpQOjX550OxppMcohPltJ8KkUxSitUcJuPeppT7mJ++4U68qdGSSq
l+.ugMW9e0KU8z+Tb3T8iVlwpJ1vUO8Mx27eby+mJx5n0
-----------end_max5_patcher-----------

And here's a version that works over jitter matrices (rather than jitter textures) -- this is useful if you want to keep all the work on the CPU rather than on the GPU:


----------begin_max5_patcher----------
2521.3oc4cszbihqEdsyuBUd6jjB8BvS0cOyrX1d2L2plE8LUJrQ1ltwHWfH
I8cp4+9UO.Gv1XDwAGkxKhSgDBNmOcdi.8O2LY5b9yrhofeF7UvjI+yMSlna
R0vjpimLcSzyKRiJzm1zE7MaXYho2Z5SvdVna+SeBjx4eGjjAVyxY08mljwV
vKyzmDppwrxM7RQJSnujdUstMmUHuxQhDd1C4rEBCYglQt26V.hfT+yq5Gve
WOpHwh0IYqZLBnWndDgAp+4qGNF2XLIwZRlO+a2g7pozBwORY51m9BYljUSk
PUa+6M2n941yDqJKjDL3aIh62DIxSdF7ThXMPrlAJh1v.YpeVjyhDrBPDXIi
EOOZw2U361ihqguFbEFN6dpBWIViq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.AkW9xSnWW1G+SNflVU8ebzofWlundtt9k5GzlriYEB0qVR02Pgu9xBkcuSb
cRbLKaezJNoP8caH194xgRyGgTNNMSbFRV81ZZGICcGZNvRZ9HL26FMaqnQX
fyPyg1hyp2ASqn4MIwa4IYhh5EpKs5Mqfp7ps6f12R2gOUI9cF7IzOrAipOx
U4T74woHJpAmpOxY4TuyhSwx.MdgS0G4pbJ4b4Tn4EH6kibVN8bkdwM3T8Qt
JmROu4TXfWCNUejyxoz2.eLUL56fOli35nCeLJ.A5D9+w1RyXGhl8rklQNCM
SrklINDMaqrAwcjMn1hyT2Amo1hyT2AmOR5.cXqC6N3rs9gTulWtBMGNDYC2
HmRJ5CHNiGhcC2.mIe.kmIgCwmhifye.kmI3gDugafy3AgyNBMiGRrnNBMG7
ADmCGRdJtAMi9.hynvgjCqiPy3Of3LYHwO6HO5KxPdbcH2flwCglcCe291lC
qu67LFsmlQe.oY244h5acLRtSd29vgPyuE3L3uu4kVdi1jwxK6Xagwq6c6EL
x7TFPu7ESq4R54nudMWxMNM0mhawf4JHIvVtBMl6ZYyKEBd1a8NWkYE5YXNy
mvs.ZGaOWj2mMnnLdRASpauLkGIvH.zGr6KW93ssrYdOwfUKLst1V1PiHjH3
qVkxF37ch5qdX+aTY1LeuaKmaaj56Upfk+fYahoo9x.3a88n85ox.C6afsBL
5Yg8z0BjoUD8GZP8PioGLsXM8DZA83ewHGanlfKF0D3TXCwBpgdwnFpMxwvK
F43aA4PtbZU1LWsmo.6oGiQn81L3TjxdaBb6sAvc3l+V2a7a6uouIuy+6M+e
.sKPlF.
-----------end_max5_patcher-----------

Some more examples by Jer Stewart here

Evolutionary audio in Max/MSP using gen~

The [gen~] object is similar to jit.gen in that it lets you define algorithms that are dynamically compiled to native code; however the gen~ patcher's job is to calculate the next audio sample. It allows you to get quite low-level with signal processing without leaving the patching world, nor losing efficiency. Also like jit.gen, all the patching in gen~ has an equivalent code representation, which you can view by opening the "C" tab at the side. So you can mix visual and text-based algorithms.

Moreover, we can also send strings of this textual code to a gen~, and it will load them & run. That means we can explore meta-programming new audio algorithms! And, since Max has support for JavaScript, we can re-use a lot of our evolutionary programming code in Max.

You can grab an example of this from here

This example is similar to Dave Griffiths' Fastbreeder, which applies GP to audio signals.

Important note: it is entirely possible generate some quite damaging audio signals when creating randomized signal graphs. For example, 1000*sin(time) will blow up speakers if no limiting is applied. Before listening to any of these signals, make sure they are being passed through some operation that will limit their range between -1 and 1, such as using sine(), tanh(), some sigmoid function, or at the very least, clipping/wrapping.

For more info on gen~, take a look at some tutorial information here