MCPcopy Create free account
hub / github.com/LMMS/lmms / triangleSample

Function triangleSample

include/Oscillator.h:98–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 static inline sample_t triangleSample( const float _sample )
99 {
100 const float ph = fraction( _sample );
101 if( ph <= 0.25f )
102 {
103 return ph * 4.0f;
104 }
105 else if( ph <= 0.75f )
106 {
107 return 2.0f - ph * 4.0f;
108 }
109 return ph * 4.0f - 4.0f;
110 }
111
112 static inline sample_t sawSample( const float _sample )
113 {

Callers 6

lfoShapeSampleMethod · 0.85
TriangleWave>Method · 0.85
setWaveToTriangleMethod · 0.85
paintEventMethod · 0.85
updateModulatorsMethod · 0.85
oscillateMethod · 0.85

Calls 1

fractionFunction · 0.85

Tested by

no test coverage detected