GSoC'25 week 05 update by Om Santosh Suneri #271
Merged
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.
Week 05 Progress Report by Om Santosh Suneri
Project: AI-powered Debugger for Music Blocks
Mentors: Walter Bender Sumit Srivastava
Assisting Mentors: Devin Ulibarri
Reporting Period: 2025-06-29 - 2025-07-05
Goal for This Week
Migrating Music Blocks JSON-to-Text Converter to Streamlit App
This Week’s Achievements
Introduction
This week, I focused on one of the key deliverables of the project — integrating the JSON-to-Text Representation Converter into a Streamlit application. This marks a major step in our plan to create a seamless debugging experience for Music Blocks users. The converter, which was originally built using JavaScript, is now fully functional in Python via Streamlit and ready for integration with the AI-powered debugger.
What I Did
Goal
The previous tool was a client-side JavaScript converter that parsed JSON representations of Music Blocks projects and produced a structured, readable tree-view text format. The aim this week was to translate this logic into Python and build a Streamlit interface to make the tool backend-friendly and easily integrable with the AI Debugger app.
Migration from JavaScript to Python
Converting the JavaScript-based logic to Python wasn’t a simple one-to-one translation. It involved rethinking data structures, managing recursion differently, and carefully ensuring that each Music Blocks "block" type was accurately represented in the output.
Key technical components of the migration included:
Parsing the block structure:
[block_id, block_type, ..., connections]block_map) and recursion to follow nested or sequential connections (clampandstacklogic).Handling specific block types:
start,setmasterbpm2,newnote,repeat, etc.) has a distinct logic for representation.setmasterbpm2block may include a divider block to represent beat values (like4/4 = 1.00), which must be parsed recursively.Redacting base64-encoded content:
"data"to keep the output clean and safe.Maintaining tree formatting:
├──and│styled tree structure for visual clarity.Enhancements Added
While rewriting, I also took the opportunity to extend the support to more block types that weren’t handled earlier — for example:
arcincrementOnepitchtextsettranspositionThis ensures that even newer or more complex Music Blocks projects are parsed correctly and comprehensively.
The Streamlit App
Once the backend logic was ready, I integrated it with a user-friendly Streamlit interface. The app consists of:
Why It Matters
Music Blocks is used in educational environments. One of the biggest challenges new users face is understanding how blocks connect and function under the hood. By converting the visual block code into a readable text format, this tool:
Foundational Component for the Debugger
This converter will play a crucial role in the AI-powered Music Blocks Debugger. By giving a structured, simplified text representation of the project:
Seamless Integration Ahead
Now that the converter is in Streamlit (and Python), integrating it into the AI Debugger system becomes straightforward:
📸 Preview
Here’s a quick preview of the app:
Final Thoughts
Rewriting an entire logic-heavy JavaScript app into Python was both challenging and rewarding. It made me deeply understand how each block works in Music Blocks and how a simple but well-structured parser can bring clarity to even the most complex visual projects.
Next Week’s Roadmap
Resources & References
Acknowledgments
Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support.