On Tuesday 23 Aug 2011 23:31:56 D. Michael McIntyre wrote: > On Tuesday, August 23, 2011, Dr Nicholas J Bailey wrote: > > Is there some svn magic I can do to get around this, or could somebody > > apply a silly-looking patch for me? > > I committed a converted version of the file. If you update and patch > against this, your patch should come out with only the relevant changes > flagged. The patch is attached and I "tested" it against 12426 (did svn-update this morning).
This patch fixes the following bugs: importantly: 1. pitches now tracked when they are in octaves below notated with "ignore octave error" on; 2. Setting gui "ignore octave error flag" honoured conveniently: 3. Default pitch-tracker settings aren't stupid any more > > > I don't have any write access to the svn repository and Graham Percival's > > away at the moment. > > We could fix that, or you could just send a patch. Either way, the Glasgow > branch is defunct now, and you should just do further maintenance on > mainline Rosegarden. Thank you for your kind and generous offer! I will maybe take you up on it in future, but right now, having been re-"organised", things are pretty dreadful for my group at Glasgow, to the extent that I don't want to let stuff out unless it's been at least looked at by somebody who knows what they are talking about due to my impending insanity. This patch got nothing worse than a few raised eyebrows and no laughing out loud from Graham, so it should be good to go (touch wood). There's more to come, but I know you're v busy right now with the qt3 stuff, This patch should substantially improve the experience for a new user though, so it should be worth committing. Nick/. -- Dr Nicholas J Bailey, Director, Science and Music Research Group, The University of Glasgow http://www.n-ism.org/People/nick.php Find out about our Masters in Signal Processing, Electronics and Computing Techniques for Researching and Understanding Music http://www.n-ism.org/SPECTRUM
Index: src/gui/configuration/PitchTrackerConfigurationPage.cpp
===================================================================
--- src/gui/configuration/PitchTrackerConfigurationPage.cpp (revision 12426)
+++ src/gui/configuration/PitchTrackerConfigurationPage.cpp (working copy)
@@ -40,6 +40,7 @@
const int PitchTrackerConfigurationPage::defaultGraphWidth = 4000;
const int PitchTrackerConfigurationPage::defaultGraphHeight = 100;
+const bool PitchTrackerConfigurationPage::defaultIgnore8ve = true;
PitchTrackerConfigurationPage::PitchTrackerConfigurationPage(QWidget *parent) :
TabbedConfigurationPage(parent),
@@ -157,7 +158,10 @@
m_ignore8ve = new QCheckBox(frame);
connect(m_ignore8ve, SIGNAL(stateChanged(int)),
this, SLOT(slotModified()));
- bool defaultIgnore8ve = settings.value("ignoreoctave", "true").toBool();
+ bool defaultIgnore8ve =
+ settings.value("ignoreoctave",
+ PitchTrackerConfigurationPage::defaultIgnore8ve
+ ).toBool();
m_ignore8ve->setChecked(defaultIgnore8ve);
layout->addWidget(m_ignore8ve, row, 1, 1, 2);
++row;
Index: src/gui/configuration/PitchTrackerConfigurationPage.h
===================================================================
--- src/gui/configuration/PitchTrackerConfigurationPage.h (revision 12426)
+++ src/gui/configuration/PitchTrackerConfigurationPage.h (working copy)
@@ -49,6 +49,7 @@
public:
static const int defaultGraphWidth; /**< Width of graph in ms */
static const int defaultGraphHeight; /**< Max excursion in cents */
+ static const bool defaultIgnore8ve; /**< Ignore octave errors */
PitchTrackerConfigurationPage(QWidget *parent = 0);
Index: src/gui/editors/pitchtracker/PitchGraphWidget.h
===================================================================
--- src/gui/editors/pitchtracker/PitchGraphWidget.h (revision 12426)
+++ src/gui/editors/pitchtracker/PitchGraphWidget.h (working copy)
@@ -58,6 +58,7 @@
unsigned int m_graphHeight; // Height of graph (in cents)
unsigned int m_graphWidth; // Width of graph (in milliseconds)
+ bool m_ignoreOctave; // Whether to ignore octave errors
Accidentals::Tuning* m_tuning; // Tuning in use in this widget
PitchHistory& m_history; // structure of data to plot
Index: src/gui/editors/pitchtracker/PitchGraphWidget.cpp
===================================================================
--- src/gui/editors/pitchtracker/PitchGraphWidget.cpp (revision 12426)
+++ src/gui/editors/pitchtracker/PitchGraphWidget.cpp (working copy)
@@ -56,6 +56,11 @@
settings.value("graphwidth",
PitchTrackerConfigurationPage::defaultGraphWidth).
toInt();
+
+ m_ignoreOctave =
+ settings.value("ignoreoctave",
+ PitchTrackerConfigurationPage::defaultIgnore8ve).
+ toBool();
qDebug("******************** end pitchgraphwidget ctor");
}
@@ -138,7 +143,17 @@
tr("None available (check preferences)");
painter.drawText(100, 40, tuningName);
painter.drawText(100, 70, labelStg);
- if (targetValid) labelStg = QString::number(freq_err_cents, 'f', 3);
+ if (targetValid) {
+ if (m_ignoreOctave) {
+ int octaves(static_cast<int>(freq_err_cents)/1200);
+ labelStg = QString::number(fmod(freq_err_cents, 1200.0), 'f', 3)
+ + QString(" ");
+ if (octaves >= 0) labelStg += QString("+");
+ labelStg += QString::number(octaves) + QString("oct");
+ } else {
+ labelStg = QString::number(freq_err_cents, 'f', 3);
+ }
+ }
painter.drawText(100, 90, labelStg);
painter.setPen(defaultColor);
@@ -194,8 +209,9 @@
// computer graphics: lower numbers -> higher on screen
// Trace should move in range +/- graphHeight
- const int y = -height() *
- (0.5*m_history.m_detectErrorsCents[i]/m_graphHeight);
+ double cents_err = m_history.m_detectErrorsCents[i];
+ if (m_ignoreOctave) cents_err = fmod(cents_err, 1200.0);
+ const int y = -height() * (0.5*cents_err/m_graphHeight);
const bool valid = m_history.m_detectErrorsValid[i];
QPoint here;
// draw pitches
Index: src/sound/PitchDetector.h
===================================================================
--- src/sound/PitchDetector.h (revision 12426)
+++ src/sound/PitchDetector.h (working copy)
@@ -110,7 +110,7 @@
void setStepSize( int stepSize ); /**< Set no, samples between anals */
int getBufferSize() const; /**< Get size of audio buffer */
- void setMethod( Method Method );
+ void setMethod( Method method );
Method getCurrentMethod() {
return m_method;
}
Index: src/sound/Tuning.cpp
===================================================================
--- src/sound/Tuning.cpp (revision 12426)
+++ src/sound/Tuning.cpp (working copy)
@@ -579,7 +579,7 @@
const int octaveDifference = octave - m_refOctave;
- const int octaveRatio = pow( 2, octaveDifference );
+ const double octaveRatio = pow( 2, octaveDifference );
ratio *= octaveRatio;
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerry® mobile platform with sessions, labs & more. See new tools and technologies. Register for BlackBerry® DevCon today! http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
