Kistan 2.0 Doc
  • Furniture
  • Sound cables
  • Roof LED
  • Pipes
  • Inputs/Outputs
  • Mixer
  • Amplifiers
  • DALI
  • DMX
  • Roof LED
  • LMixer
  • Sound mixer defaults
  • Bar computer to Kitchen speakers
  • Server: IN-SMN
  • Server: IN-ITK
  • SSO / Login
  • Grafana
IT-Sektionen
  • Furniture
  • Sound cables
  • Roof LED
  • Pipes
  • Inputs/Outputs
  • Mixer
  • Amplifiers
  • DALI
  • DMX
  • Roof LED
  • LMixer
  • Sound mixer defaults
  • Bar computer to Kitchen speakers
  • Server: IN-SMN
  • Server: IN-ITK
  • SSO / Login
  • Grafana
IT-Sektionen
  • LMixer

    • LMixer
    • LMixer scripting
    • Mixing technique
    • LMixer examples
    • LMixer Addons

      • Addons
      • Addon Development
      • Built-in addons
      • Kistan Specific Addons
      • LMixer Addon Suite

        • Addon Suite
        • Effects
        • Addon Suite Extensions
        • Utility Functions
    • Reference

      • Layers in kistan
      • Macros
      • Fixture Types in Kistan
      • Fixtures in Kistan's LMixer
      • Fixture Config File
    • LMixer Technical Info

      • Technical LMixer Info
      • MQTT Topics
      • Compatibility

LMixer scripting

Layer keywords

Create layer

A layer hold information for outputting data to a UDP listener. The layer have a length and can be combined with another layer using different mathematical operations.

NameOptionalDescription
ParentNoLayer to do operation on, nil if this is the base layer
OperationNoSee operations below
SizeNoHow many bytes is this layer
Default valueYesDefault value for all bytes in a layer

Operations:

OperationDescription
mulMultiply layers together
addAdd this to the other layer
subSubtract this from other layer
divDivide the other layer by this

Example: Create a new layer that multiplies master with this. Default value is 1.

dimmer = layer(master, mul, 512, 1)

LMixer Addon Suite Extensions exclusive

This content only applies to the LMixer Addon Suite Extensions.

layerExt

If the LMixer Addon Suite is in use, layerExt should be used instead of layer.

See the layerExt for details.

Create Alpha-Layer

Alpha layers allow for more advanced mixing. To create them, see the alpha_data_layer

output

Output controls what data is sent to each controller. An output can only send one layer.

NameOptionalDescription
HostnameNoHostname for output of the layer
PortNoUDP Port to send data on
LayerNoLayer to send

Example: Send the master layer to specified host on port 1234.

output("192.168.1.10", 1234, master)

artnet_output

Create a new output in the ArtNet1 format.

NameOptionalDescription
HostnameNoHostname for output of the layer
UniverseNoArtNet universe
LayerNoLayer to send

Example: Send the master layer in ArtNet format to specific host with universe set to 123.

artnet_output("192.168.1.10", 123, master)

input

Open a UDP port and bind data messages on that port to an existing layer.

NameOptionalDescription
PortNoUDP Port to listen on
LayerNoWhere to put the data

Example: Listen on port 1234 and put the data into an existing layer.

additional_data = layer(nil, add, 512)
input(1234, additional_data)

Fixture keywords

fix

Create a new fixture with specified parameters. Fixtures can also be added into "groups" by adding them to a table in Lua.

NameOptionalDescription
ChannelNoStart channel for a fixture
LengthNoHow many channels does the fixture consume

Example: Add a new fixture with address 128 and 4 channels.

lamp1 = fix(128, 4)

Add two fixtures and append them to a group called lamps.

lamp1 = fix(128, 4)
lamp2 = fix(132, 4)
lamps = { lamp1, lamp2 }

LMixer Addon Suite Extensions exclusive

This content only applies to the LMixer Addon Suite Extensions.

fixExt

If the LMixer Addon Suite is in use, fixExt should be used instead of fix.

See fixExt for details.

range

Create several fixtures in a series and add them to a group.

NameOptionalDescription
CountNoHow many fixtures to create
OffsetNoThe offset from dmx channel 1, the first fixture's channel is (Offset - 1) * Size + 1
SizeNoHow many bytes does each fixture have

Example: Create 10 fixtures with 3 channels, with an offset of 1.

pixels = range(10, 1, 3)

Effect keywords

<layer>:add

Add an effect to a layer.

NameOptionalDescription
TimeNoTime after script start in milliseconds
EffectNoFunction call to execute at time

Example: Add a new effect on 1 second to set lamp1 to values.

master:add(1000, set(lamp1, 255, 255, 0, 0))

dim

Fade a fixture from previous values to new values over a period of time.

NameOptionalDescription
TimeNoHow long the dimming effect is executing in milliseconds
Fixture/GroupNoWhat to set the values on
... ValuesNoValues to dim to

Example: Dim lamp1 to specified values for 100ms.

dim(100, lamp1, 255, 0, 0, 0)

set

Set a fixture to the specified values.

