AR-172IntermediatePremium

UNO R4 WiFi DAC Melody and Wave Generator

A classic Arduino makes sound only by switching on and off; the UNO R4's 12-bit DAC sends a real waveform to the speaker. In this project a button cycles four modes: a melody (Ode to Joy), a sine, a square and a sawtooth wave. In the melody the pot sets the tempo; for the waves it sets the frequency from 100 to 1000 Hz. The 12x8 LED matrix scrolls the current wave shape or shows the notes like a piano roll.

0.0(0)
UNO R4 WiFi DAC Melody and Wave Generator
Why does the same note sound different with three different waves? In this project you hear it and see it. The DAC inside the UNO R4 turns numbers into a real voltage and sends a smooth sine, a hard square or a buzzing sawtooth to the speaker. Turn the pot and the pitch rises while the wave on the matrix speeds up; in melody mode the notes flow from right to left. Learning: DAC versus PWM, frequency and waveform, the analogWave library, timing without delay and switching modes with a button.

Source Code

Premium Content

The source code, block version and FAQ of this project are open to Premium members.

  • All Project Code
  • Block version
  • Frequently Asked Questions