Music/Sampling theory: stuck in understanding frequency and cents

How to do this, that and the other. Share, learn, teach. How did X do that? How can I sound like Y?
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm a very noob in this field, so please pardon me if the question is stupid.

I've found a nice formula to calculate the new pitch at a samplerate change, here in this forum.
Peel wrote: Sun Oct 30, 2005 4:05 pm 1200(log(ratio))/log(2) = cents
1200(log(44.1/48))/log(2) = -146.7
The result is in cents. And this bothers me a lot, 'cause the value of a cent depends of the frequency of the two semitones the cent is between, and so i don't understand that cents ... cents of what?
What's the final tune of a A4 (440Hz) sine wave, sampled at 48KHz, if played at 44.1KHz? Have i to calculate the value of the first 100 cents (between A4 and G#4) and the remaining 46.7 between between G#4 and G4?

I'm a bit lost ....
Ensoniq SQ1, Korg Wavestation A/D

Post

Context money: a cent is 1/100th of the full unit, eg dollar or euro.
Context music: a cent is 1/100th of a semitone, eg C to C# or E to F.

See the link in my signature...
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

Music and all its parts can be looked at in abstract technical ways or using established naming etc.

While technically yes C4 is x Hz and 16/44 is at x kHz, that is totally stepping over that (as Big Bad Bert says) a Cent is 1/100th of a semitone. This makes it equally easy to tune any note/sample regardless of root note as +20 cents is the same offset a C1 as it is at G8.

Focus on the nomenclature of music and totally ignore the chatter about tangential technicalities. I never think about sample rate as a composer as it is nothing to do with what I do when making music. Sure when I export, I have my DAW set to spit out 16/44 but really I only needed to set that once (because it is industry standard CD rate).
:-)

Post

Parduz wrote: Thu Dec 14, 2023 4:26 pm What's the final tune of a A4 (440Hz) sine wave, sampled at 48KHz, if played at 44.1KHz?
So I'm using my page here https://www.bertkoor.nl/MusicCalc.html to do these calculations.

Start with setting the sampling rate to 48kHz at the top and input frequency as 440 Hz.
The note is 109.0909 samples long. If we round that to 109 samples (a fraction shorter) then the note is sharp (too high) by 1.44 cents.

Switch the sampling frequency back to 44.1kHz and fill in the length of 109 samples. The result is G# (or Ab) minus 45.26 cents. If it were another 5 cents more flat (lower) and be 50 cents, then it would be smack inbetween the G and G#.

Musical notes are distributed logarithmical along the frequency axis. An octave is twice or half the frequency:

A0 = 27.5 Hz
A1 = 55 Hz
A2 = 110 Hz
A3 = 220 Hz
A4 = 440 Hz
A5 = 880 Hz
A6 = 1760 Hz
A7 = 3520 Hz
A8 = 7040 Hz
A9 = 14080 Hz

With each octave divided in twelve semitones, the factor by which two semitones are apart is 2 ^ (1/12) = 1.059463. In other words, if you multiply 1.059463 by itself twelve times, the outcome is exactly 2.0 : the octave.
A finer division is the cent. 1.059463 ^ (1/100) = 1.00057779.
The constant "1200" in your formulas is exactly that: twelve semitones divided into a hundred parts, in total 1200 parts that logarithmically make up the factor "2" which represents an octave.

440 Hz plus one cent = 440 * 1.00057779 = 440.2542 Hz.
Plus another cent = 440.5086 Hz. Repeat the multiplication a hundred times, and the result should be 466.164.
If it were linear instead of logarithmical, we would add 0.2542 a hundred times and end up at 440 + 25.42 = 465.42 Hz. The difference is 0.744 Hz and merely 2.76 cents flat from 466.164 Hz.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

The width of a note will vary depending on temperament. Equal temperament is convenient for instruments with fixed tuning, like keyboards and fretted instruments. But the pitches are not musically consonant.

In other words, in equal temperament, every note is a little out of tune. Except for major thirds, which are a lot out of tune.
THIS MUSIC HAS BEEN MIXED TO BE PLAYED LOUD SO TURN IT UP

Post

Parduz wrote: Thu Dec 14, 2023 4:26 pm I've found a nice formula to calculate the new pitch at a samplerate change...
This is perhaps the source of the confusion. You've found a formula that calculates the new pitch, not the new frequency. Same thing, different scale: one is logarithmic with respect to the other. This conversion is essentially saying you want a logarithmic unit (cents) at the end of it.

Getting a result in frequency is significantly simpler and doesn't require chucking logarithms around:

oldfreq[newrate/oldrate] = newfreq
What's the final tune of a A4 (440Hz) sine wave, sampled at 48KHz, if played at 44.1KHz?
My equation converts 440 Hz into 404.25 Hz.
Your original equation converts A4 into G4+53.7

Post Reply

Return to “Production Techniques”