# HG changeset patch # User Chris Cannam # Date 1430301390 -3600 # Node ID 6f8fa7fc8fdc2ae9f1d987111074de45f694ecc3 # Parent 7dda913d820b4e8437986b36a4d773935642dd94 Fix oversight which saw note tracking use pre-filtered pitches (resulting in many short notes) diff -r 7dda913d820b -r 6f8fa7fc8fdc src/Silvet.cpp --- a/src/Silvet.cpp Wed Apr 29 10:34:44 2015 +0100 +++ b/src/Silvet.cpp Wed Apr 29 10:56:30 2015 +0100 @@ -255,7 +255,7 @@ d.identifier = "onsets"; d.name = "Note onsets"; - d.description = "Note onsets, without durations. These can be calculated sooner than complete notes as it isn't necessary to wait for the note to finish. Each event has time, estimated fundamental frequency in Hz, and a synthetic MIDI velocity (1-127) estimated from the strength of the pitch in the mixture."; + d.description = "Note onsets, without durations. These can be calculated sooner than complete notes, because it isn't necessary to wait for a note to finish before returning its feature. Each event has time, estimated fundamental frequency in Hz, and a synthetic MIDI velocity (1-127) estimated from the strength of the pitch in the mixture."; d.unit = "Hz"; d.hasFixedBinCount = true; d.binCount = 2; @@ -737,7 +737,7 @@ // This pushes the up-to-max-polyphony activation column to // m_pianoRoll - postProcess(localPitches[i], localBestShifts[i], wantShifts); + postProcess(filtered, localBestShifts[i], wantShifts); auto events = noteTrack(shiftCount); @@ -927,13 +927,14 @@ // if they ever appear, but it's not as if live mode is good // enough for that to be a big deal anyway. if (m_mode == LiveMode) { - if (j == 0 || j + 1 == pack.templateNoteCount || + if (j == 0 || + j + 1 == pack.templateNoteCount || pitches[j] < pitches[j-1] || pitches[j] < pitches[j+1]) { continue; } } - + strengths.insert(ValueIndexMap::value_type(strength, j)); } @@ -982,9 +983,9 @@ double columnDuration = 1.0 / m_colsPerSec; // only keep notes >= 100ms or thereabouts - double durationThreshSec = 0.1; - if (m_mode == LiveMode) durationThreshSec = 0.07; - int durationThreshold = floor(durationThreshSec / columnDuration); // in cols + double durationThrSec = 0.1; + if (m_mode == LiveMode) durationThrSec = 0.07; + int durationThreshold = floor(durationThrSec / columnDuration); // in cols if (durationThreshold < 1) durationThreshold = 1; FeatureList noteFeatures, onsetFeatures;