musichack – hacking audio…one sample at a time

Seamless Loops and Splicing

attention: musichack is moving! that’s right, we’re moving out of the wordpress apartment and in to our own server…sorta (ok, so I run other domains..but hey, i pay for the damn thing)…but I’ve installed wordpress-mu and will be moving the entire ordeal there. the address is also going to change…rather than being a subdomain…we now have a domain. http://www.musichack.org will be where you’ll find the new musichack..with all the old content and tons of new stuff. check the main page for the final notification about the move, also, the notice about “Gold Wave Editor” has been removed since it appears they have changed names…but still be on the lookout for the editor with the space in the name…that looks nothing like my screen shots.

The first article in my Goldwave series involves the process of both locating and creating loopable samples..and what I call “seamless” splices..audio splices that appear to be completely “transparent”, as in, you can’t noticably tell there’s a splice there. This was one of the first things I did in audio-manupulation that made me go wow and “if I can splice something this smooth, what else I can do?”. In fact, the other day I was faced with this exact same task and, not having done it in a while, I decided to document the process and share it with you.

The scenario is this; I was going through some transfers from some old reel-to-reel tapes that were given to me when I recieved my RTR deck and decided to at least make a backup copy of the analog tapes for the original owner. Naturally, while going through these tapes I found some interesting songs that are thought to be “practically lost”, and a couple I thought were purely interesting.

On the tape there’s a jazz-like cover of The Theme from Shaft, and it was a rather decent recording. The problem is (as with a lot of amateur recorded tapes), was that in the intro there was a bit of “mis-recording”, a .7 second portion of audio recorded over the track. When dealing with tape restoration (which I will cover some aspects of in later articles) this can sometimes be what would be considered “death” for a track, however, in some cases the original portion of audio that was recorded can somehow be “replaced” with elements from later on in the track..this is common for a LOT of songs. Sometimes it’s not so straight forward..and I’m not going to be covering how to repair EVERY complex portion of audio you need to..I’m only here to show you the basics…once you have the basic method down you can expand upon that rather easily to fix more complex things. While having the basic skills will help, you also need to listen to the audio and, at least in your head, try to assemble WHAT it should sound like, and if you can wrap your head around audio and “feel” it, it’ll become easier. This will happen either after years of playing around (in which you’ll gain an understanding), or sometimes your brain just clicks on it (i call that “natural talent”).

The example audio files for this tutorial are contained in edit-splice.zip and contain two ogg files; the original (before) and the fix (after). You can use the original file to try this project yourself.

As you can see, the portion of audio that doesn’t belong tends to stick out, it’s a much louder blob in than the rest of the intro. If you listen to the into you’ll find it’s a rymthic pattern of cymballs that repeat and then an additional set of cymballs join the mix. This is a rather standard method of starting a track (the more you listen to music and pay attention to mixing/mastering, you’ll hear it) and actually, in this example, is PERFECT for a beginning splicing project. The portion of audio missing comes entirely before the second set of cymballs come into the mix. Listening to the first portion of the intro, it’s obvious that it repeats, and there’s enough of the audio before the recorded portion to re-create the lost portion..so let’s get to it.

From zooming in vertically we can clearly see in the waveform the repeating pattern, but you should NEVER go solely on waveform alone, you should listen to the audio to make sure that’s in fact here a “clean” loop will occur..often drums will loop perfectly but there’s other audio elements on top that won’t. In our case, there’s no drums, and can use the waveforms to help us isolate a loop.

As you can see from this screenshot we’ve zoomed in even more around the selection of audio we’re going to be using for our loop, but we haven’t yet finalized the positioning. Now, the basic idea is to go from the beginning of the attack to the begging of the next major attack (the inital cymball crashes)…which on the waveform are the two large waves that seem to have a flat side. Zoom in to the side of one and look for where the wave starts changing for the attack.

It’s always best if you can pick a position at the “zero-crossing”, which is where the waveform crosses 0 amplitude; the reasoning for this is if you cut a splice a section of audio and the sample before the splice and first sample of the splice have MAJOR differences in amplitude, it will create a click that you’ll either have to figure out how to manually get rid of or try your cut again, however, in most cases, you can do a bit after splicing to fix this…but more on that later. Now that we’ve got our beginning position set, look around to make sure you’ll recgonize about the same spot when you pick your end-point. At the current zoom-level, I chose to pick right before the waveform modulation becomes recgonizble (there’s additional movement, but, at that zoom level it looks mostly like 0, and in reality, it’s generally NOT that critical). Zooming in to about the end point of selection I’ll place my end marker at a similar (because, it’s not going to be EXACT) formation…which I’ve done in the screenshot.

