Art python
October 19, 2015 — July 27, 2018
Python: How to make it do pretty things.
See controller mapping for human-centric interaction design.
1 Pro-tips
1.1 Pro-tip: run your python code as a web service
Web services are the new reliable lingua franca, and have a lot of development time sunk into them, so even if you, as I do, hate the web, you may as well steal their labour.
Python + tornado
+ ProcessPoolExecutor
is reasonably performant.
You will probably need FRP to make it interactive in this case.
1.2 Pro-tip: embed your javascript audio/video in python notebooks
Look! the heady mix of excellent realtime and non-real-time performance in a semi-pro interactive IDE! Get amongst it. I wrote some tips for Jupyter GUIS elsewhere
I will use this to prototype amazing music using python machine listening, I hope. But GUIs are my least favourite thing, so it will be slow going even on this easy terrain.
2 Audio
See Audio python
3 Video/graphics
The graphing can be OK too — see graphing in python.
3.1 colormotor sandbox
colormotor_sandbox, live-reloading CV+video framework:
Colormotor is a creative coding framework with a “scientific twist”. The framework builds on top of Armadillo for linear algebra operations, OpenCV for image manipulation and OpenGL for hardware accelerated rendering.
Armadillo is definitely not the fastest or most lightweight solution for a graphics-oriented framework. On the other hand, the library provides many utilities that make it easy to switch between C++, Python and Matlab, and vectorised operations result in much more concise code.
Python Bindings
Colormotor includes Python bindings that can be used independently as a module, or within the Colormotor Sandbox live coding environment.
3.2 Field
field (github) describes itself as
an open-source software project initiated by OpenEndedGroup, for the creation of their digital artworks. It is an environment for writing code to rapidly and experimentally assemble and explore algorithmic systems. It is visual, it is hybrid, it is code-based. We think that it has something to offer a diverse range of programmers and artists.
It seems to be rarely updated (2 years old at time of writing) and based on Jython/JVM so you can’t use cpython conveniences like numpy.
slider1= sheetSlider("slider1")
xySlider2 = sheetXY("xySlider2")
aGraph = sheetGraph("aGraph")
print slider1.get()
print xySlider2.get()
print aGraph.get().get(0.2)
slider1.set(0.5)
xySlider2.set( (0.2, 0.6))
GUI toolkit looks good (Java-based). OpenGL and other drawing functionality seem advanced. Audio does not seem to be a priority.
3.3 Plotdevice
A sprout off the gone-to-seed1 NodeBox is PlotDevice, which is a designerly python app for making printable graphics. It is cousin to the more famous Processing language, which is itself seedy.
3.4 Art apps with a python API
- Drawing app Krita includes a Python API, python 3+ PyQT
- DTP app Scribus includes a Python API, albeit a reputedly quirky one which is AFAICT Python 2.
- 3d app Blender does python
- one of those VJ apps does too. Modul8, I think?
Footnotes
Nothing wrong with going to seed; It’s perfectly lovely software, just a bit overgrown, and it has lost that fresh tang.↩︎