Here, enjoy!

If you're insane and have way too much time on your hands, or if you just want to experiment. Be my guest!



0.5

How This Works (for Complete Beginners)

This program makes music using math! Don’t worry if you don’t know much about music or programming – here’s how it works:

How Sounds are Made

Sounds are just vibrations that travel through the air. In this program, we can create sounds by making numbers that move up and down, which is like creating those vibrations. This is done using something called a **wave**.

In this code, we use two types of waves:

What Do the Functions Do?

Try It Yourself!

  1. Change the numbers inside tri(t, freq) or sq(t, freq) to change the sound. For example, change the freq value to make the sound higher or lower.
  2. Press the "Play" button to hear how your changes affect the sound.
  3. Use the volume control slider to adjust the sound volume.

What’s Happening?

Each time you press "Play," the computer runs the code in the box. The code tells the computer how to generate sound based on math. By changing the numbers and formulas in the code, you’re changing the way the sound is made!