Now you have your selection made, and in our file, it’s .446 seconds long, but does it loop? There’s an easy way to tell. If you haven’t reprogrammed your play buttons, right now, right click on the yellow button, put it on selection and make sure loop is checked. This will set the yellow play button to loop your selection. If you’ve done it right..it should sound loop seamlessly without any popping or clicking or noticable looping position (the position where the selection ends and it starts over). Sometimes previewing your loops this way will ensure that when you get ready to paste them, they’ll loop seamlessly.

Now that you’ve got your loop selection, copy it to the clipboard..and just for safety sake (so you don’t lose it), go ahead and click Paste New (P.New) so you’ll have it in it’s own window.

Now we need to work on removing the bad audio and creating the new selection. Now, the method I use for doing this is my own, and I’ve found that by doing it this way..it’s slightly more complicated since you’re dealing with more windows, but you can tweak the final selection before you paste it in.

Looking at the screenshot we see there’s about the amount of one loop, the record-over, and another loop starting not long after it. Rather than dealing directly with the damaged audio (and having to deal with half-loops and such), it’s easier to keep cutting and splicing on the “beat-point”, so that’s what we’ll do, we’ll do that by selecting the last cymball crash before the glitch, and ending at a similar point after the glitch, and again, this decision will play a lot on your interpertation of audio and how your brain works. As you can see, I’ve already selected the portion of audio we’re going to discard and replace. Now it’s time to create the replacement. As sated before, our loop is .446 seconds long, and the portion of audio we’re replacing is 1.374..so we’re gonna have to paste the loop a few times. Go back to that loop you pasted into the new window and, assuming you haven’t copied anything else to clipboard, click paste. This will paste the loop portion in the same window again..and brings us up to .892, which isn’t enough. 3 pastes will give us 1.339 and 4 will give us 1.784. Neither of these is EXACTLY the same as 1.374…but 1.339 is close enough. so, if you haven’t clicked Paste already, click it twice so you have a file that contains 3 of the looped portions looped together. Make sure the entire window is selected and click copy. This puts our 1.339s loop into the clipboard, overwriting the original .446s segment we created it from.

Now, hopefully you haven’t moved the start/finish makers on your original file, becuase we’re ready for the magic. Go to the original file and hit delete (either click Del on the toolbar or, my favorite, the delete button on the keyboard). The selection will get deleted and you’ll find that actually, the file looks like it’ll play seamlessly that way, and it will..but it won’t be the right length/timing. Don’t move the start/finish markers from thier position, right now they’re at the exact point we want to insert the loop.

Click Paste (Not P.New or Mix, but Paste). That’s it! It will insert the loop at the position the bad audio was removed.

Now you can zoom out, select the entire intro and listen to what should sound like a completely restored intro. If you can barely tell where you did your cuts, then you’ve obviously done a great job..if you can tell, well, you’re probably a few samples off and it might take you a while to get the hang of it.

*NOTE* I forgot to mention this the first go around, but there is some bleedthrough noise on the tape…where the recording on the adjacent tracks is bleeding through to the tracks being played back….if you intently focus on that, you’ll be able to hear the studder and know where the splice is…however, that’s a defect we have to live with..it exists in my finished sample as well.

