1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00
serenity/Applications/Piano
William McPherson 69d05fbf44 Piano: Add triangle wave and noise
The squad is complete :^)

You can find the equation for the triangle wave here:
https://en.wikipedia.org/wiki/Triangle_wave
We're using this one:
|x mod 4 - 2| - 1
Modifications have been made to correct the frequency and phase:
|(4x + 1) mod 4 - 2| - 1

The white noise is generated by calling rand() and dividing it by
RAND_MAX to get a value from 0 to 1. Then it's adjusted to fit between
-1 and 1.
2019-12-13 19:30:14 +01:00
..
main.cpp LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
Makefile LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
Music.h Piano: Add triangle wave and noise 2019-12-13 19:30:14 +01:00
PianoWidget.cpp Piano: Add triangle wave and noise 2019-12-13 19:30:14 +01:00
PianoWidget.h Piano: Add triangle wave and noise 2019-12-13 19:30:14 +01:00