Quickstart
Fade channels on a Node sACN source.
Source:
examples/quickstart.ts
Minimal Node source that fades channels 1 and 2 on universe 1 for 10 seconds.
Set SACN_INTERFACE to the local IPv4 address on your lighting network when the
host has more than one interface.
createSacnSource from @helioslx/core/node owns the transport and installs
process handlers that call close() on Ctrl-C.
import { createSacnSource } from "@helioslx/core/node";
const iface = process.env.SACN_INTERFACE;
const source = createSacnSource({
name: "Helios quickstart",
transportOptions: {
...(iface === undefined ? {} : { iface }),
},
});
const universe = source.universe(1, {
priority: 100,
sourceName: "demo",
});
try {
await universe.fadeChannels(
{
1: 255,
2: 128,
},
{ durationMs: 10_000 },
);
console.info("Output is running. Press Ctrl-C to stop.");
} catch (error) {
await source.close();
throw error;
}Related: Quickstart guide, Networking.