This is just a basic skill…it shows you that it’s possible to make seamless splices and hopefully gave you enough information on how to detect them, but it doesn’t have to end there…you don’t have to deal with loops persay…you can actually edit songs down this way. About a year or so ago, I posted an iPod commercial to YouTube…it was The Fratellis’ Flathead iPod commercial. (http://youtube.com/watch?v=PKxGfLo7Cqo) One thing I did (in an attempt to improve upon the original tv audio), was to recreate the commercial edit entirely from audio-cd (or in this case, FLAC) source. Again, it was a lot of intent listening to the tv edit and CD version to find out where they pulled elements from and how they were assembled. I don’t remember exacty how the intro was edited, I beleive that was a simple cut/splice..the little cymball-ding was actually pulled from an entirely DIFFERENT section of the song and “mixed” in at the right spot. The ending is SOMEHWAT obvious. When the guys start going “ba-da-da” (or something similar) when the iPod + iTunes card pops up, the first part of that is from the previous audio, the ending…where the additional backing vocals seem to kind of come out of no where..that was spliced practically mid-word from the ending. I also at one point took “The Hives – Hate To Say I Told You So” down to about 45 seconds without it being obvious it was a cut; I had to extend Louie Armstrong’s “It’s A Wonderful World” for play at a wedding reception by splicing the first half of the song back over the second half and reassembling elements to make it wound natural…once you’re able to wrap your head around this simple concept and start hearing how the things should sound..then start to identify where to make the cuts, splices and such, you can do some really cool things.

This is what I consider the first basic building block of audio manipuation..you don’t need to do it often, but as I showed here..sometimes it can come in handy.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License. GoldWave® is a registered trademark of GoldWave Inc. Screenshots courtsey Goldwave, Inc. Used with permission. Created 09 Jun 2008 by Jay Moore (dewdude@g*oogle*mail.com)

19 Comments »

  1. I have sound that i am looking to have analyzed to see if it has been tampered with or spliced or if anything has been added or taken out…….could you do somehting like that and would you?

    Comment by faron — 31.October.2009 @ 2.10.pm

  2. yes….no…its possible but it depends on the quality of the editing. bad editing can be noticed…good editing though is designed to be hard to find. there are generally a few clues one to look for. i believe my email is listed on the site…send me the file and i’ll get back to you.

    Comment by dewdude — 31.October.2009 @ 3.49.pm

    • hello dewdude. I am in dire need of your help. can you check a dvd of an interview and tell if it has been cut or portions deleted? my life is on the line. I have audio that proves it has been cut. but my money ran out. and I have till friday to prove this. can you help an honest working man thank you Mr.MOM

      Comment by Lou villia — 31.July.2011 @ 11.28.pm

  3. Hi Dewdude, Not sure if this is in your field or grade, but your the closest google result to ‘seamless track splicing’ I have found. I need to cut the middle out of a track and join the two ends up seamlessly to make it around a minuet long. Is this something you could help me with? Many thanks.

    Comment by Chris — 17.June.2010 @ 11.19.am

    • yeah…dude…stuff like that is the EXACT SAME PROCESS…only rather than taking a section that loops…..you’re just looking for something with matching beat points on both sides of your segment.

      Comment by dewdude — 17.June.2010 @ 1.02.pm

  4. Thanks for the reply! I have never used any audio editing software before and need to edit At Last by Etta James for my wedding. Being a newbie and having lots of wedding stuff to organise, is this something I can do in an hour or two cos it looks complicated! How much is this software to buy?

    Comment by Chris — 17.June.2010 @ 2.37.pm

  5. Just found the GW site, cheap enough, but not for OSX. 😦

    Comment by Chris — 17.June.2010 @ 2.39.pm

    • Yes. Sadly, NO ONE makes affordable audio software for OSX. I know people claim OSX is king of all graphic arts…..but it’s got one or two REALLY good expensive software suites that only professionals can afford and nothing targeted at the average joe. It is not a computer you use for audio editing. Video, graphics, yes, but audio has always been the one thing i felt the mac really lagged in. But, if you’re on a mac, then i’m sorry.

      Comment by dewdude — 18.June.2010 @ 1.16.pm

    • actually…the amount of time it can take varies on both your skill and the music. if you’re able to detect beat-points and find the zero crossings…then you can knock it out in almost no time. If you tell me how you need the song edited, I’ll do it….but it will be for a small nominal fee as my time these days is not free. Someone who’s never done it…and has no idea how…likely never will. You’d need weeks of practice. I have however extended What A Wonderful World to be a whole verse longer than normal using these techniques…and this was like, 9 years ago. took me 20 minutes. that’s just me.

      Comment by dewdude — 18.June.2010 @ 10.20.pm

      • Hi, Many thanks for your reply! I have sent you an email in reply. Thanks again!

        Comment by Chris — 24.June.2010 @ 12.41.pm

  6. Dude, nice tutorial, thanks!

    (Oh, and you’re spelling cymbal incorrectly).

    Comment by davesmi — 21.March.2011 @ 12.24.am

    • yeah, I’m sorry. my spelling is lacking in some things and spell-check didn’t pick that up. what can i say, i spent more time down in the music room in school when i was skipping english.

      Comment by dewdude — 1.August.2011 @ 4.52.pm

  7. Great tutorial. Very helpful. Thanks, man!

    Comment by Frost — 21.May.2011 @ 2.47.pm

  8. I thought you might be able to help. spelling does not matter at this point. can you help is my question? I am in a life and death matter. not a great writer,just a man tryin to survive

    Comment by Lou villia — 1.August.2011 @ 4.09.pm

    • I have sent you a message via email. While I probably could help you. I will not. I do not buy your left or death matter…everyone that contacts me wanting free work is somehow life or death. You can try pulling my other leg, but it likely won’t give in either. If you’re in THAT much dire emergency…then don’t try to contaact random people on the internet. Go to the police.

      Comment by dewdude — 1.August.2011 @ 4.47.pm

      • hey dude the liars are the police!!! yes they interviewed me and left out important facts that I told them. yes so I was lookin for a real honest person who knows how to prove these dvds were cut and altered. But I know you cannot help or this type work is above your knowledge level. I have a family to support, but I have a little cash. If you know someone who I may be able to afford to help me givem my phone # 706-265-4332. I need help fast. I wasn’t try’n to get something for nothing. I have a degree in automotive technolgy. If I can help you with anything in my field I would. just ask. I do it all the time. thanks Lou

        Comment by Lou villia — 2.August.2011 @ 1.03.am

      • Oh really? I’m not getting involved and walking the other way. I’m not about to go up against a force as large as the police in whatever state you’re in. Not to mention…I’m not a professional, i’m not a forensic scientist, I have no professional training or certification. If I was able to prove something, I’d have to show up in court to testify. I do not have the time, money, or ability to travel anywhere. I’ve got a day job that I can’t get time off from. I’m also not about to go up against the police. Whatever you did, you’re screwed. I’m sorry. But I’m not getting involved….I’m not passing your number on, as far as I know if they’re out to get you THAT badly, they’re monitoring all your shit and now I’m involved simply because you contacted me. Get the fuck off my site. I’m not passing your number on, I’m not helping you, I’m not even going to talk to you anymore. I’m not going to jail because of something some random asshole drug me in to. Fuck off.

        Comment by dewdude — 2.August.2011 @ 1.11.am

  9. hey ass, you are retarded or just a punk kid!! but I did not contaminate your site. I just asked if you knew anyone who knew about splicing. my lawyer is involved. do not worry you are not involved. besides I would never want to be a friend of a gutless person as yourself. so sorry to have ventured onto your so called site . later ass. besides in life you will need to stand up to anyone or you will fall for everything. as you probably do.

    Comment by Lou villia — 2.August.2011 @ 1.17.am

  10. I tried going to your other site by the link above; but it says server not found. This my be along shot; and you may never read this; but I have a splicing dilemma not dealing with loops. I have been working with this song and wrote it down on paper. I always knew something was missing, and by a happy accident realized it need it drums; unlike all my piano pieces before it. I tried recording it all down as one track and adding the drums on top of it using an older; but still to this day; top favorite software of mine. That didn’t work so well; as I’m not the best piano player, I would get off beat after a while, and the fact this piece makes my right arm go stiff and in pain didn’t help (some pieces do that). My dilemma is this: I tried recording it in parts, but that didn’t go well at first; as I would get pops or clicks where i had spliced it. I soon figured out that liking to holding down the sustain pedal all the way through a piece of music causes the middles and ends to run together; and that’s the reason why it didn’t sound fluid. I re-recorded it and the second time I played about a measure before and after the recording, and it worked. I use my piano to save my music in to a form similar to a midi file; but only it can read. I then plug it’s sound source int my computer and play it back to create a .wav using Sound Saver for INport. I then upload them as tracks into Cool Edit and mix them there. I would over lay them a little and cut off the end of the beginning and the beginning of the ending recording so it would line up (this is why I recorded a measure before and after). Anyway, everything went so smoothly the first day, It sounded better than if I were to play the whole thing all together. The second day didn’t go as smooth. I kept getting pops or clicks every time where I would splice them together. What am I doing wrong? I did have to record some of the tracks over; and was wondering if this causing the problems? I don’t want to start over as the folder all my tracks are in is totally a mess, and I don’t know what Cool Edit is currently using and what it’s not since it makes a new file every time I import a file for use some where in the recording. thank you so much!

    Comment by James R. — 11.January.2015 @ 7.56.pm


RSS feed for comments on this post. TrackBack URI

Leave a reply to dewdude Cancel reply

Create a free website or blog at WordPress.com.