Luz is a music visualization studio for VJs and creative couch potatoes. It’s free and open source.
Luz can use any combination of Wiimotes, Wacom Tablets, MIDI keyboards and sliders/knobs, gamepads and joysticks, and laptop touchpads (as X/Y pads) to create any sort of interactive visual toy you want. Hand the devices to your friends, attach them to music instruments, gather around the screen (or projector!) and jam.
Luz can use all of OpenGL’s features, and lets you connect any device input to any effect setting.
Luz is getting quite mature and has already been used for many house parties, live shows at the Hawthorn Theatre, and at Reed College’s end-of-year campus party, Renn Fayre.
And now it’s way easier to get started!
Introducing the Luz Input Manager
Luz Input Manager automatically detects all your USB devices and supports one-click Wiimote association. It reads input from any number of devices and sends them over to Luz (either the studio or a live fullscreen show).
What’s more, it sends them via UDP, and can broadcast them over your local network*. This lets you run Luz Input Managers on multiple computers on your network and hook up devices however is most convenient to you. You could run it on two laptops, using one touchpad with each hand (in absolute X/Y mode– very high resolution, precise and expressive), and have all the input data sent to a single version of Luz running on either computer. Or they could drive multiple versions of Luz, perhaps driving multiple projectors… there really are no limits here.
With the completion of the Luz Input Manager, which replaces a bunch of kludgey-but-functional command-line mini-apps (each reading and broadcasting for one device), the whole Luz experience is now 100% point-and-click! Yeah!! (Finally!!!)
Calling all Package Managers!!
I think it’s time to create .DEB, .RPM, and other distro packages for Luz. If you’re interested in creating packages, please get in touch and I’ll be happy to help you any way I can => ian at openanswers dot org
(For any interested linux coders.)
Luz Input Manager is written in C++ and uses Gtk+ via GtkMM.
It uses libwiimote to talk to Wiimotes (which are standard bluetooth devices).
PortMIDI for MIDI.
XInput for Wacom Tablets.
It uses SDL for joysticks/gamepad support. It would seem that XInput should work for this but some gamepads don’t seem to show up there..?
Touchpad data is read directly from the driver using the SHMConfig shared-memory feature of the driver. This is another candidate for XInput if I can get it to report touchpad data in absolute coordinates (as opposed to relative, like a mouse, which is how it’s normally used).
Each device is handled in a separate thread (using pthreads). I’m not convinced this is totally necessary but some types of input (specifically XInput) don’t seem to have a workable non-blocking API for reading events. The Gtk+ GUI is handled in the main thread.
One mutex was necessary to serialize the send() methods of the output stream, which uses liblo to send OpenSoundControl messages (via UDP). Without the mutex I was seeing a race condition crasher. (Problems were to be expected as they were sharing an snprintf to stack memory! heh).
It also uses libunique to prevent multiple application instances on the same computer, which also made it easier to launch the Input Manager directly from the Luz Studio: just fire and forget, and if it’s already running, the existing process gets a message via libunique (actually via D-Bus) and presents itself to the user.
Future plans include:
- picking up new devices as they’re plugged in (currently requires a restart to pick up new devices),
- perhaps (optionally?) perpetually scanning for new wiimotes (or for lost ones, such as an accidentally disassociated one during a live performance),
- perhaps adding blinky lights to show device activity,
- perhaps adding extra device-type-specific features, like the ability to ‘buzz’ a wiimote (using its rumble capability) as a way to get the attention of a remote wiimote-wielding performer
- somehow allow for re-plugging of accidentally disconnected gamepads, something SDL doesn’t handle well
- adding a GUI checkbox for broadcast-to-LAN*
(* requires liblo 0.25 or higher to work, and is presently disabled until I figure out how best to test for that condition in the Makefile or code)