![]() |
HitLib 1.3.0
VEX V5 LED animation library for PROS
|
A song's intensity envelope, baked ahead of time into one 8-bit sample per frame. More...
#include <led_strand.hpp>
Public Attributes | |
| const uint8_t * | samples |
| Intensity 0-255, one entry per frame. | |
| uint16_t | frameCount |
Number of samples in samples. | |
| uint16_t | frameMs |
| Milliseconds between consecutive samples. | |
A song's intensity envelope, baked ahead of time into one 8-bit sample per frame.
The V5 has no audio input and no MIDI decoder, so a strand can't listen to the music it's syncing to. Instead Pattern Studio reads a MIDI file on the desktop, renders it down to a level-per-frame envelope, and exports that envelope as a constexpr table. On the robot musicSync() just plays the table back against the wall clock, which costs one array lookup and a lerp per tick regardless of how long or dense the song is.
A three-minute song at the default 25 ms frame is about 7 KB of flash.
| const uint8_t* hitlib::LedStrand::MusicTrack::samples |
Intensity 0-255, one entry per frame.
| uint16_t hitlib::LedStrand::MusicTrack::frameCount |
Number of samples in samples.
| uint16_t hitlib::LedStrand::MusicTrack::frameMs |
Milliseconds between consecutive samples.