Skip to content
Ljómi
Ljómi

Technical fact sheet

Ljómi

/ˈljouːmɪ/  ·  Icelandic, “light”

A real-time system that analyses aurora video frame by frame and emits MIDI notes, chords and continuous controller streams derived from auroral colour, brightness structure, area coverage, centroid motion and optical-flow wave features.

Status
Working instrument
Implementation
Python, 24 modules
Core stack
OpenCV · NumPy · rtmidi
Acceleration
OpenCL / CUDA / CPU
Input
Video file or live camera
Output
MIDI 1.0, multi-port
Licence
MIT
Author
Ljomi Systems Ltd

Overview

Aurora as dataset and as performer

Ljómi treats each video frame as a field of measurable visual activity rather than an image to be recognised. It segments the frame into auroral colour classes, extracts per-class photometric and kinematic features, and maps those features onto pitch, harmony, velocity and continuous control data. Every mapping is declared in YAML and can be re-tuned live, during a performance, without restarting the process.

The design commitment is that MIDI — not audio synthesis — is the output. The system produces a symbolic control stream, which keeps the interpretive step explicit and inspectable: the aurora supplies behaviour, contour and constraint, while the mapping layer supplies the musical decisions. It makes no claim that the aurora “sounds like” the result.

Signal path

Per-frame processing pipeline

  1. Stage 01

    Acquire

    File or camera capture, decimated by frame_skip, resized to a fixed processing resolution (default 854×480), converted BGR→HSV.

  2. Stage 02

    Segment

    Per colour class, an HSV threshold produces a binary mask, refined by morphological opening then closing with a 5×5 elliptical kernel.

  3. Stage 03

    Constrain

    Optional interactive ROI rectangle and a freehand painted exclusion mask are ANDed into every colour mask, suppressing foreground light pollution.

  4. Stage 04

    Extract

    Ten features per colour class: intensity, area, mean brightness, brightness regions, Sobel gradients, centroid motion, and four optical-flow wave descriptors.

  5. Stage 05

    Map & emit

    Features are quantised to scale degrees, chord types and CC values, then routed per colour to MIDI channels and devices with explicit note-lifecycle tracking.

Detection · what

Three auroral colour classes, independently voiced

Colour classes are chosen to correspond to the dominant auroral emission features — atomic oxygen at 557.7 nm, the oxygen red line near 630.0 nm, and the N₂⁺ bands toward 427.8 nm — as they appear in consumer-camera footage. Each class is segmented, analysed and routed independently, so a colour behaves as its own musical voice. Classes can be enabled or disabled at runtime; disabling one flushes its held notes.

Green

Ch 1

557.7 nm — atomic oxygen

Hue
45–76
Sat
30–255
Val
30–255
Regions
max 4, ≥0.1%

Pink

Ch 2

630.0 nm — oxygen red line

Hue
140–180
Sat
0–255
Val
0–255
Regions
max 3, ≥0.01%

Purple

Ch 3

427.8 nm — N₂⁺ bands

Hue
115–155
Sat
10–255
Val
10–255
Regions
max 3, ≥0.01%

Hue is in OpenCV’s 0–180 convention (half-degrees). Saturation and value floors are deliberately permissive to retain faint pink and purple structure. A parallel cloud_ranges set substitutes three low-saturation luminance bands, letting the same pipeline sonify daytime cloud without code changes — useful as a control condition.

Detection · how

Feature extraction and its methods

Ten features are extracted per colour class, per analysed frame. Six are photometric or kinematic measures of the mask itself; four describe the wave structure of dense optical flow across it.

MIDI conversion

From scalar features to notes, harmony and control data

Two trigger modes

Note generation is driven either by brightness — discrete bright regions within a colour mask each trigger material — or by area, where the colour’s frame coverage alone selects material. The modes are mutually exclusive for note triggering; controller streams are emitted in both.

Two note modes

In single notes, each qualifying region yields one pitch, giving a pointillistic texture whose density tracks spatial fragmentation. In chords, only the brightest region is voiced, as a chord. Mode is set per colour class, so classes can differ.

System

Operating as a live instrument

Live reconfiguration

  • YAML config watched on disk; observers refresh affected components in place
  • Hardware MIDI controllers mapped to configuration parameters, across multiple input ports
  • Gyroscopic controller input mapped to MIDI
  • Named YAML presets applied to the running system
  • On-screen overlay of live controller mappings and values

Compute

  • OpenCL (via OpenCV UMat), CUDA, and CPU backends with auto-detection and CPU fallback
  • Pre-allocated per-colour mask and gradient buffers; cached HSV bounds; cached inter-frame difference terms across the rolling window
  • Frame decimation and independent processing / display resolutions
  • Included GPU benchmark harness across backends and resolutions

Visual feedback

  • Composited mask overlays (solid or per-colour hatching), flow arrows, area coverage, measured processing rate
  • Debug readout of matched brightness and area bands
  • DPI-aware overlay scaling for projection

Provenance

  • Presented as a live electronic performance with projected footage
  • Aurora footage shot in Alaska by geophysics researcher Vincent Ledvina
  • 23 test modules covering music theory, wave direction and speed mapping, cloud mode, live reconfiguration and performance regressions

Scope and known limitations

Not photometrically calibrated. Detection operates on consumer-camera HSV values, which are subject to white balance, gain, gamma and codec compression. Colour classes approximate auroral emission features; they are not radiometric measurements, and brightness values are not proportional to intensity in rayleighs.

Colour classes are configured, not learned. HSV windows are hand-tuned per footage source. There is no automatic exposure normalisation or per-scene adaptation, and the pink and purple windows overlap in hue, so a pixel may register in more than one class.

Features are deliberately smoothed. The stabilisation needed for musical output low-passes the extracted signals, and wave descriptors are additionally windowed over 12 analysed frames.

No ground-truth validation. Extracted features have not been compared against all-sky camera data, magnetometer records or keogram-derived measures. Establishing whether they track physically meaningful auroral dynamics is an open question — and the most interesting one for collaboration.

Contact

Source and recorded output available on request

Ljómi is an independent project, MIT licensed, implemented in Python across 24 modules. If you want the configuration examples, recorded output, or a conversation about validating the extracted features, get in touch. Aurora footage credit: Vincent Ledvina.