NameOptionalDescription
Fixture/GroupNoWhat to set the values on
... ValuesNoValues to set

Example: Set lamp1 to specified values.

set(lamp1, 255, 0, 0, 0)

cycle

Add an effect for each fixture in a group with a delay between each.

NameOptionalDescription
GroupNoGroup to iterate over
TimeNoTime to wait between each fixture
Function nameNoFunction to execute for each fixture
... ValuesNoArguments to the function

Example: Set each fixture in lamps to values with a delay of 100ms between each fixture.

cycle(lamps, 100, set, 255, 0, 0, 0)

rev

Reverse a group of fixtures to use them in backwards order. Is usually used inline with cycle command to do effects in reverse order.

NameOptionalDescription
GroupNoGroup to reverse

Example: Reverse a group of fixtures called lamps.

rev(lamps)

even

Get a subset of fixtures in a group based on their index value. Usually used inline when specifying groups for an effect.

NameOptionalDescription
GroupNoGroup to get fixtures from

Example: Set all even index lights in lamps to values.

set(even(lamps), 255, 0, 0, 0)

odd

Get a subset of fixtures in a group based on their index value. Usually used inline when specifying groups for an effect.

NameOptionalDescription
GroupNoGroup to get fixtures from

Example: Set all odd index lights in lamps to values.

set(odd(lamps), 255, 0, 0, 0)

execute

NameOptionalDescription
CommandNoCommand to execute on the server, must be quoted (")

Example: Run the dalicmd command on the server.

execute("dalicmd -g 255 -c 16")

run

Start a script by name. Normally this is used to repeat the current script by starting it again after some time. Can also be used to split common effects into separate script and then combining them.

Note

When running a script from another script and it has been previously stopped, it will not be placed on the timeline. start bypasses this and starts it anyway.

If this stopping is desired run Scripts.script_name:unstop() beforehand.

NameOptionalDescription
NameNoName of the script to run, must be quoted (")

Example: Execute the script called "rainbow".

run("rainbow")

Caution

If not careful one might cause stacking of script if the run command is issued before the last effect of the previous run. This causes an infinite loop of scripts starting on top of each other until something crashes.

start

Similar to run except it always executes.

NameOptionalDescription
NameNoName of the script to run, must be quoted (")

Example: Execute the script called "rainbow".

start("rainbow")

Caution

Since this always executes the script, if a call loop exists, stopping individually from the UI will not work, you need to stop all scripts.

Kistan's LMixer exclusive

This content only applies to kistan's instance of LMixer. It is likely the case that the code is contained in setup scripts.

play

NameOptionalDescription
FilepathNoPlay an existing sound file, must be quoted (")

Example: Play a sound file with the path blotet/dans_mitt.mp3.

play("blotet/dans_mitt.mp3")

stop_play

Stop playback of all sound files. No parameters.

Example: Stop all playback.

stop_play()

LMixer Addon Suite exclusive

This content only applies to the LMixer Addon Suite.

interval

Runs a function at an interval. See interval for details.

LMixer Addon Suite Extensions exclusive

This content only applies to the LMixer Addon Suite Extensions.

<alpha-data-layer>.alpha

Access to the alpha layer.

See <alpha-data-layer>.alpha in Addon Suite Extension for details.

take_control_of_fixture

Takes control of a fixture on an alpha layer.

See take_control_of_fixture in Addon Suite Extension for details.

release_control_of_fixture

Releases control of a fixture on an alpha layer.

See release_control_of_fixture in Addon Suite Extension for details.

LMixer Kistan Exclusive Addon

This content only applies to the LMixer Kistan_Specific Addon.

roof_shader

Creates a shader effect for the roof.

See roof_shader in Kistan_specific Addons for details.

sign_shader

Creates a shader effect for the Kistan sign.

See sign_shader in Kistan_specific Addons for details.

sign_spiral

Creates a spiral shader for the Kistan sign.

See sign_spiral in Kistan_specific Addons for details.

sign_heartbeat

Creates a heartbeat effect for the Kistan sign.

See sign_heartbeat in Kistan_specific Addons for details.

drinks_moving_blocks

Creates moving blocks on the drink lights.

See drinks_moving_blocks in Kistan_specific Addons for details.

Script keywords

Scripts are accessed from Scripts. in the global scope.

Compatibility mode

If builtin/compatibility/MakeScriptNamesGlobalScope is added as an addon, scripts start in the global scope.

<script>:start

Runs a script, this is synchronous and will be executed instantly.

Example: Start rainbow instantly

Scripts.rainbow:start()

<script>:stop

Stops a script, this only affects run

Example: Stops rainbow

Scripts.rainbow:stop()

<script>:unstop

Unstops a script, this allows run to execute this script again

Example: Unstops rainbow

Scripts.rainbow:unstop()

<script>:is_stopped()

Checks if a script has been stopped, useful for having multiple script

Example: Checks if rainbow is stopped, and stops rainbow_roof if that is the case

if (Scripts.rainbow:is_stopped()) then
    Scripts.rainbow_roof:stop()
end
Edit this page
Prev
LMixer
Next
Mixing technique