Comments on our video tutorials

Piano tuning algorithms

2 replies 2,451 views

Started by

lollobrigido

Member

Member

Opening post by lollobrigido

Posts
9
City
Givoletto

This comment specifically concerns the video published by Simone.

Before beginning, I would like to compliment him on the presentation of the topic of the thesis which I read with interest. I am a novice in this matter but I very much appreciated the theoretical/mathematical part that clarifies the derivation of the formula regarding "inharmonic" harmonics (I fully agree with the fact that you skipped the solution of the differential eq... it would have been tedious and out of context).

I am absolutely ignorant regarding tuning, so please forgive and eventually correct any inaccuracies I may present.

It seemed to me that I understood that many tuning software programs fail on lows and highs. Theoretically, I do not understand the reason because, in the highs, there are very few harmonics but... since they are not there for the software, they are not there for the ear either. As for low frequencies, perhaps the excess of harmonics makes analysis difficult, but I doubt it.

In my opinion, it is not the software that fails, but rather the platform on which it works, namely PCs.

Typically, sampling is around 44100Hz or 48kHz, which means that, although respecting Shannon, there is no phase coherence in the sampling. Towards the lows, since all sound cards are AC-coupled, there is a high-pass filter at the input due to which low frequencies are literally cut off.

That being said, if better hardware were made operating at 0dB, flat across all frequencies between 20 and 20 kHz, sampling at 96kHz—which is quite feasible nowadays—I believe that many of the problems could be resolved.

As for an algorithm, inspired by Simone's thesis:

1. the PC provides the A3 to which it tunes at 0 beats

2. the PC suggests the note to be played, for example F3, samples the sound, filters it with a notch on the partial of interest possibly "searching for it" in the vicinity, and then proposes the pure tone adjusted in frequency (and amplitude) in headphones to generate 0 beat with the isofrequency of the proposed note.

In this way, the tuner does not have to count beats and everything could take into account the characteristic inharmonicity of each string.

I will surely have overlooked a thousand details and technicalities that I do not know in my ignorance, but I hope to stimulate a discussion to gather some further information or ideas.

thank you for your attention,

Luca

Administrator

Reply 2 by Thesimon

Posts
4,504
City
Ariccia, RM
lollobrigido wrote:

It seemed to me that I understood that many tuning software programs fail on the lows and highs. Theoretically, I do not understand the reason because, in the highs, there are very few harmonics but... since they are not present for the software, they are not even present for the ear. As for low frequencies, perhaps the excess of harmonics makes analysis difficult, but I doubt it.

In my opinion, it is not the software that fails, but rather the platform on which it works, namely PCs.

Typically, sampling is around 44100Hz or 48kHz, which means that, although respecting Shannon, there is no phase coherence in the sampling. Towards the lows, since all sound cards are AC-coupled, there is a high-pass filter at the input due to which low frequencies are literally cut off.

That being said, if better hardware were made operating at 0dB, flat across all frequencies between 20 and 20 kHz, sampling at 96kHz—which is quite feasible nowadays—I believe that much of the problem could be resolved.

Thank you for the appreciation; I am glad that my work has sparked your interest.

The fact that the PC cannot tune high and low frequencies is an improper use of the term. In fact, the computer tunes both highs and lows very well, even to the hundredth! The problem, therefore, is not technical-objective in nature, but psychoacoustic-subjective in nature. It is we who listen to a piano that, tuned as science would want it, does not please our ear, and the proof (especially in the lows) is the beats that do not match. In the highs instead, as you well remembered, it is impossible for the human ear to listen beyond the second harmonic (out of range), so the reasoning cannot be made based on beats but based on the perception of the fundamental sound. The problem is that, even here, the ear tends to lower the frequency in the highs to the point where, to listen to that sound tuned as we like it, if we were to measure it technically, we would realize we have raised it compared to what was calculated by the PC (precisely to make it pleasing to our ear). How much the sound is raised is subjective and changes from person to person; therefore, if the problem is partially solvable in the lows by introducing a beat-counting algorithm, it becomes totally unsolvable at high frequencies precisely because it depends on the subjectivity of the listener, and everything that is not objective cannot be solved with algorithms.

Regarding the sampling discussion, we could even increase up to 192 kHz; this kind of hardware exists today, but it would not solve the issue precisely because it does not depend on a sort of technological lack, but rather on problems of a psychoacoustic nature.

Member

Reply 3 by maquieto

Posts
665
City
Massa Carrara

This thing is very interesting.

I had noticed many things but I hadn't understood them because I knew nothing about theoretical AI.

Incredible... in fact, this is why for every repertoire to be performed, the piano should be tuned differently... furthermore, the psychoacoustic factor also comes into play..

Truly very interesting for me, as I am quite curious, even from a scientific point of view regarding art... the art of sound and image.

Log in to participate