For basic information on the Turing object, please read this post.

Lua

The first improvement to the Turing object is the tight integration with Lua. You can now write a bang method that can be used to filter input before feeding triggers to the state machine.

The return value of the ‘bang’ method is used as trigger. Return ‘nil’ to do nothing.

Token default

There is now a syntax to define ‘token defaults’: actions that must occur for a token, whatever the state the machine is currently in. This is read in the tables with the pipe sign ”|”. State defaults are noted ”-”.

debug

The new debugging tools include a better table printout and a “dot” method to create a digraph file to use with graphviz.

For example, the following line in the rubyk command line will create a “dot” file named “test.dot” with the transitions of the “tur” object.

> tur.dot("test.dot")

table and dot examples

Here is the table printout and the graphviz image for an object that uses lua method as send actions (“play, niet”). For the musicians among you, the values in the play method are midi notes and this script is a bass line played by a dancer with leg movements (PCA and Kmeans used for movement recognition) in the project home.

turingTables

turingDot