I'm really surprised. That worked!
Sunday, 11 July 2010 22:33This gets pretty geeky, but I deserve to brag about this a little.
Okay, so as I keep mentioning, I'm in the process off trying to finish up a new album by Pennsic. Most of the songs on it were recorded at last Pennsic.
Those songs are presenting me with a rat's nest of challenges:
1) They're noisy, having been recorded in a noisy environment (The Beast & Boar)
2) My levels were not as high as they could have been, so boosting them now raises the noise floor as well.
3) The Minidisc recorder I was using was starting to malfunction. It occasionally put little hiccups in the recording (very very tiny, usually <3/1000ths of a second.) Tho, they may have just been the products of a live recording in a compressed medium. Doesn't matter. There are glitches and they are annoying and fixing them is annoying.
So I'm mostly overcoming the noise challenges and in one case, found an alternate recording from a different venue that was about as good.
But today I managed to find a particularly NASTY bug, and the battle was won, but I had to get really creative.
Okay, usually one of these glitches sounds like a really short, faint 'tic' in the recording. Sometimes that's just the non-Superquality headphones clipping. But when it happens again and again, on repeated listenings to the same spot, trust me there's glitch in there.
So what I've gotten pretty good at doing is highlighting the portion of the wave file that has the glitch in it (it's really next to impossible to spot them at the resolution that lets you see what you're listening to and catch anything useful.) Yes, I *can* slow it down, but only by selecting a different sample speed which increases the length of the recording proportionally and so you have to mathematically reCALCULATE where you were. And then, it's still a 'tic' that you can hear but not see.
So anyway, I select a portion of the file that hopefully has the glitch in it. (It takes practice to be able to spot approximately where it's happening and pick a useful area around it)
And then, I have Audacity zoom in on that selected portion of the wave file. And zoom in. The best resolution is just before it turns into dots that represent the individual samples.
I also usually click on the little toggle that stretches the graph vertically some, to exaggerate the peaks and valleys because it makes the glitches easier to spot.
Then I comb thru the sample, wave by wave, looking at about 1/10th of a second or so per screen of about a couple of second's worth of audio, very carefully. Most of the time, the wave file will look like a very complicated cross between a sine wave with lots of harmonics with a bit of triangle wave mixed in. Vocals and Guitar look different, as do different vowels and consonants.
A very thick squiggle just before a big bushy mass of waves is often a "mic pop", which I fix with some targeted EQ. A glitch will look like a very small, jagged bit of mess on otherwise tidy, but semi-chaotic waves. The fix is to select that little bit of audio (which can be as small as a 10,000th of a second and big as 3/1000ths of a second, and apply Audacity's "Repair" function to it. TADA. The Repair function does a real kickass job of actually figuring out what that portion of the wave *should* look like and recalulates the samples until they are in line with that. The matches might not be exact, but a 1000th of a second, a single oscillation variation does not really show up in cognition, whereas the sudden clipping in a glitch does. Amazing, but true.
There's another type of glitch caused by misaligned edits or effects leaving artifacts where they start and stop. Those also make an audible 'tic', but it's actually a different timbre from the recording glitches. Those can be harder to see, but when they happen, I usually have clues as to where to look since I make notes where I start and stop effects applications. This is an important point for later.
I can usually catch the glitch now, on the first try or within about 10 minutes of combing thru the wave file.
BUT NOT for this one today. I could HEAR the click, and after an hour of combing and re-combing I still did not see it as an obvious anomaly in the waves. I did every trick I knew, INCLUDING copying the portion of the file to it's own file and slowing it WAY down to find the bad spot.
FINALLY, I kept finding what looked kind of like a glitch, but not really. Whether it was a true anomaly was a really tough call visually. So I assumed it was and tried to repair it- And the waveform that the Repair function produced was not really like what it should have given me. It was actually kind of wacky, and when I re-listened, the audible 'tic' was still there. What such things USUALLY tell me is that I didn't find the real culprit. But after looking and looking, and listening, I kept being led back to that one spot. Repairing didn't help it. Undoing the repair and selecting larger and smaller parts of the naughty (bit) kept:
1) Giving me wacky output
2) Keeping the audible 'tic'.
No matter what I did, I could not 'repair' this anomaly. The results were out of line with neighboring waves, and the audible 'tic' was still very audible.
Finally, I did a "Hail Mary" edit:
Okay, imagine this. For the 1/10 of a second or so where the glitch is, I'm singing a note on an "aaah". (Actually the word was "and", but "aaaah" was all that you heard. Deep down in the mix, there's also a faint guitar chord and deeper still there's crowd noise and whatever. So the bottom line is that that portion of the wave was NOT a very clean sine wave. There would be this *sort of* semi-repitious complex series of sequences of waves peaks and valleys of certain apmplitudes (except, over time, they would evolve as vowels turn into other vowels, consonants, and silences.) But imagine that the portion with the glitch looked something like this
U_v_l_n_U_v_l_nU-v-lln_U_v_l_n... Except, that there's a gradual subtle evolution in the sequences as they progress. The part that contained the glitch, after trying to repair it wound up looking like that U-v-lln bit- similar, but not really enough. So what I did was to select the sequence of waves JUST before it, and paste it right over that naughty bit, and position it as close to "lined" up with where the waves start and stop as I could. When I did that, and then listened to the result, the glitch 'tic' was in fact gone (which showed me that it WAS hiding in there somewhere), and what was left was that much fainter "t_c" that shows up sometimes on mis-aligned pastes or as an artifact at the beginnings or ends of effects applications.
So I selected the part of the audio at the end joint of the paste (Again, I make really exact notes about where I apply these things, including positioning down to the millisecond), applied the "repair" function to that junction,.... and ....
TADA!!!! OMG!!! IT WORKED!!!
The side effect of doing pastes like this is that you can run the risk of messing up the sync between different tracks if you're not careful about trimming the edits to exact lengths. But in this case, we were talking about potentially inserting less than a millisecond delay into the track. *I* could not hear any difference.
So what I did was:
with a sampling rate of ~44k, that works out to be about 4 samples/ millisecond, and I replaced about 8 samples of (broken) audio with the preceding 8 samples and then tweaked the final sample in that sequence so that it made a smooth transition into the next group.
And I got away with it.
I'm not sure how or why, except that I guess I replaced some broken bits with some other bits that were close enough to how it *should* sound that they made a result that sounds enough like what it should have been that it might as well be counted as right as far as perception goes.
I'm reeling from just the concept of "close enough" actually working. 1/1000th of a second, I can buy. One wave, I can understand. This was close to 5 waves over two thousandths of a second.
But I guess the perspective is that repeating 2/1000ths of a second of an audio track is not something humans are gonna catch after all. Not like they might catch an obvious glitch of waves that are nothing at all similar to the samples they interrupt.
I'm proud of having done this, but annoyed that I had to.
Okay, so as I keep mentioning, I'm in the process off trying to finish up a new album by Pennsic. Most of the songs on it were recorded at last Pennsic.
Those songs are presenting me with a rat's nest of challenges:
1) They're noisy, having been recorded in a noisy environment (The Beast & Boar)
2) My levels were not as high as they could have been, so boosting them now raises the noise floor as well.
3) The Minidisc recorder I was using was starting to malfunction. It occasionally put little hiccups in the recording (very very tiny, usually <3/1000ths of a second.) Tho, they may have just been the products of a live recording in a compressed medium. Doesn't matter. There are glitches and they are annoying and fixing them is annoying.
So I'm mostly overcoming the noise challenges and in one case, found an alternate recording from a different venue that was about as good.
But today I managed to find a particularly NASTY bug, and the battle was won, but I had to get really creative.
Okay, usually one of these glitches sounds like a really short, faint 'tic' in the recording. Sometimes that's just the non-Superquality headphones clipping. But when it happens again and again, on repeated listenings to the same spot, trust me there's glitch in there.
So what I've gotten pretty good at doing is highlighting the portion of the wave file that has the glitch in it (it's really next to impossible to spot them at the resolution that lets you see what you're listening to and catch anything useful.) Yes, I *can* slow it down, but only by selecting a different sample speed which increases the length of the recording proportionally and so you have to mathematically reCALCULATE where you were. And then, it's still a 'tic' that you can hear but not see.
So anyway, I select a portion of the file that hopefully has the glitch in it. (It takes practice to be able to spot approximately where it's happening and pick a useful area around it)
And then, I have Audacity zoom in on that selected portion of the wave file. And zoom in. The best resolution is just before it turns into dots that represent the individual samples.
I also usually click on the little toggle that stretches the graph vertically some, to exaggerate the peaks and valleys because it makes the glitches easier to spot.
Then I comb thru the sample, wave by wave, looking at about 1/10th of a second or so per screen of about a couple of second's worth of audio, very carefully. Most of the time, the wave file will look like a very complicated cross between a sine wave with lots of harmonics with a bit of triangle wave mixed in. Vocals and Guitar look different, as do different vowels and consonants.
A very thick squiggle just before a big bushy mass of waves is often a "mic pop", which I fix with some targeted EQ. A glitch will look like a very small, jagged bit of mess on otherwise tidy, but semi-chaotic waves. The fix is to select that little bit of audio (which can be as small as a 10,000th of a second and big as 3/1000ths of a second, and apply Audacity's "Repair" function to it. TADA. The Repair function does a real kickass job of actually figuring out what that portion of the wave *should* look like and recalulates the samples until they are in line with that. The matches might not be exact, but a 1000th of a second, a single oscillation variation does not really show up in cognition, whereas the sudden clipping in a glitch does. Amazing, but true.
There's another type of glitch caused by misaligned edits or effects leaving artifacts where they start and stop. Those also make an audible 'tic', but it's actually a different timbre from the recording glitches. Those can be harder to see, but when they happen, I usually have clues as to where to look since I make notes where I start and stop effects applications. This is an important point for later.
I can usually catch the glitch now, on the first try or within about 10 minutes of combing thru the wave file.
BUT NOT for this one today. I could HEAR the click, and after an hour of combing and re-combing I still did not see it as an obvious anomaly in the waves. I did every trick I knew, INCLUDING copying the portion of the file to it's own file and slowing it WAY down to find the bad spot.
FINALLY, I kept finding what looked kind of like a glitch, but not really. Whether it was a true anomaly was a really tough call visually. So I assumed it was and tried to repair it- And the waveform that the Repair function produced was not really like what it should have given me. It was actually kind of wacky, and when I re-listened, the audible 'tic' was still there. What such things USUALLY tell me is that I didn't find the real culprit. But after looking and looking, and listening, I kept being led back to that one spot. Repairing didn't help it. Undoing the repair and selecting larger and smaller parts of the naughty (bit) kept:
1) Giving me wacky output
2) Keeping the audible 'tic'.
No matter what I did, I could not 'repair' this anomaly. The results were out of line with neighboring waves, and the audible 'tic' was still very audible.
Finally, I did a "Hail Mary" edit:
Okay, imagine this. For the 1/10 of a second or so where the glitch is, I'm singing a note on an "aaah". (Actually the word was "and", but "aaaah" was all that you heard. Deep down in the mix, there's also a faint guitar chord and deeper still there's crowd noise and whatever. So the bottom line is that that portion of the wave was NOT a very clean sine wave. There would be this *sort of* semi-repitious complex series of sequences of waves peaks and valleys of certain apmplitudes (except, over time, they would evolve as vowels turn into other vowels, consonants, and silences.) But imagine that the portion with the glitch looked something like this
U_v_l_n_U_v_l_nU-v-lln_U_v_l_n... Except, that there's a gradual subtle evolution in the sequences as they progress. The part that contained the glitch, after trying to repair it wound up looking like that U-v-lln bit- similar, but not really enough. So what I did was to select the sequence of waves JUST before it, and paste it right over that naughty bit, and position it as close to "lined" up with where the waves start and stop as I could. When I did that, and then listened to the result, the glitch 'tic' was in fact gone (which showed me that it WAS hiding in there somewhere), and what was left was that much fainter "t_c" that shows up sometimes on mis-aligned pastes or as an artifact at the beginnings or ends of effects applications.
So I selected the part of the audio at the end joint of the paste (Again, I make really exact notes about where I apply these things, including positioning down to the millisecond), applied the "repair" function to that junction,.... and ....
TADA!!!! OMG!!! IT WORKED!!!
The side effect of doing pastes like this is that you can run the risk of messing up the sync between different tracks if you're not careful about trimming the edits to exact lengths. But in this case, we were talking about potentially inserting less than a millisecond delay into the track. *I* could not hear any difference.
So what I did was:
with a sampling rate of ~44k, that works out to be about 4 samples/ millisecond, and I replaced about 8 samples of (broken) audio with the preceding 8 samples and then tweaked the final sample in that sequence so that it made a smooth transition into the next group.
And I got away with it.
I'm not sure how or why, except that I guess I replaced some broken bits with some other bits that were close enough to how it *should* sound that they made a result that sounds enough like what it should have been that it might as well be counted as right as far as perception goes.
I'm reeling from just the concept of "close enough" actually working. 1/1000th of a second, I can buy. One wave, I can understand. This was close to 5 waves over two thousandths of a second.
But I guess the perspective is that repeating 2/1000ths of a second of an audio track is not something humans are gonna catch after all. Not like they might catch an obvious glitch of waves that are nothing at all similar to the samples they interrupt.
I'm proud of having done this, but annoyed that I had to.