summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2012-07-09 23:40:17 +0200
committerJohn Glover <j@johnglover.net>2012-07-09 23:40:17 +0200
commit45501bc568d51ff17eeaffaf1eb7118d4c726fc8 (patch)
treeb4a04c9f4d50f1b5cfc00e388219a3c7ebe5ff8b /src
parent86183d8a17c7561706d76afe678f49bee56e0000 (diff)
downloadsimpl-45501bc568d51ff17eeaffaf1eb7118d4c726fc8.tar.gz
simpl-45501bc568d51ff17eeaffaf1eb7118d4c726fc8.tar.bz2
simpl-45501bc568d51ff17eeaffaf1eb7118d4c726fc8.zip
[partial_tracking] Add partial peaks to Frame objects
in update_partials instead of in find_partials.
Diffstat (limited to 'src')
-rw-r--r--src/simpl/partial_tracking.cpp13
1 files changed, 8 insertions, 5 deletions
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;