Visualizer support object and binary data types#28
Open
Aircoookie wants to merge 11 commits intoSendspin:mainfrom
Open
Visualizer support object and binary data types#28Aircoookie wants to merge 11 commits intoSendspin:mainfrom
Aircoookie wants to merge 11 commits intoSendspin:mainfrom
Conversation
Updated the visualizer support object structure and binary type details.
maximmaxim345
requested changes
Nov 19, 2025
Member
maximmaxim345
left a comment
There was a problem hiding this comment.
Hi @Aircoookie!
Thanks for the PR, sorry for taking so long to respond to you.
I have some suggestions on the architecture:
Splitting into multiple roles instead of tag-value encoding
Instead of a single visualizer role with tag-value encoded binary messages, I think it would be cleaner to split this into separate roles: visualize_beats, visualize_loudness, visualize_highest_amplitude, visualize_spectrum.
Benefits:
- Each role would have its own binary message type (we have 44 reserved message IDs for new roles)
- No need for tag-value encoding - the message format would be self-describing based on the message type
- Clients can still subscribe only to the specific visualizations they need
- Future-proofing: with PR #42, each visualization type can be versioned independently (e.g.,
visualize_spectrum@v2) without affecting the others
The only drawback I can think of is a slight overhead from receiving more WebSocket messages instead of bundled data - maybe resulting in at most 100 extra bytes per second, which isn't worth worrying about IMO.
Redundant bin count in Spectrum data
For the Spectrum/FFT data, the leading byte containing the bin count n seems redundant:
- The client already knows
n_disp_binsfrom thestream/startmessage - With separate roles, the client can calculate it from the WebSocket message length
Other than that, looks good to me!
String types (tentative) fixed binary format, no tag bytes
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Mar 19, 2026
…_r1`) (#163) Implement the `visualizer@_draft_r1` role ([spec PR #28](Sendspin/spec#28)). Fully implements the draft visualizer spec except: - **Beats** (`beat` type / message type 17): beat extraction and sending are not yet implemented. - **Frame batching**: `batch_max` is negotiated in `client/hello` and echoed in `stream/start`, but the server always sends one frame per binary message. - **`stream/request-format`**: acknowledged and logged but ignored (matches spec where request-format is still marked as TODO). Also refactors role support spec registration out of `connection.py` into the role registry, so each role family self-registers its support parser. `numpy` is now a required dependency (was optional) so that clients can depend on the visualizer role being available.
This was referenced Mar 19, 2026
Merged
maximmaxim345
added a commit
to Sendspin/sendspin-cli
that referenced
this pull request
Mar 25, 2026
## Summary Adds a real-time frequency spectrum visualizer to the TUI, rendered below the info panels. While the final `visualizer` role isn't part of the Sendspin Spec yet. This uses the first WIP version of the role (with role id `visualizer@_draft_r1`) from [this PR](Sendspin/spec#28), available in Music Assistant 2.8. The spectrum and loudness data is computed on the server, and then sent through the Sendspin protocol. Toggle it by pressing the `v` key. ## Screenshot <img width="2424" height="1046" alt="image" src="https://github.com/user-attachments/assets/fa8ca719-1046-4e14-b57e-20d70b2025a9" /> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an initial draft of the proposed visualizer type specification, including the
visualizer_supportJSON object, as well as the binary message data type definitions.Feedback is highly appreciated!