# HG changeset patch
# User Chris Cannam
# Date 1411666955 -3600
# Node ID e6a43500629b8463a964b44ca5d38ddcb7d4dc63
# Parent  a908a5a5626763d9d4c1d82f447a2115a12bd0b7
I think that the tempogram max lag can't exceed the window length - 1, rather than the window length, because it is used as an index into a vector of the window length

diff -r a908a5a56267 -r e6a43500629b TempogramPlugin.cpp
--- a/TempogramPlugin.cpp	Thu Sep 25 15:42:15 2014 +0100
+++ b/TempogramPlugin.cpp	Thu Sep 25 18:42:35 2014 +0100
@@ -635,7 +635,7 @@
     }
     
     m_tempogramMinLag = max((int)ceil((60/(m_inputStepSize * m_tempogramMaxBPM))*m_inputSampleRate), 0);
-    m_tempogramMaxLag = min((int)floor((60/(m_inputStepSize * m_tempogramMinBPM))*m_inputSampleRate), (int)m_tempogramWindowLength);
+    m_tempogramMaxLag = min((int)floor((60/(m_inputStepSize * m_tempogramMinBPM))*m_inputSampleRate), (int)m_tempogramWindowLength-1);
 
     if (m_tempogramMaxLag < m_tempogramMinLag) {
 	cerr << "At audio sample rate " << m_inputSampleRate