Skip to content

Conversation

@BeanRepo
Copy link
Contributor

@BeanRepo BeanRepo commented Nov 6, 2025

Replace SineGenerator with WaveGenerator Brick

@rjtokenring rjtokenring requested a review from mirkokurt November 7, 2025 12:53
@rjtokenring rjtokenring marked this pull request as ready for review November 7, 2025 12:53
@BeanRepo
Copy link
Contributor Author

BeanRepo commented Nov 7, 2025

Overview

This PR updates the Theremin example to use the new WaveGenerator brick instead of the previous SineGenerator implementation, providing improved audio quality and smoother transitions.

Changes

Audio Generation

  • Replaced custom SineGenerator implementation with the WaveGenerator brick
  • Added configurable envelope parameters (attack=0.01s, release=0.03s, glide=0.02s) for smooth frequency and amplitude transitions
  • Improved audio streaming with automatic background thread management and reduced latency (~30ms blocks)

Volume Handling

  • Updated volume control to use integer values (0-100) instead of normalized floats (0.0-1.0)
  • Simplified volume handling by using consistent 0-100 range for both amplitude and hardware volume
  • Improved real-time volume response and state synchronization

Documentation

  • Updated README with detailed information about the WaveGenerator brick
  • Added technical specifications (sample rate, audio format, block duration)
  • Improved troubleshooting section and hardware compatibility notes

Benefits

  • Better audio quality: Eliminates cracks and pops with smooth envelope transitions
  • Simplified code: Reduced code complexity by ~60 lines, leveraging brick functionality
  • Enhanced performance: Non-blocking audio playback with automatic resource management
  • Improved UX: Smoother frequency/amplitude changes and better volume control

@BeanRepo BeanRepo changed the title Replace SineGenerator with WaveGenerator Brick Replace SineGenerator with WaveGenerator Brick in Theremin Nov 7, 2025
@mirkokurt mirkokurt merged commit 3d97847 into arduino:release-1.0 Nov 11, 2025
2 checks passed
mirkokurt pushed a commit to mirkokurt/app-bricks-examples that referenced this pull request Dec 1, 2025
* add WaveGenerator in Theremin

* update volume handling and readme

---------

Co-authored-by: Dario Sammaruga <[email protected]>
mirkokurt added a commit that referenced this pull request Dec 2, 2025
* Replace SineGenerator with WaveGenerator Brick in Theremin (#8)

* Mascot Jump Game Example Addition (#7)

* Add Bedtime story teller example (#15)

* Mascot Jump Game Update UI (#17)

* Add Object Hunting example documentation (#18)

* Update Theremin Simulator example documentation (#16)

* Add led-matrix-painter (#5)

* Docs: update bedtime story teller (#20)

* Fan vibration monitoring UI (#19)

* Vibration Anomaly Detection Example Documentation (#22)

* Led matrix UI improvement (#24)

* Docs led matrix painter (#26)

---------

Co-authored-by: Dario Sammaruga <[email protected]>
Co-authored-by: Dario Sammaruga <[email protected]>
Co-authored-by: TaddyHC <[email protected]>
Co-authored-by: Stefano Torneo <[email protected]>
Co-authored-by: Matteo Marsala <[email protected]>
Co-authored-by: Ernesto Voltaggio <[email protected]>
Co-authored-by: Christopher Méndez <[email protected]>
Co-authored-by: Stefano Torneo <[email protected]>
BeanRepo added a commit to BeanRepo/app-bricks-examples that referenced this pull request Dec 11, 2025
* add WaveGenerator in Theremin

* update volume handling and readme

---------

Co-authored-by: Dario Sammaruga <[email protected]>
@BeanRepo BeanRepo deleted the improve-theremin branch December 15, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants