Playing Sound with tone
The tone function plays sound from the Desmos Graphing Calculator. Changing frequencies over time can even produce simple music.
tone(Frequency, Gain)
plays a sound at frequency . Supported frequencies range from to .
1
A speaker button appears above the expression. Desmos starts muted, so press the button to hear the sine wave.
The second argument controls gain.
1
Maximum gain depends on frequency and is calculated as .
A simple melody
This graph varies the frequency over time to play a melody. Press the speaker button inside the expression list.
Loading graph…
Beats
Combining two nearby frequencies creates a periodic change in loudness called a beat. Adjust the frequencies in this graph to see and hear the effect.
Loading graph…
For frequencies and , the beat frequency is