Yaml and JSON

A Lighting Project is a JSON or Yaml file.

  • JSON files end in .json
  • Yaml files end in .yml

Examples are mostly in Yaml, a minimal format that’s backward-compatible with JSON.

Example 1: Some data in JSON:

{
    "animation": {
        "typename": "sequence",
        "length": 3,
        "animations": [
            ".tests.PixelTester",
            {
                "typename": "fill",
                "color": "red"
            },
            "$bpa.matrix.MatrixRain"
        ]
    },
    "shape": [32, 12]
}
doc/tutorial/getting-started/yaml-and-json-example-1

Example 2: The same data in YAML:

animation:
  # Run three different animations, each for three seconds.
  typename: sequence
  length: 3

  animations:
    - .tests.PixelTester
    - typename: fill
      color: red
    - $bpa.matrix.MatrixRain

shape: [32, 12]
doc/tutorial/getting-started/yaml-and-json-example-2

YAML lets you write helpful comments for yourself or anyone else reading, by starting a line with the # character:


shape: [64, 16]
animation:
  typename: $bpa.matrix.MathFunc
  func: 23
  palette:
    colors: eight
    continuous: true
    scale: 0.01  # Gentle soft ripppling colors
    # scale: 100   # Psycho strobe colors
doc/tutorial/getting-started/yaml-and-json-footer