MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / triangle

Function triangle

src/audio_play/ToneGenerator.cpp:6–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const float pi = PI;
5
6float triangle(float f) {
7 return 1-abs(abs(2*f / pi - 3)-2);
8}
9
10float square(float f) {
11 return f <= pi ? 1 : -1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected