RS-MET icon indicating copy to clipboard operation
RS-MET copied to clipboard

Emergency issue concerning rsGetShiftForBestMatch

Open elanhickler opened this issue 7 years ago • 5 comments

I am trying to phase align signals and client needs this done ASAP.

Hundreds of violin samples get aligned perfectly using this function. It has been working great for the longest time. Hundreds of viola, cello, and bass samples fail to get aligned.

I've done everything to make the violin and viola samples the same in terms of settings, frequency, variables, etc, except for the audio content. This issue is extremely frustrating, it makes no sense why the universe has decided only violin samples can get phase aligned.

I'll continue to post details of my experiments today.

elanhickler avatar Aug 12 '18 17:08 elanhickler

Hint 1: Samples align with themselves just fine. It only fails when the sample are from two different files.

Hint 2: Reducing audio to sine waves does not help.

Hint 3: Legato samples seem to be the problem, because Violin legato samples can align to everything, viola legato aligns to nothing. All sustains are alignable with each other. So it's just the legato samples it seems. Legato can align with itself so the problem is only viola or cello or bass legato -> any sustain

Hint 4: When I fuse the samples together so the legato and sustain are one piece of audio, and then cut it up and separate and then align, it works! (fuse means the pieces of audio become one larger file)

Hint 5: When I fuse the samples together, then unfuse them, it works again! Is this a possible indication of bad file metadata? And somehow fusing with a working file erases the bad metadata? Ok, let's try fusing two non-working legato samples and see if they still don't work.

Hint 6: Ok yes this is true, fusing two viola legato samples means alignment still doesn't work. It's only when it's fused with a working file that the alignment works! Yes confirmed, when I fuse a violin and viola legato sample, it works! It's only when fusing non-working samples that the fusing method does not work.

non-working + working = working non-working + non-working = non-working

elanhickler avatar Aug 12 '18 18:08 elanhickler

I'm going to use this workaround of fusing for now. This is no longer an emergency. We will have to come back to this, maybe after you finish the Multiband Compressor stuff.

elanhickler avatar Aug 12 '18 18:08 elanhickler

ok - but you will then have to explain some more what exactly you are actually doing and what is going wrong because i didn't understand a thing. ...but then, i don't really remember what rsGetShiftForBestMatch is doing anyway - maybe i should just look at the documentation. but at the moment liberty is more important

RobinSchmidt avatar Aug 14 '18 02:08 RobinSchmidt

The issue seems to be that certain wav files have issues, it must be something to do with the metadata. Re-rendering the wav file (gluing a good file with a bad file) fixes the bad file. That's all I know so far.

rsGetShiftForBestMatch reads two pieces of audio and finds how much to move one of them so that the waveforms are better aligned.

elanhickler avatar Aug 14 '18 02:08 elanhickler

ahh...ok - so you are time-aligning various different samples of the same instrument (at the same pitch), so they can be played simultaneously without phase cancellation issues. ...yeah - makes sense. i just forgot about that

RobinSchmidt avatar Aug 14 '18 03:08 RobinSchmidt