From TouchDesigner Documentation
Jump to: navigation, search


Firmata is an Arduino sketch aloowing for configuration and control of the Arduino using messages formatted as MIDI. A good introduction can be found here:

PythonIcon.pngPalette:firmata Ext

Parameters - Firmata Page

Help Help - Opens this page.  

Version Version - THe current version of this component.  

Firmata Type Firmatatype - The installed firmata type as reported by the arduino board.  

Firmata Version Firmataversion - The installed firmata version as reported by the arduino board.  

Active Active - Toggle to establish a connection between the component and the arduino board.  

Port Port - Select the port the arduino board is connected to.  

Baud Rate Baudrate - Set the Baud Rate for the serial connection.  

Reset Reset - Reset all stored settings of the arduino board.  

Query Version Queryver - Request the installed firmata type and version from the arduino board.  

Query Board Capabilities Querycap - The capability query provides a list of all modes supported by each pin.  

Query Pin States Querystates - The pin state is any data written to the pin (it is important to note that pin state != pin value).  

Query Analog Mapping Queryanalog - The analog mapping query provides the information about which pins (as used with Firmata's pin mode message) correspond to the analog channels.  

Report Analog Pins Reportanalog - Enable the reporting of analog pin values from the arduino.  

Report Digital Pins Reportdigital - Enable the reporting of digital pin values from the arduino.  

Sampling Interval Samplinginterval - The sampling interval sets how often analog data and i2c data is reported to the client. The default for the arduino implementation is 19ms.  

Parameters - Pin Modes Page

This page will have a list of menu parameters the length of the number of pins on the arduino board. For each pin, the menu will reflect the pins supported modes:

  • PWM
  • I2C

Parameters - Pin Values Page

This page will have a list of either float and toggle parameters for each pin depending on the pin's mode. Pins set to an input type will be read-only.

Parameters - Servo Page

Min Pulse Minpulse -  

Max Pulse Maxpulse -  

Operator Outputs

  • Output 0 - The CHOP output reflects the arduino's pin values.

Palette • Palette:arcBallCamera • Palette:arcBallGeometry • Palette:audioAnalysis • Palette:audioSet • Palette:battery • Palette:blendModes • Palette:bloom • Palette:cameraBrowser • Palette:camSchnappr • Palette:changeColor • Palette:changeToColor • Palette:checker • Palette:chromaKey • Palette:colorThreshold • Palette:compareComp • Palette:convolve • Palette:cornerPinSOP • Palette:customAttributes • Palette:dent • Palette:depthExtract • Palette:dilate • Palette:equalizer • Palette:feedback • Palette:feedbackEdge • Palette:firmata • Palette:geoPanel • Palette:gestureCapture • Palette:graphPlot • Palette:histogram • Palette:hsvBlur • Palette:imageSearch • Palette:julia • Palette:kantanMapper • Palette:kinectCalibration • Palette:kinectPointcloud • Palette:leapPaint • Palette:lightTunnel • Palette:mandelbrot • Palette:mesh • Palette:monochrome • Palette:motionSense • Palette:moviePlayer • Palette:multiLevel • Palette:multiMix • Palette:noise • Palette:onScreenKeyboard • Palette:opticalFlow • Palette:particlesGpu • Palette:pixelate • Palette:pixelRelocator • Palette:pointGenerator • Palette:pointillize • Palette:pointMerge • Palette:pointRender • Palette:pointRepack • Palette:pointTransform • Palette:pointWeight • Palette:popDialog • Palette:probe • Palette:projectorBlend • Palette:pushPins • Palette:puzzle • Palette:radialBlur • Palette:remotePanel • Palette:rgbaBlur • Palette:rgbaDelay • Palette:rgbContrast • Palette:search • Palette:searchReplace • Palette:sharpen • Palette:softenAlpha • Palette:solarize • Palette:sopRender • Palette:stitcher • Palette:stoner • Palette:superFormula • Palette:sweetSpotPreviz • Palette:TDVR • Palette:transitMap • Palette:twirl • Palette:vectorScope • Palette:virtualFile • Palette:waveformMonitor • Palette:webBrowser • Palette:xyScope

Firmata is described and accessed through here:

See the TouchDesigner forum discussion thread:

See also Arduino.


Firmata is essentially an Arduino sketch which lets you configure and control the Arduino using messages formatted as MIDI. A good introduction for whoever is interested can be found here:

So what does it let you do? Well, first:

  • hook up your Arduino
  • upload the StandardFirmata Sketch from the Examples/Firmata folder
  • after successful upload start the attached TouchDesigner toe and go into /project1/firmata and select the right COM Port on the serial1 DAT
  • toggle thee Active Parameter of the serial1 DAT off and on --> you should be seeing messages coming into the serial1 DAT
  • now go one level up to /project1, here you find:
    • a pinCapabilities DAT telling you what each pin of your Board can act as
    • a pinSettings DAT telling you what each pin is currently set to
    • a firmataVersion DAT informing you off the Firmata Sketch and Version uploaded to the Arduino as well as
    • an analogValues and digitalValues CHOP, showing you the pins output
  • on the input side to the firmata COMP you find:
    • a constant CHOP called values to set pins to certain values
    • a constant CHOP called mode to tell the pin what it should act as (there is a Table DAT called modes docked to the firmata COMP informing you of what value maps to what mode)
    • as well as a Report Analog and a Report Digital Button which enable feedback from the Arduino to TouchDesigner.

Not yet implemented are the I2C and Shift Modes, if anybody has information on how to do that best, I'd be really interested to see this working Also I ran into a problem with my Arduino Mega, not all pins would report correctly, wonder if my mega somehow is faulty? Further when connecting a servo I had sitting here for a long time, the Arduino would reset, so the servo functionality is not fully tested yet.

If you like to further develop the extension or this patch, the Firmata class sits in firmata/local/modules/firmata

Firmata seems to be great to get a quickstart in using the Arduino as a pure input/output converter for all kinds of Sensors and Devices and keep all the logic inside TouchDesigner.

To pulse a parameter is to send it a signal from a CHOP or python or a mouse click that causes a new action to occur immediately. A pulse via python is via the .pulse() function on a pulse-type parameter, such as Reset in a Speed CHOP. A pulse from a CHOP is typically a 0 to 1 to 0 signal in a channel.

An Operator Family which operate on Channels (a series of numbers) which are used for animation, audio, mathematics, simulation, logic, UI construction, and many other applications.

A built-in panel in TouchDesigner that contains a library of components and media that can be dragged-dropped into a TouchDesigner network.

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

A form of DATs (Data Operators) that is structured as rows and columns of text strings.