# HG changeset patch # User Chris Cannam # Date 1150386485 0 # Node ID 571805759a66f322614a73246c65bf7087d8673d # Parent 1348818e7be70edb8861ca331e2d9228cf6c9a90 * 1502816 file export is too slow and memory-hungry Use text stream when writing to file instead of accumulating into a string. * 1500625 Auto-align in MIDI layer confusing Make value extents convert to Hz in return value * 1494623: Duplicate display of frame 0 from vamp plugin output diff -r 1348818e7be7 -r 571805759a66 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Jun 15 12:28:47 2006 +0000 +++ b/layer/Colour3DPlotLayer.cpp Thu Jun 15 15:48:05 2006 +0000 @@ -363,7 +363,15 @@ for (int x = x0; x < x1; ++x) { - float sx0 = (float(v->getFrameForX(x)) - modelStart) / modelWindow; + long xf = v->getFrameForX(x); + if (xf < 0) { + for (int y = 0; y < h; ++y) { + img.setPixel(x - x0, y, m_cache->color(0)); + } + continue; + } + + float sx0 = (float(xf) - modelStart) / modelWindow; float sx1 = (float(v->getFrameForX(x+1)) - modelStart) / modelWindow; int sx0i = int(sx0 + 0.001); diff -r 1348818e7be7 -r 571805759a66 layer/NoteLayer.cpp --- a/layer/NoteLayer.cpp Thu Jun 15 12:28:47 2006 +0000 +++ b/layer/NoteLayer.cpp Thu Jun 15 15:48:05 2006 +0000 @@ -225,8 +225,11 @@ min = m_model->getValueMinimum(); max = m_model->getValueMaximum(); - if (shouldConvertMIDIToHz()) unit = "Hz"; - else unit = m_model->getScaleUnits(); + if (shouldConvertMIDIToHz()) { + unit = "Hz"; + min = Pitch::getFrequencyForPitch(lrintf(min)); + max = Pitch::getFrequencyForPitch(lrintf(max + 1)); + } else unit = m_model->getScaleUnits(); if (m_verticalScale == MIDIRangeScale || m_verticalScale == LogScale) logarithmic = true; @@ -478,12 +481,15 @@ max = Pitch::getFrequencyForPitch(lrintf(max + 1)); } + std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; + } else if (log) { -// std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; - min = (min < 0.0) ? -log10(-min) : (min == 0.0) ? 0.0 : log10(min); max = (max < 0.0) ? -log10(-max) : (max == 0.0) ? 0.0 : log10(max); + + std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; + } } else {