Controller 001 alpha

by Ariel Malka

Controller is a versatile input provider, it comes through the form of a popup window with a set of interactive user-interface components. It can be used within any Java application, including Processing.

demo 1  |  demo 2  |  demo 3

If you have some unanswered questions or wish to send some feedback, you can post to this thread in the Processing forums. If you find a typo or have some personal comments, please contact the author.

Features

A controller with its default set of components, featuring (from left to right):

- 3 horizontal sliders
- 1 vertical slider
- 1 arcball (aka trackball)
- 3 spinners
- 6 toggle buttons

Once a Controller has been created, it is possible to interact with its components and to get access to their properties from the host application. There is also a simple event managing system for being notified whenever a component has changed.

How to include Controller into Processing

The first thing to do is to download controller.jar (~29K) which contains the required Java classes. Then, each time you want to add Controller to one of your sketches: go the the "Sketch" menu, choose "Add file...", and add "controller.jar".

Controller will work both inside the Processing environment (version 066+) and with exported applets. It has been tested successfully to work both with sun and microsoft JVMs on windows, and seems to be tolerated by macs too.

Minimal usage

Following is a very simple Processing example that use Controller:

Controller controller;

void setup()
{
  controller = new Controller(this, "hsliders: 1");
}

void loop()
{
  background(controller.hsliders.get(0).getValue() * 255);
}

launch example

A new Controller object (containing only one horizontal slider) is instantiated inside setup(). Sliders by default are producing floating point values between 0 and 1: inside loop(), we access the value of the slider and multiply it by 255 to produce a value between 0 and 255 that is then applied to the background color.

Reference

Examples

About

The main motivation behind Controller is pedagogical: providing an additional input source that doesn't require much efforts to be deployed. It is part of a bigger project (without a specific name yet) that will propose modular programmable environments integrated into web pages.

Controller has been programmed in Java, using custom AWT components. It could easily be extended into a more modular version where the control over the number of components and their layout is more flexible. Additional components could also be developped to extend the current set.

The look & feel is inspired by the RANE Empath mixer (Original Electric Blue version).

Source Code

Controller's source-code is available here. It's free to use, providing the terms of this creative commons license are fully understood and accepted.

top  |  bagel papa poule : tookit