Mercurial > hg > svapp
comparison audioio/AudioGenerator.cpp @ 457:3485d324c172
Tidy dense time-value model API a bit; add first simple unit test for FFT model
author | Chris Cannam |
---|---|
date | Wed, 10 Jun 2015 17:06:02 +0100 |
parents | c48bc6ddfe17 |
children | 49c89950b06d |
comparison
equal
deleted
inserted
replaced
456:8125b8cb8128 | 457:3485d324c172 |
---|---|
437 } | 437 } |
438 | 438 |
439 sv_frame_t got = 0; | 439 sv_frame_t got = 0; |
440 | 440 |
441 if (startFrame >= fadeIn/2) { | 441 if (startFrame >= fadeIn/2) { |
442 got = dtvm->getData(0, modelChannels - 1, | 442 got = dtvm->getMultiChannelData(0, modelChannels - 1, |
443 startFrame - fadeIn/2, | 443 startFrame - fadeIn/2, |
444 frames + fadeOut/2 + fadeIn/2, | 444 frames + fadeOut/2 + fadeIn/2, |
445 m_channelBuffer); | 445 m_channelBuffer); |
446 } else { | 446 } else { |
447 sv_frame_t missing = fadeIn/2 - startFrame; | 447 sv_frame_t missing = fadeIn/2 - startFrame; |
448 | 448 |
449 for (int c = 0; c < modelChannels; ++c) { | 449 for (int c = 0; c < modelChannels; ++c) { |
450 m_channelBuffer[c] += missing; | 450 m_channelBuffer[c] += missing; |
455 << ", frames + fadeOut/2 = " << frames + fadeOut/2 | 455 << ", frames + fadeOut/2 = " << frames + fadeOut/2 |
456 << ", startFrame = " << startFrame | 456 << ", startFrame = " << startFrame |
457 << ", missing = " << missing << endl; | 457 << ", missing = " << missing << endl; |
458 } | 458 } |
459 | 459 |
460 got = dtvm->getData(0, modelChannels - 1, | 460 got = dtvm->getMultiChannelData(0, modelChannels - 1, |
461 startFrame, | 461 startFrame, |
462 frames + fadeOut/2, | 462 frames + fadeOut/2, |
463 m_channelBuffer); | 463 m_channelBuffer); |
464 | 464 |
465 for (int c = 0; c < modelChannels; ++c) { | 465 for (int c = 0; c < modelChannels; ++c) { |
466 m_channelBuffer[c] -= missing; | 466 m_channelBuffer[c] -= missing; |
467 } | 467 } |
468 | 468 |