This project demonstrates how pulse width modulation (plus a note filter as a bonus) affects the shape and sound of a pulse wave. This is not an interactive project. The sliders are for illustrative purposes.
I made the sound in JummBox, which is a modification of BeepBox, and has "mod channels", which lets you change various settings over time. I have added sliders to show which settings I changed, and when. What is "pulse width"? A pulse wave with a pulse width of 50 is equal to a square wave - the "up" state and the "down" state are of equal length. Reducing the pulse width shortens the "down" state while elongating the "up" state, keeping the same total wave length. The result is a more "light and buzzy" sound, to quote BeepBox. Slowly decreasing and increasing the pulse width back and forth while playing the sound creates a very nice effect that is very common in C64 music. The purple waveform at the top right illustrates the current pulse width. What is "filter cut" and "filter peak"? BeepBox has a note filter effect that lets you manipulate the amplitude of different frequencies of the sound. You do this by adding filter points to a filter editor. You can also add high-pass and low-pass filter points. In JummBox, you can choose to use the BeepBox note filter (called "advanced") or a "simple" note filter, which consists of two sliders: filter cut and filter peak. These sliders control a low-pass filter. I usually use the "advanced" note filter, but one of the pros of the the "simple" note filter is that the sliders are easy to modulate over time with a mod filter, so that is what I have used here. But I also included the filter editor from the "advanced" note filter, to show the state that equates those filter cut and filter peak values. Learn more here: https://en.wikipedia.org/wiki/Pulse_wave https://en.wikipedia.org/wiki/Pulse-width_modulation https://en.wikipedia.org/wiki/Low-pass_filter