How colorgarden/ccnbslib works
CCNBSLib is a Lua library for decoding Note Block Studio files, analyzing and planning songs, and scheduling notes on CC:Tweaked speakers. Its principal workflow is bytes → decode → analyze → plan → play; the optional nbsplay example fetches a URL and uses the library to play it. The README documents these public stages and capabilities, but no source excerpts were provided, so internal module-to-module calls are not inferred.
Main entry points: nbsplay.lua NBS CLI Player · decode.lua NBS Decode · analyze.lua Song Analysis · runtime.lua Playback Session
Components 20
Song Library
- NBS Decode
nbs/decode.lua - Binary Reader
nbs/reader.lua - Song Header
nbs/header.lua - Song Layers
nbs/layers.lua - Song Notes
nbs/notes.lua - Song Analysis
nbs/analyze.lua - Event Planning
player/plan.lua - CP1252 Display
nbs/cp1252.lua
Playback
- Playback Session
player/runtime.lua - Event Dispatch
player/dispatch.lua - Tempo Timing
player/tempo.lua - Playback Clock
player/clock.lua - Speaker Mapping
player/mapping.lua - Note Fanout
player/fanout.lua - Speaker Output
player/speaker.lua
CLI Example
- NBS CLI Player
nbsplay.lua
Other components
- Library Caller
- Song Bytes
- CC Speaker
- HTTP Service
Connections 12
- Library Caller → Song Bytes: provides
README.md - Song Bytes → NBS Decode: decodes
README.md - Library Caller → Song Analysis: analyzes
README.md - NBS Decode → Song Analysis: returns song
README.md - Library Caller → Event Planning: plans events
README.md - Song Analysis → Event Planning: supplies analysis
README.md - Library Caller → Playback Session: starts playback
README.md - Playback Session → CC Speaker: plays notes
README.md - NBS CLI Player → HTTP Service: fetches song
README.md - NBS CLI Player → NBS Decode: decodes bytes
README.md - NBS CLI Player → Playback Session: plays song
README.md - Library Caller → CP1252 Display: converts display
README.md