New firmware 1.29 with lua scripting

The new version of TILT!Audio firmware features better support for altsound sound packs and lua scripting support.

What is lua scripting?

In previous version there were already some command attached to a sound effect, either to control an attached shaker or the new port extender starting with 1.28 to control up to 16 additional GPIO ports directly with the TILT!Audio board.

Now lua scripting takes this to the next level. A command attached to a sound effect is per default simply passed to a lua script interpreter (see https://www.lua.org/). Lua script is a super easy to learn script language that lets you “program” what should happen when a certain sound effect gets played.

So everything you can do with special commands (control shaker, control GPIO, control serial media server, control various i2c devices e.g. ProMiniExtender) you can now also do with lua functions. Addtionally you can play additional sound effects or change volume all controlled by your lua script.

In order to make this work, TILT!Audio loads a lua script at startup (init.lua) that is located at the root directory of your sound pack, where you define all functions your going to use with your sound effects.

Example

Lets make an example:

Now in the webUI choose the sound effect that should trigger the shaking …

As you can see the shakeOnMultiball checks which background music is playing and activates the shaker only if a certain music is playing. But this is just an example.

From lua you also can control custom sound playback:

Example: use a dummy sound file that actually contains only a second silence, but triggers a lua function:

In this example we use addtional sound effect ids 1000-1004 and 1010 that the game normally don’t use (choose an arbitray high number). We create a matching row in altsound.csv (or directory in classic dir structure) and put the WAV files there.

The we call the lua functions like shown above and we will hear a random sound with the first function while the drain ball counter is increased. If playLooser sound triggers we play a “looser” sound if the was to many drained balls.

Of course this example requires the game to send the right trigger sounds when ball passes e.g. the outlane.

Tutorial video

I recorded a short video to demonstrate, what you can do with lua scripting. This will also be shown with light controller in my MSF later this month.

Tutorial video for lua scripting

Lua reference (all TILT!Audio lua functions and variables) can be found here.

New firmware 1.28 with port extender is out

New firmware 1.28 is out: https://mega.nz/#!l4xyDI5I!qoBXKPpOlxKabubys3AqH6tNBpEhtj0eJvP5bU4uTSY

It has a few bugfixes and especially support for the port extender (with board rev 2.5f and newer)

To use extension port you simply can reuse the serialCmd field in the sound effect details. New 1.28 recognized a few additional commands: 
1. all commands for the serial media server (like before): PLAY, STOP und PLAYONEOF 
2. NEW commands for the port extender: PORT x ON, PORT x OFF oder PORTSEQ x n1 n2 n3 …

You can also combine both comamnd types in one, just use a colon as separator. X is the placeholder for the port number with the range 100-115 -> 16 outputs. The n1, n2 … values are timespans of milli seconds, in order to playback a sequence. The port pin then toggles on and off.

There is also a new settings page in the web ui, that allows for testing GPIOs and commands in general: 

With this testing page you can check and test your installation wihtout playing the actual sound effect.

TILT!Audio on my MSF game

I finally took the time this evening and put one of my spare TILT!Audio boards into my msf game. Took only a few minutes to replace and it plays very nice.

My msf has a few more mods like extra leds in backbox speakers, big color pin2dmd and also the whole gi is rgb. But to be honest the biggest thrill is always the new sound. Of course I replaced the speakers as well to get more volume and clearer sound.