Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
790c1ce
Added dev image build
rjtokenring Nov 3, 2025
43eb19a
Merge branch 'arduino:main' into main
rjtokenring Nov 3, 2025
4eb7e1b
Fix image pointers for development gitflow
rjtokenring Nov 3, 2025
7ae91a3
Sound generator Brick
rjtokenring Oct 24, 2025
1872cd0
support for transpose directive
rjtokenring Oct 24, 2025
46ed752
Add play poliphonic sounds
rjtokenring Oct 27, 2025
ca6bbc3
tests
rjtokenring Oct 27, 2025
7499808
Added bytes streamer to decouple generation and playback
rjtokenring Oct 28, 2025
d49fdad
Work ok effects
rjtokenring Oct 29, 2025
7046c7e
wait completion on polyphonic sequences
rjtokenring Oct 29, 2025
2103372
Move utils code into brick
rjtokenring Oct 31, 2025
550d386
updated readme
rjtokenring Oct 31, 2025
d749de5
Fix example
rjtokenring Oct 31, 2025
3229b89
Added playback queue clear
rjtokenring Nov 3, 2025
e5d5f20
Added wav playback
rjtokenring Nov 3, 2025
8206464
structuring cache
rjtokenring Nov 3, 2025
65b4e52
wav cache to reduce disk reads
rjtokenring Nov 5, 2025
e0ae77a
Merge remote-tracking branch 'upstream/main' into sound-generator
rjtokenring Nov 5, 2025
c9848e3
Merge remote-tracking branch 'upstream/main'
rjtokenring Nov 10, 2025
ca9e9f6
Merge remote-tracking branch 'upstream/main' into sound-generator
rjtokenring Nov 11, 2025
f1553ed
Code lint
rjtokenring Nov 11, 2025
07b2950
fix test
rjtokenring Nov 11, 2025
5d2a1a1
fix test
rjtokenring Nov 11, 2025
e592898
Fix license header
rjtokenring Nov 11, 2025
56894f0
Merge remote-tracking branch 'upstream/main' into sound-generator
rjtokenring Nov 20, 2025
3115abb
Merge branch 'main' into sound-generator
rjtokenring Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-github-dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ jobs:
cache-to: type=gha,mode=max
provenance: false
build-args: |
REGISTRY=${{ env.DEV_REGISTRY_PATH }}
REGISTRY=${{ env.DEV_REGISTRY_PATH }}
50 changes: 50 additions & 0 deletions src/arduino/app_bricks/sound_generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Sound Generator Brick

Sound Generator is a lightweight and expressive audio generation brick that lets you create, manipulate, and play sounds programmatically.
You can write musical notes, generate tones, and compose melodies — all while shaping the sound through custom waveforms and effects.

Features:
* *Generate tones and melodies from notes or frequencies.
* Choose your waveform — sine, square, triangle, sawtooth.
* Add sound effects such as chorus, overdrive, delay, vibrato, or distortion.
* Compose procedural music directly from code.
* Real-time playback over speaker

## Code example and usage

```python
from arduino.app_bricks.sound_generator import SoundGenerator, SoundEffect
from arduino.app_utils import App

player = SoundGenerator(sound_effects=[SoundEffect.adsr()])

fur_elise = [
("E5", 1/4), ("D#5", 1/4), ("E5", 1/4), ("D#5", 1/4), ("E5", 1/4),
("B4", 1/4), ("D5", 1/4), ("C5", 1/4), ("A4", 1/2),

("C4", 1/4), ("E4", 1/4), ("A4", 1/4), ("B4", 1/2),
("E4", 1/4), ("G#4", 1/4), ("B4", 1/4), ("C5", 1/2),

("E4", 1/4), ("E5", 1/4), ("D#5", 1/4), ("E5", 1/4), ("D#5", 1/4), ("E5", 1/4),
("B4", 1/4), ("D5", 1/4), ("C5", 1/4), ("A4", 1/2),

("C4", 1/4), ("E4", 1/4), ("A4", 1/4), ("B4", 1/2),
("E4", 1/4), ("C5", 1/4), ("B4", 1/4), ("A4", 1.0),
]
for note, duration in fur_elise:
player.play(note, duration)

App.run()
```

waveform can be customized to change effect. For example, for a retro-gaming sound, you can configure "square" wave form.

```python
player = SoundGenerator(wave_form="square")
```

instead, to have a more "rock" like sound, you can add effects like:

```python
player = SoundGenerator(sound_effects=[SoundEffect.adsr(), SoundEffect.overdrive(drive=180.0), SoundEffect.chorus(depth_ms=15, rate_hz=0.2, mix=0.4)])
```
Loading
Loading