|
| 1 | +--- |
| 2 | +title: "GSoC '25 Week 09 Update by Shubham Singh" |
| 3 | +excerpt: "Successfully implemented action block export functionality." |
| 4 | +category: "DEVELOPER NEWS" |
| 5 | +date: "2025-08-05" |
| 6 | +slug: "2025-08-05-gsoc-25-firepheonix-week09" |
| 7 | +author: "@/constants/MarkdownFiles/authors/shubham-singh.md" |
| 8 | +tags: |
| 9 | + - gsoc25 |
| 10 | + - sugarlabs |
| 11 | + - week09 |
| 12 | + - firepheonix |
| 13 | +image: "assets/Images/GSOC.webp" |
| 14 | +--- |
| 15 | + |
| 16 | +<!-- markdownlint-disable --> |
| 17 | + |
| 18 | +# Week 9 Progress Report by Shubham Singh |
| 19 | + |
| 20 | +**Project:** [Color Sensor for Music Blocks](https://github.com/sugarlabs/musicblocks/issues/4537) |
| 21 | +**Mentors:** [Devin Ulibarri](https://github.com/pikurasa), [Walter Bender](https://github.com/walterbender) |
| 22 | +**Reporting Period:** 2025-07-28 – 2025-08-05 |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Goals for This Week |
| 27 | + |
| 28 | +- Build the action block output. |
| 29 | +- Generate note blocks with their corresponding note values and pitches for a given phrase, based on the LEGO brick input. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## This Week's Achievements |
| 34 | + |
| 35 | +1. **Implemented the correct audio output when LEGO bricks pattern was played.** |
| 36 | + - Successfully integrated the LEGO brick pattern recognition with Music Blocks' audio engine. |
| 37 | + - The LegoBricks widget now accurately reads brick patterns and translates them into musical sequences. |
| 38 | + - Implemented proper timing synchronization to ensure notes play at the correct intervals based on brick positioning. |
| 39 | + - Added support for multiple note types (quarter notes, half notes, whole notes) based on brick spacing and arrangement. |
| 40 | + - Tested the audio output with various brick configurations to ensure consistent musical interpretation. |
| 41 | + |
| 42 | +2. **Export as action blocks now working** |
| 43 | + - Developed a complete export mechanism that converts LEGO brick patterns into Music Blocks action blocks. |
| 44 | + - The system now mimics the phrase maker's column-based approach, where each column represents a specific duration. |
| 45 | + - Implemented column width detection to accurately determine note durations from brick spacing. |
| 46 | + - Added proper metadata handling to ensure exported action blocks maintain all necessary musical information. |
| 47 | + - Created a seamless integration between the visual brick interface and Music Blocks' internal action block structure. |
| 48 | + - The exported action blocks can now be imported and used in other Music Blocks projects, maintaining full compatibility. |
| 49 | + |
| 50 | +  |
| 51 | + |
| 52 | +3. **Attended and demonstrated with webcam on live meet** |
| 53 | + - Participated in the weekly GSoC/DMP/SSoC progress showcase meeting with all participating students. |
| 54 | + - Successfully demonstrated the LEGO blocks project using a live 4K webcam feed, showing real-time brick detection and music generation. |
| 55 | + - Received positive feedback from mentors and fellow students on the project's innovative approach to music education. |
| 56 | + - Showcased the system's ability to detect different colored bricks and translate them into musical notes in real-time. |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Challenges & How I Overcame Them |
| 61 | + |
| 62 | +- **Challenge:** Implementing accurate column division for action block export was extremely complex. The system needed to divide the entire image into precise columns that would correctly map to musical durations, similar to how the phrase maker operates. |
| 63 | + **Solution:** Developed a mathematical algorithm that analyzes brick spacing and calculates optimal column boundaries. Used multiple iterations of testing with different brick arrangements to refine the column detection logic. Researched Music Blocks' phrase maker source code to understand the exact formatting requirements for action blocks. |
| 64 | + |
| 65 | +- **Challenge:** Ensuring cross-platform compatibility for webcam integration and real-time brick detection across different operating systems and camera specifications. |
| 66 | + **Solution:** Implemented adaptive camera settings that automatically adjust to different webcam capabilities. Added fallback mechanisms for lower-resolution cameras and tested extensively on various hardware configurations. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Key Learnings |
| 71 | + |
| 72 | +- **Modular Problem-Solving Approach:** Breaking complex problems into smaller, manageable components creates a clear development pipeline. This approach provided much better clarity when implementing the action block export functionality, as each module could be tested and refined independently. |
| 73 | +- **Cross-Platform Pixel Density Considerations:** Different monitor sizes and resolutions significantly impact pixel-based calculations. However, this variance becomes negligible when using relative units (vh, vw, %, em) instead of hardcoded pixel values. This insight was crucial for ensuring consistent brick detection across different devices. |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## Next Week's Roadmap |
| 78 | + |
| 79 | +- Make the color detection and output more accurate. |
| 80 | +- Deal with issue related to block length detection errors. |
| 81 | +- Develop user documentation and tutorial materials for the LEGO blocks widget. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Resources & References |
| 86 | + |
| 87 | +- **Music Blocks Documentation:** https://github.com/sugarlabs/musicblocks/tree/master/documentation |
| 88 | +- **LEGO Blocks Notation System Video:** https://youtu.be/LOfrCPf3XJU?feature=shared |
| 89 | +- **Devin's CMK'24 Blog:** https://medium.com/@sugarlabs/reflections-from-constructing-modern-knowledge-2024-1ce7d60fbb1c |
| 90 | +- **Music Blocks Phrase Maker Source Code:** Referenced for action block formatting standards |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## Acknowledgments |
| 95 | + |
| 96 | +Thank you to my mentors [Walter Bender](https://github.com/walterbender) and [Devin Ulibarri](https://github.com/pikurasa) for invaluable guidance throughout this development phase. Special appreciation for their feedback during the live demonstration and their continued support in refining the project's technical implementation. |
| 97 | + |
| 98 | +--- |
0 commit comments