MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / get_math_envelope_section

Method get_math_envelope_section

DSView/pv/data/mathstack.cpp:332–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void MathStack::get_math_envelope_section(EnvelopeSection &s,
333 uint64_t start, uint64_t end, float min_length)
334{
335 assert(end <= get_sample_num());
336 assert(start <= end);
337 assert(min_length > 0);
338
339 if (!_envelope_done) {
340 s.length = 0;
341 return;
342 }
343
344 const unsigned int min_level = max((int)floorf(logf(min_length) /
345 LogEnvelopeScaleFactor) - 1, 0);
346 const unsigned int scale_power = (min_level + 1) *
347 EnvelopeScalePower;
348 start >>= scale_power;
349 end >>= scale_power;
350
351 s.start = start << scale_power;
352 s.scale = 1 << scale_power;
353 if (_envelope_level[min_level].length == 0)
354 s.length = 0;
355 else
356 s.length = end - start;
357
358 s.samples = _envelope_level[min_level].samples + start;
359}
360
361void MathStack::calc_math(uint64_t mathFactor)
362{

Callers 1

paint_envelopeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected