Mercurial > hg > silvet
changeset 150:d2bc51cc7f57
Some comments on things to try next...
author | Chris Cannam |
---|---|
date | Wed, 14 May 2014 18:09:06 +0100 |
parents | 315986140a70 |
children | fc06b6f33021 |
files | src/EM.cpp src/Silvet.cpp |
diffstat | 2 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/EM.cpp Wed May 14 18:08:47 2014 +0100 +++ b/src/EM.cpp Wed May 14 18:09:06 2014 +0100 @@ -39,6 +39,8 @@ m_binCount(SILVET_TEMPLATE_HEIGHT), m_sourceCount(SILVET_TEMPLATE_COUNT), m_pitchSparsity(1.1), + //!!! note: slightly less source sparsity might help; also + //!!! consider a modest shift sparsity e.g. 1.1 m_sourceSparsity(1.3), m_lowestPitch(silvet_templates_lowest_note), m_highestPitch(silvet_templates_highest_note) @@ -180,6 +182,9 @@ } } + //!!! try normalising so as to sum to unity and then taking L2 + //!!! norm of the two (for measure of how close they are) + for (int i = 0; i < m_binCount; ++i) { m_q[i] = column[i] / m_estimate[i]; }
--- a/src/Silvet.cpp Wed May 14 18:08:47 2014 +0100 +++ b/src/Silvet.cpp Wed May 14 18:09:06 2014 +0100 @@ -409,7 +409,7 @@ int width = filtered.size(); - int iterations = 12; + int iterations = 12; //!!! more might be good? Grid pitchMatrix(width, vector<double>(processingNotes)); @@ -430,6 +430,8 @@ } const double *pitches = em.getPitchDistribution(); + + //!!! note: check the CQ output (and most immediately, the sum values here) against the MATLAB implementation for (int j = 0; j < processingNotes; ++j) { pitchMatrix[i][j] = pitches[j] * sum; @@ -543,7 +545,9 @@ // Threshold for level and reduce number of candidate pitches int polyphony = 5; - double threshold = 4.8; + + //!!! make this a parameter (was 4.8, try adjusting, compare levels against matlab code) + double threshold = 6; typedef std::multimap<double, int> ValueIndexMap; @@ -571,6 +575,7 @@ int width = m_pianoRoll.size(); + //!!! adjust to only keep notes >= 100ms? or so int durationThreshold = 2; // columns FeatureList noteFeatures; @@ -583,6 +588,9 @@ // we have 25 columns per second double columnDuration = 1.0 / 25.0; + //!!! try: 20ms intervals in intensive mode + //!!! try: repeated note detection? (look for change in first derivative of the pitch matrix) + for (map<int, double>::const_iterator ni = m_pianoRoll[width-1].begin(); ni != m_pianoRoll[width-1].end(); ++ni) { @@ -623,7 +631,7 @@ Feature nf; nf.hasTimestamp = true; nf.timestamp = RealTime::fromSeconds - (columnDuration * (start - postFilterLatency)); + (columnDuration * (start - postFilterLatency) + 0.02); nf.hasDuration = true; nf.duration = RealTime::fromSeconds (columnDuration * duration);