I am a harpsichord maker, and when my Korg tuner went bust I started searching for something to replace it and found the wonderful accordeur program.
Accordeur is doing a beautiful job for tuning my harpsichord - it always recognizes what note I am playing as long as the correct octave is set. The harpsichord is different from the guitar etc in some ways:
1) It is too large to move close to the computer.
2) The strings are always nearly in tune (within 1/4 semitone).
3) You tune the notes chormatically one after the other.
4) There are 180 strings to tune, so you *really* want the auto-detect feature.
What would be marvellous would be to auto-detect either the semitone above or below - then as you move on to the next note it would always find it (including octave changes) - you would only need to set the initial note on the computer and you could tune the entire instrument without having to use the mouse.
The noise could still be a problem - perhaps the BACKGROUND_DB could be made adjustable?
By the way, I could help with English translations of the help pages (le franc,ais que je parle est tre's mauvais, mais sans dou^te, suffirait? if you will pardon my ASCII :-), if that would be welcomed by you.
Great Work!
Richard Shann
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since posting this I have managed to build accordeur, and fiddled around with BACKGROUND_DB, but I couldn't find a value that would stop the program detecting spurious notes. What will work I think will be to ignore notes unless they persist, since the detected notes due to noise change all the time whereas the real notes hold steady for a second or two (with a harpsichord).
BTW I had to use Qt4 to build accordeur, because I could not get hold of a binary for Qt3.
Richard Shann
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I thought already of the possibility of activating the auto-select on the piano tab, but I believe that that will not be as effective as with the guitar.
I have also tried to change the value of BACKGROUND_DB, without success. It is indeed the duration of the note which is to be taken into account. There is perhaps also something to do with the harmonics.
My english is bad, so your help for the help pages is very welcome (translation and perhaps enhancement?). I have added you to developers list,so you can directly change the pages. You can also send me your pages if you preffer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your reply - I can't directly update the program because I can't build the sources (because of the lack of a Qt3 environment).
However I have made some code which is working for me ( I have just tuned my harpsichord without needing someone sitting at the computer changing the note for me!).
The code is inserted at the point in form1 where you have the comment
// sélection de la meilleure corde :
Here is the code that I wrote, with some questions about bits I don't understand. Below are some diffs for the docs/help.html and docs/index.html which are intended to improve the English; there are also some questions inserted here - in particular, the harmonics are indicated in the wrong place aren't they?
// Auto selection - switch the target Pitch if the found note is
// an adjacent semitone (for tuning chromatic instruments)
{
int pitch = Name2Pitch(pitchname); // note found this time
int note = pitch%12;
int oct = pitch/12 -1;
static int last_pitch=-1; // to check if same note found
static int confidence; // repeated finding of same note builds confidence
if(pitch == last_pitch) {
if( Pitch-pitch == 1 || Pitch-pitch == -1 )
{
confidence++;
if(confidence>2) {
confidence = 0;
Pitch = note+(oct+1)*12;
CBNote->setCurrentItem(note);//is this needed?
SPOctave->setValue(oct);//is this needed?
adjWindow(Pitch);//is this needed?
}
}
else
confidence = 0;
}
last_pitch = pitch;
}
diff for index.html
68,69c68,69
< </span> Accordeur is a program designed
< to help you to tune your musical instrument.<br>
---
> </span> Accordeur is a software designed
> to help you to tune your music instrument.<br>
74c74
< Essential differences are :<br>
---
> Essentials differences are :<br>
76,77c76,77
< <li>It displays the analysed spectrum.</li>
< <li>For low pitches it changes number of samples, so low pitch
---
> <li>Display analysed spectrum.</li>
> <li>For grave pitches, changes number of samples, so very grave
80,81c80,81
< <li>Refinement of the pitch is made by
< parabolic, not cubic interpolation.(??? is that what you do?) </li>
---
> <li>Fine compute of the pitch is made by searching nearest
> parabole, not by cubic interpolation.</li>
diff for help.html
66,67c66,67
< <li>Click on the button "Calibrate background noise". This allows
< a better analysis by ignoring sounds which are buried in the noise.</li>
---
> <li>Click on button "Calibrate background noise". This allow
> better anlyze by ignoring sounds which are under the noise.</li>
70c70,71
< <li>If you want to tune so as to play with a slightly sharp or flat instrument sound A4 on that instrument and then click on "Calibrate A4". Note that the display does not change - it still says A440 but it now shows the instrument as being in tune at standard pitch. (This is confusing! It would be better to display the true frequency being measured, and the adjusted A440 frequency as the "Perfect" target).<br>
---
> <li>If you want to adjust measure to match a tuning fork : play
> tuning fork then click on "Calibrate A4".<br>
74c75
< <li>Choose the pitch to tune.<br>
---
> <li>Choose pitch to tune.<br>
78c79
< <li>Play it on the instrument.</li>
---
> <li>Play it in the instrument.</li>
81,85c82,86
< <li>Tune instrument so that the peak of the spectrum is just on the green line.
< The first red line to the left shows the pitch one semitone lower. The
< red line to the right shows a semitone above. The other red
< lines on the left show harmonics 1/3, 1/5 ...(??? these should be on the right, that is at higher frequencies!). They make it possible to
< refine the adjustment even more.</li>
---
> <li>Tune instrument so that the peak is just on the green line.
> First red line on the left show the first pitch under the goal. First
> red line to the right show the first pitch over the goal.Others red
> lines on the left show harmonics 1/3, 1/5 ... They make it possible to
> refine even more the adjustment.</li>
88,92c89,90
< <li>Alteratively you can refine the tuning by bringing
< the frequency displayed as "Frequence"(!! this should be "Frequency", or "Detected Frequency") to the frequency show as "Perfect".</li>
< </ul>
< <ul>
< <li>For a simple tuning, use the coloured bar below the spectrum. This is red and to the right when below pitch, centred and green when on pitch, and red and to the left when above the pitch specified.</li>
---
> <li>Finally to refine the tune by as much as possible bringing
> closer the frequency displayed the frequency of the desired pitch.</li>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you!
I have also wrote code for auto-select, included in release 0.8.0.
But your code is different and more interesting for your tuning method (from lower pitch to higher, or from higher to lower). So I will include it in release 0.9.0.
Many thanks for your corrections in the docs files. I have learned english late, and only to read books on computers, so it's very difficult to me to wrote a correct english (google is useful but gives often very strange results).
> Refinement of the pitch is made by parabolic, not cubic interpolation.(??? is that what you do?)
More explanations :
Other programs i have tested use a cubic interpolation : they use the highest point and the two neighbors, and calculate the cubic curve which passes exactly by this points. This method has two disadvantages : we can't use more than 3 points and it gives sometimes obviously bad results, very different from one measurement to another.
Then I decided to calculate a parabola which passes close to the points around the peak, and not inevitably on these points. So i can use more than 3 points (i use up to 40 points which are more than half of the peak), and the results are visibly better.
> lines on the left show harmonics 1/3, 1/5 ..(??? these should be on the right, that is at higher frequencies!).
It's not multiples but fractions : for 600 Hz, the lines are : 200 Hz, 120 Hz, ...
I don't represent multiples because they are not very useful : the higher the frequency is, the less there are points, so we have less precision.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the new release.
I have built 0.9.0 on windows from the tar.gz download file.
the Makefile.mingw was missing - I hacked Makefile.cygwin to built the audio dll
The rest
of the build went fine. Here are my comments:
The auto detect is not working as well as mine - it frequently goes up one semitone for no very obvious reason. My guess, looking at the code is that the trouble is that where I had
int pitch = Name2Pitch(pitchname); // note found this time
you have substituted
int pitch=round(Freq2Pitch(bestpeak_freq2)); // note found this time
I realize that getting pitch from the char* pitchname was a crude hack (one never passes numerical data around inside a program via strings) but you seem to have substituted something that has a different value (perhaps something that should work better?) What I did was based on the observation that the field "Found Pitch" in the display was consistently correct, so I stole that value.
for the frequency and target frequency and Near Desired Pitch boxes. This makes it clear that you are tuning to something other than A440.
I notice that the display for the strings of instruments other than guitar
is scrambled (extra strings overlapping the right ones).
Harpsichord Tuning
As I mentioned in my first posting, my special requirement is harpsichord tuning which has several special circumstances. The only one that really mattered was the auto select, and this is working perfectly for me. But I thought I would also re-arrange the display so that I could easily see the tuning bar (red/green/red) from across the room, as I don't have a laptop. And while doing this I thought it would be nice to arrange the target note and octave to be very large too, so that I could be reassured that the auto-detect has happened. (In actual fact it always does work perfectly, so I can tell just by the red/green/red tuning bar behaviour).
The only problem was that Qt4 designer doesn't work with these .ui files, you can edit but not use the result directly. However I did get this bit of .ui code
<property name="font" >
<font>
<family>MS Shell Dlg</family>
<pointsize>144</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
I got this by using the object editor in Qt4 designer on the converted form1.ui code, and I put this in my original form1.ui (at the QComboBox) by hand and the result is the note names in a large font size which I can see from my harpsichord (2-3m away). This of course then requires re-designing all the frames/forms/containers etc. I have had to hack these by hand. So now I have:
1) a large red/green/red bar for guiding the tuning. This fills the top half of the screen, and
2) The bottom 1/3 of the screen shows the note and octave selected in the 144pt typeface.
(The beautiful spectrum display is absent altogether :-( sigh...)
The question is: is it worth re-modelling accordeur to have the possibility of switching to a display like this? Perhaps not. It will require a full port to Qt4 and then working with Qt4 designer to re-design form1. I can't do this myself - I have never worked with Qt before - but I will post up my hacked code if anyone needs it.
Finally, it is only a subjective impression, but it seems to me that the tuning accuracy of accordeur is far better than the commercial tuning gadgets available to non-millionaires.
Richard Shann
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
The release 0.9.1 is now fully ported to Qt4.
I have slightly modified code for auto-select and it seems to work good for me with my guitar.
Does it work for you?
A switch to a big display is a good idea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have built from source using Qt4 and fixed one small bug with Qt designer.
I have made a short trial of the new auto-detect and it seems to be working reliably now - it followed me from C2 up to E6 without any difficulty!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I spoke too soon about it following the notes up chromatically reliably - I was able to do a direct comparison of the algorithms by running two versions of accordeur simulataneously. The new code added in was definitely preventing auto-select at about octave 3 and above. So I have put on CVS a version of form1.cpp which does not use that code when the harpsichord tab is selected.
It will be difficult to develop this program for sensitivity to various instruments without keeping test samples - we could do this - we could even record them using the program.
best wishes
Richard Shann
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've had some more experience using accordeur to tune my harpsichord, and there is still a difference in performance between the version (based on 0.7.0) I first made and the current version (based on 0.9.1) that I put on CVS. With the latter, once the note has decayed away, the display switches to maximum blue bar, that is the note is declared to be very sharp. This is accompanied by corresponding changes to the bestpeak_freq2 value. On the earlier version, the display remains fixed once the note has died down, with the same value of bestpeak_freq2 being found on each expiry of the timer. Only very occaisionally does it change, sometimes to a nan.
The only obvious difference I can see is the PART_DERNIER value which has changed, but this does not affect the behaviour.
It is no more than a nuisance, since re-striking the note always returns the display to its senses.
Are you happy to make a release yet, or do you thing the interface needs re-thinking?
best wishes
Richard Shann
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am happy to make a release. If you want to make changes to CVS, take care to make a cvs update, because i have made some changes (Save preferences i n File menu).
To avoid the nuisance, i have thinked to change the lines :
float db = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
gotPitch = gotSound && (db > BACKGROUND_DB);
}
to something like this :
float db = INF_DB;
static float maxdb = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
if(db>maxdb) maxdb=db;
gotPitch = gotSound && (db > maxdb-20);
}
But i have not tested.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a question to ask you.
It seems that you use the correction of A4 differently from what I had provided.
I had made it initially to correct the defect of frequency of certain computers. I indeed have an old laptop for which the measured frequency is false of almost a half semitone !
According to your remark in the feature requests, you use it with another aim.
Can you explain how you use it ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About the correction for A4, yes I had another thing in mind. I didn't realize there was a problem with some computers not having an accurate clock readily available.
My use for the A4 correction is to play at a pitch other than 440Hz.
Sometimes people do want to play at pitches other than A4-440. For example, for historical reasons, or in order to play with a particular instrument that plays at a different pitch and which cannot be altered.
Indeed, sometimes you know what pitch the instrument will be at, but the musician has not yet arrived and you want to tune ready for when he comes. In this last case you need to tune to a pitch which you would like to specify explicitly (e.g. as so many cents sharp or flat compared with A440), rather than by producing a note on the instrument.
About the code
float db = INF_DB;
static float maxdb = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
if(db>maxdb) maxdb=db;
gotPitch = gotSound && (db > maxdb-20);
}
I've tried this out and it does not change the behaviour I see. I did some experiments and the strange thing is that the earlier version works not because gotPitch becomes FALSE but because the value found stays the same at each timerEvent. That is I put in a little flag so I could see whether gotPitch was staying TRUE and hence the best peak/freq2 value was being updated (when the note had died away) and it was, but presumably to the same value each time. This surprised me, as it seemed much more likely that either gotPitch or gotSound would be FALSE once the note had died away.
If you have a trace of what changed between the two versions besides PART_DERNIER it should be easy to see what the cause is - the problem being of course that we have gone from form1.ui.h to form1.cpp so it isn't as simple as diffing two files.
Richard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a harpsichord maker, and when my Korg tuner went bust I started searching for something to replace it and found the wonderful accordeur program.
Accordeur is doing a beautiful job for tuning my harpsichord - it always recognizes what note I am playing as long as the correct octave is set. The harpsichord is different from the guitar etc in some ways:
1) It is too large to move close to the computer.
2) The strings are always nearly in tune (within 1/4 semitone).
3) You tune the notes chormatically one after the other.
4) There are 180 strings to tune, so you *really* want the auto-detect feature.
What would be marvellous would be to auto-detect either the semitone above or below - then as you move on to the next note it would always find it (including octave changes) - you would only need to set the initial note on the computer and you could tune the entire instrument without having to use the mouse.
The noise could still be a problem - perhaps the BACKGROUND_DB could be made adjustable?
By the way, I could help with English translations of the help pages (le franc,ais que je parle est tre's mauvais, mais sans dou^te, suffirait? if you will pardon my ASCII :-), if that would be welcomed by you.
Great Work!
Richard Shann
Since posting this I have managed to build accordeur, and fiddled around with BACKGROUND_DB, but I couldn't find a value that would stop the program detecting spurious notes. What will work I think will be to ignore notes unless they persist, since the detected notes due to noise change all the time whereas the real notes hold steady for a second or two (with a harpsichord).
BTW I had to use Qt4 to build accordeur, because I could not get hold of a binary for Qt3.
Richard Shann
I thought already of the possibility of activating the auto-select on the piano tab, but I believe that that will not be as effective as with the guitar.
I have also tried to change the value of BACKGROUND_DB, without success. It is indeed the duration of the note which is to be taken into account. There is perhaps also something to do with the harmonics.
My english is bad, so your help for the help pages is very welcome (translation and perhaps enhancement?). I have added you to developers list,so you can directly change the pages. You can also send me your pages if you preffer.
Thank you for your reply - I can't directly update the program because I can't build the sources (because of the lack of a Qt3 environment).
However I have made some code which is working for me ( I have just tuned my harpsichord without needing someone sitting at the computer changing the note for me!).
The code is inserted at the point in form1 where you have the comment
// sélection de la meilleure corde :
Here is the code that I wrote, with some questions about bits I don't understand. Below are some diffs for the docs/help.html and docs/index.html which are intended to improve the English; there are also some questions inserted here - in particular, the harmonics are indicated in the wrong place aren't they?
// Auto selection - switch the target Pitch if the found note is
// an adjacent semitone (for tuning chromatic instruments)
{
int pitch = Name2Pitch(pitchname); // note found this time
int note = pitch%12;
int oct = pitch/12 -1;
static int last_pitch=-1; // to check if same note found
static int confidence; // repeated finding of same note builds confidence
if(pitch == last_pitch) {
if( Pitch-pitch == 1 || Pitch-pitch == -1 )
{
confidence++;
if(confidence>2) {
confidence = 0;
Pitch = note+(oct+1)*12;
CBNote->setCurrentItem(note);//is this needed?
SPOctave->setValue(oct);//is this needed?
adjWindow(Pitch);//is this needed?
}
}
else
confidence = 0;
}
last_pitch = pitch;
}
diff for index.html
68,69c68,69
< </span> Accordeur is a program designed
< to help you to tune your musical instrument.<br>
---
> </span> Accordeur is a software designed
> to help you to tune your music instrument.<br>
74c74
< Essential differences are :<br>
---
> Essentials differences are :<br>
76,77c76,77
< <li>It displays the analysed spectrum.</li>
< <li>For low pitches it changes number of samples, so low pitch
---
> <li>Display analysed spectrum.</li>
> <li>For grave pitches, changes number of samples, so very grave
80,81c80,81
< <li>Refinement of the pitch is made by
< parabolic, not cubic interpolation.(??? is that what you do?) </li>
---
> <li>Fine compute of the pitch is made by searching nearest
> parabole, not by cubic interpolation.</li>
diff for help.html
66,67c66,67
< <li>Click on the button "Calibrate background noise". This allows
< a better analysis by ignoring sounds which are buried in the noise.</li>
---
> <li>Click on button "Calibrate background noise". This allow
> better anlyze by ignoring sounds which are under the noise.</li>
70c70,71
< <li>If you want to tune so as to play with a slightly sharp or flat instrument sound A4 on that instrument and then click on "Calibrate A4". Note that the display does not change - it still says A440 but it now shows the instrument as being in tune at standard pitch. (This is confusing! It would be better to display the true frequency being measured, and the adjusted A440 frequency as the "Perfect" target).<br>
---
> <li>If you want to adjust measure to match a tuning fork : play
> tuning fork then click on "Calibrate A4".<br>
74c75
< <li>Choose the pitch to tune.<br>
---
> <li>Choose pitch to tune.<br>
78c79
< <li>Play it on the instrument.</li>
---
> <li>Play it in the instrument.</li>
81,85c82,86
< <li>Tune instrument so that the peak of the spectrum is just on the green line.
< The first red line to the left shows the pitch one semitone lower. The
< red line to the right shows a semitone above. The other red
< lines on the left show harmonics 1/3, 1/5 ...(??? these should be on the right, that is at higher frequencies!). They make it possible to
< refine the adjustment even more.</li>
---
> <li>Tune instrument so that the peak is just on the green line.
> First red line on the left show the first pitch under the goal. First
> red line to the right show the first pitch over the goal.Others red
> lines on the left show harmonics 1/3, 1/5 ... They make it possible to
> refine even more the adjustment.</li>
88,92c89,90
< <li>Alteratively you can refine the tuning by bringing
< the frequency displayed as "Frequence"(!! this should be "Frequency", or "Detected Frequency") to the frequency show as "Perfect".</li>
< </ul>
< <ul>
< <li>For a simple tuning, use the coloured bar below the spectrum. This is red and to the right when below pitch, centred and green when on pitch, and red and to the left when above the pitch specified.</li>
---
> <li>Finally to refine the tune by as much as possible bringing
> closer the frequency displayed the frequency of the desired pitch.</li>
Thank you!
I have also wrote code for auto-select, included in release 0.8.0.
But your code is different and more interesting for your tuning method (from lower pitch to higher, or from higher to lower). So I will include it in release 0.9.0.
Many thanks for your corrections in the docs files. I have learned english late, and only to read books on computers, so it's very difficult to me to wrote a correct english (google is useful but gives often very strange results).
> Refinement of the pitch is made by parabolic, not cubic interpolation.(??? is that what you do?)
More explanations :
Other programs i have tested use a cubic interpolation : they use the highest point and the two neighbors, and calculate the cubic curve which passes exactly by this points. This method has two disadvantages : we can't use more than 3 points and it gives sometimes obviously bad results, very different from one measurement to another.
Then I decided to calculate a parabola which passes close to the points around the peak, and not inevitably on these points. So i can use more than 3 points (i use up to 40 points which are more than half of the peak), and the results are visibly better.
> lines on the left show harmonics 1/3, 1/5 ..(??? these should be on the right, that is at higher frequencies!).
It's not multiples but fractions : for 600 Hz, the lines are : 200 Hz, 120 Hz, ...
I don't represent multiples because they are not very useful : the higher the frequency is, the less there are points, so we have less precision.
Thank you for the new release.
I have built 0.9.0 on windows from the tar.gz download file.
the Makefile.mingw was missing - I hacked Makefile.cygwin to built the audio dll
The rest
of the build went fine. Here are my comments:
The auto detect is not working as well as mine - it frequently goes up one semitone for no very obvious reason. My guess, looking at the code is that the trouble is that where I had
int pitch = Name2Pitch(pitchname); // note found this time
you have substituted
int pitch=round(Freq2Pitch(bestpeak_freq2)); // note found this time
I realize that getting pitch from the char* pitchname was a crude hack (one never passes numerical data around inside a program via strings) but you seem to have substituted something that has a different value (perhaps something that should work better?) What I did was based on the observation that the field "Found Pitch" in the display was consistently correct, so I stole that value.
Some other comments
I suggest
TLFreqId->setText(QString("%1").arg(cor_A4*PitchToFreq(Pitch),6,'f',2));
TLFreq->setText(QString("%1").arg(cor_A4*bestpeak_freq2,6,'f',2));
TLFreq3->setText(QString("%1").arg(cor_A4*bestpeak_freq2,6,'f',2));
for the frequency and target frequency and Near Desired Pitch boxes. This makes it clear that you are tuning to something other than A440.
I notice that the display for the strings of instruments other than guitar
is scrambled (extra strings overlapping the right ones).
Harpsichord Tuning
As I mentioned in my first posting, my special requirement is harpsichord tuning which has several special circumstances. The only one that really mattered was the auto select, and this is working perfectly for me. But I thought I would also re-arrange the display so that I could easily see the tuning bar (red/green/red) from across the room, as I don't have a laptop. And while doing this I thought it would be nice to arrange the target note and octave to be very large too, so that I could be reassured that the auto-detect has happened. (In actual fact it always does work perfectly, so I can tell just by the red/green/red tuning bar behaviour).
The only problem was that Qt4 designer doesn't work with these .ui files, you can edit but not use the result directly. However I did get this bit of .ui code
<property name="font" >
<font>
<family>MS Shell Dlg</family>
<pointsize>144</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
I got this by using the object editor in Qt4 designer on the converted form1.ui code, and I put this in my original form1.ui (at the QComboBox) by hand and the result is the note names in a large font size which I can see from my harpsichord (2-3m away). This of course then requires re-designing all the frames/forms/containers etc. I have had to hack these by hand. So now I have:
1) a large red/green/red bar for guiding the tuning. This fills the top half of the screen, and
2) The bottom 1/3 of the screen shows the note and octave selected in the 144pt typeface.
(The beautiful spectrum display is absent altogether :-( sigh...)
The question is: is it worth re-modelling accordeur to have the possibility of switching to a display like this? Perhaps not. It will require a full port to Qt4 and then working with Qt4 designer to re-design form1. I can't do this myself - I have never worked with Qt before - but I will post up my hacked code if anyone needs it.
Finally, it is only a subjective impression, but it seems to me that the tuning accuracy of accordeur is far better than the commercial tuning gadgets available to non-millionaires.
Richard Shann
Hello,
The release 0.9.1 is now fully ported to Qt4.
I have slightly modified code for auto-select and it seems to work good for me with my guitar.
Does it work for you?
A switch to a big display is a good idea.
I have built from source using Qt4 and fixed one small bug with Qt designer.
I have made a short trial of the new auto-detect and it seems to be working reliably now - it followed me from C2 up to E6 without any difficulty!
Great! I've done a CVS co on accordeur and will look at it.
I spoke too soon about it following the notes up chromatically reliably - I was able to do a direct comparison of the algorithms by running two versions of accordeur simulataneously. The new code added in was definitely preventing auto-select at about octave 3 and above. So I have put on CVS a version of form1.cpp which does not use that code when the harpsichord tab is selected.
It will be difficult to develop this program for sensitivity to various instruments without keeping test samples - we could do this - we could even record them using the program.
best wishes
Richard Shann
I've had some more experience using accordeur to tune my harpsichord, and there is still a difference in performance between the version (based on 0.7.0) I first made and the current version (based on 0.9.1) that I put on CVS. With the latter, once the note has decayed away, the display switches to maximum blue bar, that is the note is declared to be very sharp. This is accompanied by corresponding changes to the bestpeak_freq2 value. On the earlier version, the display remains fixed once the note has died down, with the same value of bestpeak_freq2 being found on each expiry of the timer. Only very occaisionally does it change, sometimes to a nan.
The only obvious difference I can see is the PART_DERNIER value which has changed, but this does not affect the behaviour.
It is no more than a nuisance, since re-striking the note always returns the display to its senses.
Are you happy to make a release yet, or do you thing the interface needs re-thinking?
best wishes
Richard Shann
I am happy to make a release. If you want to make changes to CVS, take care to make a cvs update, because i have made some changes (Save preferences i n File menu).
To avoid the nuisance, i have thinked to change the lines :
float db = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
gotPitch = gotSound && (db > BACKGROUND_DB);
}
to something like this :
float db = INF_DB;
static float maxdb = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
if(db>maxdb) maxdb=db;
gotPitch = gotSound && (db > maxdb-20);
}
But i have not tested.
I have a question to ask you.
It seems that you use the correction of A4 differently from what I had provided.
I had made it initially to correct the defect of frequency of certain computers. I indeed have an old laptop for which the measured frequency is false of almost a half semitone !
According to your remark in the feature requests, you use it with another aim.
Can you explain how you use it ?
About the correction for A4, yes I had another thing in mind. I didn't realize there was a problem with some computers not having an accurate clock readily available.
My use for the A4 correction is to play at a pitch other than 440Hz.
Sometimes people do want to play at pitches other than A4-440. For example, for historical reasons, or in order to play with a particular instrument that plays at a different pitch and which cannot be altered.
Indeed, sometimes you know what pitch the instrument will be at, but the musician has not yet arrived and you want to tune ready for when he comes. In this last case you need to tune to a pitch which you would like to specify explicitly (e.g. as so many cents sharp or flat compared with A440), rather than by producing a note on the instrument.
About the code
float db = INF_DB;
static float maxdb = INF_DB;
if (gotSound) {
db = level2db(avg_abs);
if(db>maxdb) maxdb=db;
gotPitch = gotSound && (db > maxdb-20);
}
I've tried this out and it does not change the behaviour I see. I did some experiments and the strange thing is that the earlier version works not because gotPitch becomes FALSE but because the value found stays the same at each timerEvent. That is I put in a little flag so I could see whether gotPitch was staying TRUE and hence the best peak/freq2 value was being updated (when the note had died away) and it was, but presumably to the same value each time. This surprised me, as it seemed much more likely that either gotPitch or gotSound would be FALSE once the note had died away.
If you have a trace of what changed between the two versions besides PART_DERNIER it should be easy to see what the cause is - the problem being of course that we have gone from form1.ui.h to form1.cpp so it isn't as simple as diffing two files.
Richard