From 45501bc568d51ff17eeaffaf1eb7118d4c726fc8 Mon Sep 17 00:00:00 2001 From: John Glover Date: Mon, 9 Jul 2012 23:40:17 +0200 Subject: [partial_tracking] Add partial peaks to Frame objects in update_partials instead of in find_partials. --- src/simpl/partial_tracking.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/simpl/partial_tracking.cpp b/src/simpl/partial_tracking.cpp index 7932872..34da931 100644 --- a/src/simpl/partial_tracking.cpp +++ b/src/simpl/partial_tracking.cpp @@ -57,6 +57,11 @@ void PartialTracking::max_gap(int new_max_gap) { // Streamable (real-time) partial-tracking. Peaks PartialTracking::update_partials(Frame* frame) { Peaks peaks; + + for(int i = 0; i < peaks.size(); i++) { + frame->add_partial(peaks[i]); + } + return peaks; } @@ -66,11 +71,7 @@ Frames PartialTracking::find_partials(Frames frames) { if(frames[i]->max_partials() != _max_partials) { frames[i]->max_partials(_max_partials); } - - Peaks peaks = update_partials(frames[i]); - for(int j = 0; j < peaks.size(); j++) { - frames[i]->add_partial(peaks[j]); - } + update_partials(frames[i]); } _frames = frames; return _frames; @@ -188,6 +189,8 @@ Peaks SMSPartialTracking::update_partials(Frame* frame) { p->frequency = _data.pFSinFreq[i]; p->phase = _data.pFSinPha[i]; peaks.push_back(p); + + frame->add_partial(p); } return peaks; -- cgit v1.2.3