TuringThe Turing object is really interesting. You can write a state machine like this : ![]()
The object compiles this source code into goto and send tables :
When a token arrives, it is translated into it’s token_id (using another table of 256 chars). In our example, ‘x’ has id 1, ‘c’ has id 2, etc. Then we simply read the new state by looking at the current state’s row and column indicated by the token_id. We have just used a small trick for default values: if the result of our lookup is 0, we look at the ‘default token’ column (first column) to find the move. Here is a more simple example. In this example we can see that ‘b’ has defaults (/) and the default move is (0 = goto ‘a’). 929881652851' width='258' height='199' alt='fun2' class='std'/>
SerialThis one lets you receive data from the serial port. Nothing much to add except I could not find a C++ wrapper that with MIT licence (like rubyk) so I had to write my own. I felt like reinventing the wheel on this one. KeyboardJust type this:
To start playing midi with your keyboard. See how the shift key give lower sounds since ‘A’ is 65 and ‘a’ is 97. ... it’s 5am I’m dead tired. PS“live” stupid session with a lua script. |
documents |