Community Forums Archive

Go Back

Subject:SF is forcing a zero crossing on saved files
Posted by: David Thiel
Date:9/18/2012 7:07:32 PM

I am regioning a music file to one bar chunks using auto region based on tempo.
This should create wave files that neither start or end at zero crossings.
Unfortunately the first sample of the resulting file is correct but the last sample of the file is always zero.
I'm sure SF is appending a zero or forcing the last sample to zero.
Either way sometimes this creates a pop or click when concatenating the chunks at playback.
Is there a way I can keep SF from doing this?
Anybody else had this experience?
thanks in advance
david

Message last edited on9/19/2012 11:12:28 AM byDavid Thiel.
Subject:RE: SF is forcing a zero crossing on saved files
Reply by: musicvid10
Date:9/18/2012 11:27:25 PM

What software do you know that doesn't default to null at a cut point?
What other method do you know that doesn't alter that last bit?
Is your intention to create loops?
What are you saving your files as?

Message last edited on9/18/2012 11:30:14 PM bymusicvid10.
Subject:RE: SF is forcing a zero crossing on saved files
Reply by: David Thiel
Date:9/19/2012 11:11:27 AM

Forcing a file to end at zero is a reasonable behavior but it isn't the only behavior that is useful.
No, I am not trying to create loops.
I am saving uncompressed 44 khz, 16bit, mono .wav files.

This is for a game. The game need to be able to resume a 4 minute song after stopping playback. By breaking the song into 4 beat chunks the game can resume the music at any bar in the tune. Plus there are other interesting behaviors that are enabled by this technique.

This has already been implemented and it works in the game. I am just trying to get the pops out.
Sound Forge should be able to save a file verbatim as I cut it up without forcing the last sample to zero if I want it to. If the previous chunk's last sample was 16000 and the first sample of the next chunk is 16800 Sound Forge should not add a zero the previous chunk. I am concatenating on average about 100 chunks to play a song.

Hopefully there is an option somewhere that will change the default save behavior to another behavior.

David

Message last edited on9/19/2012 11:14:01 AM byDavid Thiel.
Subject:RE: SF is forcing a zero crossing on saved files
Reply by: J.
Date:9/19/2012 12:14:17 PM

The "zero-crossing" at the end is just displayed in the UI. It's not actually in the file. Take a look at the Levels toolbar value when the cursor is at the end of the file. It says "(end)". If they didn't do that, there'd be no way to select the last sample in a file.

Think of it this way, a digital audio sample is a position and a duration (1/samplerate). So a five sample long file has positions 0, 1, 2, 3, and 4. To show the duration of five samples (0-1)(1-2)(2-3)(3-4)(4-?), the app has to do something or you wouldn't be able to select the last sample. It might have been clearer to just hold the same level rather than go back to zero, but I digress. The sample value at position 4 is the last thing to hit the hardware before looping to position 0.

If you are getting clicks when playing the region looped, there's a discontinuity between the start and the end. If start and end were zero crossings, you *wouldn't* hear clicks. I suggest you read up on the loop tuner. An alternative would be to adjust all your regions *to* fall on zero-crossings with either the snapping mode or the Edit menu tools.

Likewise, if you are not looping, but just starting at an arbitrary position, that's going to click unless it *is* on a zero crossing or is faded in. For your case, I'd just leave the audio alone and add a 10ms fade in to the playback engine whenever you seek/restart.

J.

Message last edited on9/19/2012 12:28:52 PM byJ..

Go Back