This folder holds all user data and is normally deployed alongside the executable commands.
Sound effects need to be pre-process (see /tools
) and are then put here, individual files directly in /sounds/effects
are treated as single sound files that always play in the same way. If multiple files are bundled into subdirectories, each subdirectory is a single sound with multiple variations, that play either randomly or sequentially.
Each folder in /music/playlists
is treated as an individual playlist of music files. As resampling is not implemented for music yet, they all need have the same format and sampling rate.
A light effect is a *.tengo
script1 that exports a function to render the next effect frame, using the following signature:
export {
info: {
maxtick: 256,
frametime: 0.05 // [s]
},
frame: func(leds, tick){
for group in leds {
for idx:=0; idx<group.count; idx++ {
group.brightness[idx] = ...
group.color[idx] = ...
}
}
return leds
}
}
Most included light effects are the usual suspects, like Larson scanners, rainbows and color fades2.
maxtick
: Maximum number to which the animation frame index will be counted before resetting to0
, if0
, it won't ever be increased (e.g. for constant effects like solid colors)frametime
: Seconds for which each frame will be visible, if0
it is shown until the next frame is requested manually (e.g. for constant effects like solid colors)
tick
: Index number of the current animation frame, if this reachesmaxtick
, it resets to0
leds
: An object defining the LED setup on which the effect will be ultimately displayed, they are split into named groups with a fixed LED count to each of which a brightness (where 0.0 is black, 2.0 is white and 1.0 is the nominal color) and a color index (that maps to an internal rainbow color palette with 256 colors) is attached
leds = {
"front-left": {
count: 5,
brightness: [1.0, 1.0, 1.0, 1.0, 1.0],
color: [0, 0, 0, 0, 0]
}
}