MCPcopy Create free account
hub / github.com/LabSound/LabSound / trip

Method trip

src/extended/PolyBLEPNode.cpp:136–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134 }
135
136 double trip() const
137 {
138 double t1 = t + 0.75 + 0.5 * pulseWidth;
139 t1 -= bitwise_or_zero(t1);
140
141 double y;
142 if (t1 >= pulseWidth)
143 {
144 y = -pulseWidth;
145 }
146 else
147 {
148 y = 4 * t1;
149 y = (y >= 2 * pulseWidth ? 4 - y / pulseWidth - pulseWidth : y / pulseWidth - pulseWidth);
150 }
151
152 if (pulseWidth > 0)
153 {
154 double t2 = t1 + 1 - 0.5 * pulseWidth;
155 t2 -= bitwise_or_zero(t2);
156
157 double t3 = t1 + 1 - pulseWidth;
158 t3 -= bitwise_or_zero(t3);
159 y += 2 * freqInSecondsPerSample / pulseWidth * (blamp(t1, freqInSecondsPerSample) - 2 * blamp(t2, freqInSecondsPerSample) + blamp(t3, freqInSecondsPerSample));
160 }
161 return amplitude * y;
162 }
163
164 double trap() const
165 {

Callers

nothing calls this directly

Calls 2

bitwise_or_zeroFunction · 0.85
blampFunction · 0.85

Tested by

no test coverage detected