spotlight on python
DESCRIPTION
Kiwi PyCon 2011, Wellington, Spotlight on Python by Nick Cave-Lynch, Spotlight on Python. Covers development and use of a Python-powered system designed for lighting bands in small venues. Covers (among other things): the problems of lighting bands; the development process; the results; lessons learned.TRANSCRIPT
![Page 1: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/1.jpg)
Spotlight on. Python
Python for realtime controlof stage lighting
Nic Cave-Lynch – Tymar Lighting
![Page 2: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/2.jpg)
The problem Current architecture Version 2 architecture DMX Engine RDDD (Rubber Duck Driven Development) Observations
Spotlight on. Python
![Page 3: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/3.jpg)
The problem
Lighting bands, typically in small-ish venues
DMX: 40 updates/second, 200-500 channels
Moving lights (HTP/LTP)
Music usually new to me
![Page 4: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/4.jpg)
'Busking' in 4 dimensions
![Page 5: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/5.jpg)
Enhance the music
![Page 6: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/6.jpg)
Enhance the show
![Page 7: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/7.jpg)
Current architecture
Mimic (wxPython)
asynchatsendsDMX
DMX engineHTP/LTP ->
channel value
Input wing:fadersbuttons
asynchatgathers
wing input
DMXgenerator
serial USB
trackball(fcntl)
capturetrackball
moving lightmanager
USB
![Page 8: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/8.jpg)
Version 2 architecture
Config UI / mimic
DMXgeneratorcontroller
DMXengine
Input wing:fadersbuttons
trackballs
Input wingcontroller
DMXgenerator
USB/serial/MIDI ZeroMQ
struct
ZeroMQprotocolbuffers
ZeroMQprotocol buffers
USB/serial/Wifi
ZeroMQ
struct
![Page 9: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/9.jpg)
DMX Engine
Engine()
– Holders for Valgens, Scenelets, Fixtures
– dispatches zmq messages from wing/UI
Valgens know which Scenelets they drive
Scenelet sends multiple of Valgen value to Fixture channels
Fixture has channel for each aspect of the light
– output function eg calculate pan/tilt values from (x,y,z)
Speed important:
– reduce lookups
– integer dict keys
– Valgen->Scenelet->Fixture single function call
– struct module
![Page 10: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/10.jpg)
RDDD
Architecture took ages Rubber Duck Driven Development "make something that doesn't work"
![Page 11: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/11.jpg)
Observations
Unit tests inhibit experimentation Deciding to Open Source can be an inhibitor Spoilt for choice in libraries/frameworks/etc.
Analysis paralysis
Surprising results in some performance areas struct module string/integer dict keys
I hate OpenOffice.org Impress 3.2: it's barely useable
![Page 12: Spotlight on Python](https://reader036.vdocuments.us/reader036/viewer/2022081514/558fcac01a28ab02398b45f0/html5/thumbnails/12.jpg)
For more live Python action
200 metres from dinner venue:
● Left out of Tulsi
● 20 metres to Guznee St
● Right up Ghuznee St
● One block up
● Straight over traffic lights
● Bodega is on the left