comparison base/RangeMapper.cpp @ 1196:c7b9c902642f spectrogram-minor-refactor

Fix threshold in spectrogram -- it wasn't working in the last release. There is a new protocol for this. Formerly the threshold parameter had a range from -50dB to 0 with the default at -50, and -50 treated internally as "no threshold". However, there was a hardcoded, hidden internal threshold for spectrogram colour mapping at -80dB with anything below this being rounded to zero. Now the threshold parameter has range -81 to -1 with the default at -80, -81 is treated internally as "no threshold", and there is no hidden internal threshold. So the default behaviour is the same as before, an effective -80dB threshold, but it is now possible to change this in both directions. Sessions reloaded from prior versions may look slightly different because, if the session says there should be no threshold, there will now actually be no threshold instead of having the hidden internal one. Still need to do something in the UI to make it apparent that the -81dB setting removes the threshold entirely. This is at least no worse than the previous, also obscured, magic -50dB setting.
author Chris Cannam
date Mon, 01 Aug 2016 16:21:01 +0100
parents cc27f35aa75c
children 6f7a440b6218
comparison
equal deleted inserted replaced
1195:c118d2022ffa 1196:c7b9c902642f
68 { 68 {
69 if (m_inverted) position = m_maxpos - (position - m_minpos); 69 if (m_inverted) position = m_maxpos - (position - m_minpos);
70 double value = m_minval + 70 double value = m_minval +
71 ((double(position - m_minpos) / double(m_maxpos - m_minpos)) 71 ((double(position - m_minpos) / double(m_maxpos - m_minpos))
72 * (m_maxval - m_minval)); 72 * (m_maxval - m_minval));
73 cerr << "getValueForPositionUnclamped(" << position << "): minval " << m_minval << ", maxval " << m_maxval << ", value " << value << endl;
73 return value; 74 return value;
74 } 75 }
75 76
76 LogRangeMapper::LogRangeMapper(int minpos, int maxpos, 77 LogRangeMapper::LogRangeMapper(int minpos, int maxpos,
77 double minval, double maxval, 78 double minval, double maxval,