Oops - wrong sample rate - help ?

Discuss hardware/software tools and techniques involved in capturing sound, in the studio, live or on location.

Oops - wrong sample rate - help ?

Post by Lizardpoint »

Morning team,
I just got some vocals back from a singer on Fiverr. The vocals are great but out of tune/with my track back at this end.
I think they imported my 48k track into a 44.1k session and then sang to that. The result is although they sound great, they are unusable. Is there any clever way I can save this or will they need to be redone ?
Cheers
Dave
User avatar
Lizardpoint
Regular
Posts: 209 Joined: Sat Oct 18, 2003 12:00 am Location: Biggin Hill, Kent

Re: Oops - wrong sample rate - help ?

Post by The Elf »

Been here. Done this.

You need to re-tune the audio they've returned to you. Problem is - did they work to a time-stretched version of the audio you sent?

Get them to send an export of the audio they worked to, so you can hear it as they heard it. Import it into your project and see if it matches in time. Then you can see if stretching needs to be done.

If it matches in time, but not in pitch then stretching will be required. If it doesn't match in time then it may simply be a case of re-pitching the audio without stretching.

And then there's the maths involved in calculating the new pitch. I have to re-learn this every time I do it, but essentially it involves working out out one of those sample rates as percentage of the other and using this to re-pitch the audio you want to keep. Hopefully someone will be along here with the formula!

I'd advise stretching both the added audio and the backing they send at the same time. If the re-pitched/stretched backing matches your project then so should the added audio.
Last edited by The Elf on Tue Mar 07, 2023 12:38 pm, edited 2 times in total.
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by Wonks »

Is it worth just trying a sample rate converter on one file so see if that fixes the issue before trying to pitch shift and stretch?
User avatar
Wonks
Jedi Poster
Posts: 18690 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Oops - wrong sample rate - help ?

Post by Sam Spoons »

I'd just add, how hard will it be to get it redone? Unless it was a brilliant, unrepeatable performance redoing it will always give the best results.

If it's from fivver they should probably redo it for free as the error was at their end but they may not be happy with that?
User avatar
Sam Spoons
Forum Aficionado
Posts: 22212 Joined: Thu Jan 23, 2003 12:00 am Location: Manchester UK
People often mistake me for a grown-up because of my age.

Re: Oops - wrong sample rate - help ?

Post by The Elf »

Wonks wrote: Tue Mar 07, 2023 12:36 pm Is it worth just trying a sample rate converter on one file so see if that fixes the issue before trying to pitch shift and stretch?

That's essentially what I'm suggesting. Re-pitching without stretch is really just sample rate conversion. You really need the backing they worked to to be sure of what you're hearing, though.
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by Hugh Robjohns »

Sample rate conversion doesn't change pitch or duration. It resamples at a new rate the waveform reconstructed from the first sample rate.

In the situation above the original backing track file has been replayed at the wrong rate, hence the pitch has changed. Just like varispeeding a tape machine.

Not sure how they managed that. Most DAWs will automatically SRC a file if its at a different sample rate to the project when its imported.

48 to 44.1k (or vice versa) is about an 8% varispeed change.

Ideally, I'd get the vocals re-recorded properly. You can varispeed the vocal to fit, but the formats will move and it won't sound like the original voice anymore. It may be unnoticeable to most, but I bet the singer will know!
User avatar
Hugh Robjohns
Moderator
Posts: 42808 Joined: Fri Jul 25, 2003 12:00 am Location: Worcestershire, UK
Technical Editor, Sound On Sound...
(But generally posting my own personal views and not necessarily those of SOS, the company or the magazine!)
In my world, things get less strange when I read the manual... 

Re: Oops - wrong sample rate - help ?

Post by The Elf »

Hugh Robjohns wrote: Tue Mar 07, 2023 12:51 pm Sample rate conversion doesn't change pitch or duration. It resamples at a new rate the waveform reconstructed from the first sample rate.

I shouldn't have used the word 'conversion' above. What I'm suggesting is changing the playback rate.

Yep, it's going to alter the tone of a vocal. Maybe not so important for other instrumentation.
Last edited by The Elf on Tue Mar 07, 2023 1:25 pm, edited 1 time in total.
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by Hugh Robjohns »

:thumbup:
User avatar
Hugh Robjohns
Moderator
Posts: 42808 Joined: Fri Jul 25, 2003 12:00 am Location: Worcestershire, UK
Technical Editor, Sound On Sound...
(But generally posting my own personal views and not necessarily those of SOS, the company or the magazine!)
In my world, things get less strange when I read the manual... 

Re: Oops - wrong sample rate - help ?

Post by ken long »

Hugh Robjohns wrote: Tue Mar 07, 2023 12:51 pm
Not sure how they managed that. Most DAWs will automatically SRC a file if its at a different sample rate to the project when its imported.

Probably a dialogue upon import asking if they wanted to change the session sample rate to match the imported file and they chose "no". Some DAWs don't subsequently and automatically convert the audio.
User avatar
ken long
Frequent Poster
Posts: 3619 Joined: Mon Jan 21, 2008 12:00 am Location: Somers Town
I'm All Ears.

Re: Oops - wrong sample rate - help ?

Post by Tomás Mulcahy »

What a mess. If they're a singer who is worth using they will be able to sing it the same again.

But there is a workaround. I sometimes have to deal with issues like this with collaborators. It's different for a paid service like you used, so I am not suggesting this as the best solution!

Do what Elf suggested, get the actual file/ DAW project and media they sang over. Drop that file, their vocal file , and the correct backing track into Melodyne Studio. It will line them all up for you. Manually correct pitch if necessary. Now export the vocal alone at the SR you need.
User avatar
Tomás Mulcahy
Frequent Poster
Posts: 2835 Joined: Wed Apr 25, 2001 12:00 am Location: Cork, Ireland.

Re: Oops - wrong sample rate - help ?

Post by merlyn »

To work out the change in pitch in cents the formula is

1200×log2(f2/f1)

In this case 1200×log2(48/44.1) = ~146.7 cents

Doing the calculation is complicated by the fact that calculators usually don't have a 'log to the base 2' button. So we use the property loga(x) = logb(x)÷logb(a). Calculators have a natural log button -- ln and a 'log to the base 10' button. So the calculation above in full is :

1200×ln(48/44.1)÷ln(2) = ~146.7 cents

That is nearly a semitone and a half sharp.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Oops - wrong sample rate - help ?

Post by Hugh Robjohns »

I love it when people show their working... :-D
User avatar
Hugh Robjohns
Moderator
Posts: 42808 Joined: Fri Jul 25, 2003 12:00 am Location: Worcestershire, UK
Technical Editor, Sound On Sound...
(But generally posting my own personal views and not necessarily those of SOS, the company or the magazine!)
In my world, things get less strange when I read the manual... 

Re: Oops - wrong sample rate - help ?

Post by The Elf »

:crazy::wtf:

So, for those of us who struggle with these things... :(

What calculation do I need to apply in percentage to convert:
44.1 to 48
48 to 44.1

And what calculation do I need to do to apply in +/- pitch values (i.e. 0.0 being no change) to convert:
44.1 to 48
48 to 44.1

I think many of us would appreciate it if you could give us the simple version that non-scientific calculators can handle.

As I mentioned, I've had to re-learn this every time I've had to do it. On the last album I had to re-pitch a backing track that had been shifted by an incorrect tape speed back in the 70s... re-pitch this to enable a whistle/pipes player to add his parts (since he couldn't re-tune his instruments)... and bring the player's audio back and re-pitch it to the original out-of tune tape version AND a corrected version to which I'd added my own parts.

Needless to say the maths for all this still has me waking up screaming in the night!
:headbang:
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by merlyn »

The percentage is easy enough :

48÷44.1×100 = ~108.84 that's an increase of ~8.84%

44.1÷48×100 = 91.875 that's a decrease of 8.125%

The relationship between frequency and pitch is logarithmic, so you need logs to calculate a pitch from frequencies. Tough luck. :D
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Oops - wrong sample rate - help ?

Post by The Elf »

merlyn wrote: Tue Mar 07, 2023 2:38 pm The relationship between frequency and pitch is logarithmic, so you need logs to calculate a pitch from frequencies. Tough luck. :D

Dear lord! That's me out then! :headbang::lol:
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by The Elf »

Image
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by Wonks »

User error
Last edited by Wonks on Tue Mar 07, 2023 2:53 pm, edited 1 time in total.
User avatar
Wonks
Jedi Poster
Posts: 18690 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Oops - wrong sample rate - help ?

Post by The Elf »

Image
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by merlyn »

Eh ... I don't know where you went wrong there but it's 146.7 cents, and -146.7 cents.

That may help get your head around logs. (Or not). With the percentages the increase and decrease are different , but with logs, because we're dealing with ratios, only the sign is reversed.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Oops - wrong sample rate - help ?

Post by The Elf »

I've saved those end numbers - the calculation I'll just smile at nicely and move on...

Hopefully they will help the OP.
User avatar
The Elf
Forum Aficionado
Posts: 21238 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Oops - wrong sample rate - help ?

Post by merlyn »

It's really not difficult. log2 measures how many octaves there are in a frequency ratio.

1 2 4 8

Those numbers are going up in octaves. log2(1/1) is 0. There are no octaves in that. log2 is the answer to the question "what power do I have to raise 2 to to get the number I want?" log2(2/1) is 1. There is one octave in that ratio. log2(4/1) is 2. There are two octaves in that frequency ratio. log2(8/1) is 3. There are three octaves in that ratio. Then multiply by 1200 to get the number of cents, as there are 1200 cents in an octave.

But sure, 146.7 cents is the answer to sampling rate mess-ups. :D
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Oops - wrong sample rate - help ?

Post by Wonks »

merlyn wrote: Tue Mar 07, 2023 2:56 pm Eh ... I don't know where you went wrong there but it's 146.7 cents, and -146.7 cents.

I noticed I'd multiplied by ln(2) rather than divided, hence the wrong value. I have a habit of clicking the wrong function when using the Windows calculator.
User avatar
Wonks
Jedi Poster
Posts: 18690 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Oops - wrong sample rate - help ?

Post by RichardT »

If it's certain the singer's software has interpreted a 48kHz audio file as 44.1kHz, you just need to do the opposite process on their vocal recording.

As people have said, this is not a normal thing to happen when importing audio into a DAW, but I guess that some other software might have changed the sample rate of their audio device behind the scenes and screwed things up in the DAW.

What you could do on the vocal recording is use something like Izotope RX to update the sample rate metadata on the file from 44.1 to 48 without actually resampling anything.

Then import to the original project.

The vocals will appear at the right pitch. However, they will not sound like the singer sang them at that pitch. It's probably worth a go though.

If you don't have RX or an equivalent, drop me a pm with a link and I'll do it for you.
RichardT
Longtime Poster
Posts: 5324 Joined: Fri Aug 13, 2004 12:00 am Location: UK

Re: Oops - wrong sample rate - help ?

Post by Tomás Mulcahy »

merlyn wrote: Tue Mar 07, 2023 3:09 pm It's really not difficult.

It is if someone has dyscalculia. Like me :) It takes about 10 times longer to figure out, and I need to re-learn it every time I need to use it again.
User avatar
Tomás Mulcahy
Frequent Poster
Posts: 2835 Joined: Wed Apr 25, 2001 12:00 am Location: Cork, Ireland.

Re: Oops - wrong sample rate - help ?

Post by merlyn »

Multiplication doesn't seem to cause so many problems. Multiplication is repeated addition. 4×3 means 4+4+4. The '×' is shorthand for repeated addition. 4×3 means 'add four to itself three times'. The inverse operation is division. We can get back to where we started with division. 4×3 = 12. 12÷3 = 4.

Powers of a number are repeated multiplication. 4^3, spoken as 'four cubed', means 4*4*4. The '^' is shorthand for repeated multiplication. 4^3 means 'multiply four by itself three times'. The inverse operation is 'log to the base of'. We can get back to where we started by taking a log. 4^3 = 64. log4(64) = 3.

That's how I understand it, and powers and logs are relevant to audio because of dBs and pitch.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.
Post Reply