The No.1 Website for Pro Audio
SOX resampler
Old 2 weeks ago
  #1
Gear Head
 
MFSAKA's Avatar
Red face SOX resampler

Hi guys! I need help.

Anybody can help with SOX script? I'm too stupid for command prompt

I need resampler scripts:
- one for SRC from 44.1 to 26040 Hz
- second for SRC from 44.1 to 27500 Hz

NO FILTER NO INTERPOLATION!

Batch processing for many wav files. I try to do it myself (i think in march 2019) but can't create working script.
So if anybody can help that will be blessed.
Old 2 weeks ago
  #2
Lives for gear
Hi,

what do you mean by "NO FILTER NO INTERPOLATION!"? As resampling inherently involves both by its basic principle. Maybe tell us, what's your intended use case for that?
Also omnipresent kick off question - Mac or PC?

Michal
Old 2 weeks ago
  #3
Gear Head
 
MFSAKA's Avatar
Quote:
Originally Posted by msmucr View Post
Hi,

what do you mean by "NO FILTER NO INTERPOLATION!"? As resampling inherently involves both by its basic principle. Maybe tell us, what's your intended use case for that?
Also omnipresent kick off question - Mac or PC?

Michal

PC WIN 10 last update.

i mean i don't need anti-aliassing etc.

(Like screenshot)




Wavosaur app give's me what i need but batch processing don't have customizable options
Old 2 weeks ago
  #4
Lives for gear
I know Wavosaur and use it for various sample editing tasks, yes there it is defeatable interpolation and AA filter.
However you don't have this option in SoX resampler, its rate filter isn't bandlimited in quick mode, but for every other mode, there is AA filter (albeit you can adjust its properties like cutoff and slope to some extent). There is also basic downsample filter in SoX, but it accept only whole integer ratios.

Anyway, again what's your use case? Under vast majority of normal circumstances, you want interpolation and avoid aliasing from proper resampler.
And even for weird stuff, like use of resampling for timestretching of full cycle waveforms to different length for some wavetable synths, interpolation is fine, as it helps to better preserve shape of original waveform.

Check this thread, where I helped someone with batch conversion of all Adventure Kid's wavetable kits..
Converting 600 sample waveforms to 256 sample waveforms - OSX
there I gave some shell one liner for OS X, but similar bash scripting can be used also on Windows, if you install Cygwin and SoX from there.

For "normal" batch resampling (with interpolation and AA filter) to arbitrary output rate with GUI, you can try free Voxengo r8brain. It's very good resampler IMO with batch processing of folders.

Michal
Old 2 weeks ago
  #5
Gear Head
 
MFSAKA's Avatar
i need resample with aliasing
Old 2 weeks ago
  #6
Lives for gear
Quote:
Originally Posted by MFSAKA View Post
i need resample with aliasing
Good luck then

Michal
Old 2 weeks ago
  #7
Gear Head
 
MFSAKA's Avatar
Quote:
Originally Posted by msmucr View Post
Good luck then

Michal
I know - it may sound stupid cuz aliasing is bad thing for most music genres, but not in my case.
I find a batch solution with close sound but phase test wil same sample resampled in Wavosaur, don't give me null.
So it's not same and sample accurate.
Joke about diffirent DAW's sounds not the same
Old 2 weeks ago
  #8
Gear Head
 
Michael Grafl's Avatar
 

Reaper offers linear or even point resampling. Gives you plenty of aliasing.

You could import a bunch of audio files on separate tracks and render out stems with the appropriate settings, but I don't know if Reaper will do your desired target rates.
Old 2 weeks ago
  #9
Lives for gear
Quote:
Originally Posted by MFSAKA View Post
I know - it may sound stupid cuz aliasing is bad thing for most music genres, but not in my case.
I find a batch solution with close sound but phase test wil same sample resampled in Wavosaur, don't give me null.
So it's not same and sample accurate.
Joke about diffirent DAW's sounds not the same
I see, however as I've mentioned before SoX doesn't have direct equivalent of Wavosaur, when you turn off both interpolation and antialising filter.
In another words.. even if you put that into quick mode, it will be HiFi compared to grunge from Wavosaur.

Anyway as you've asked for batch script for processing multiple files in SoX, it can be done with this.. maybe isn't necessarily useful now, but you can keep it for some later use..

Code:
echo off

set filter_opts=rate -q 22050
set suffix=_src

if [%1]==[] goto :eof

:loop
    echo Processing file: %1
    sox -V1 %1 "%~dpn1%suffix%%~x1" %filter_opts%
shift
if not [%1]==[] goto loop
Save that as some file with .cmd suffix and drag bunch of wavs on that batch.

You can also modify sox filter parameters at variable filter_ops.. In my example it's using quick mode resampling and output rate 22050 Hz, you can modify that as you like according to SoX documentation. http://sox.sourceforge.net/sox.html#EFFECTS SoX can be very useful tool for lot of various audio file tasks.. and its resampler is excellent, if you don't want grunge


But technically what you are asking for is also called ZOH (zero order hold) or point sampling as mentioned before.
If you would like exactly that.. you have some other choices.
Reaper was already mentioned, it has own Batch/File converter, where you can specify arbitrary output rate and if you select the point resampler.. it will be very close to Wavosaur.

The other option is this plugin for foobar2000, which is great tool for various batch conversions and you can also easily process multitude of files with it.
http://www.foobar2000.org/components...multiresampler
There you select ZOH resampling mode.

libsamplerate has that ZOH mode, and you can install command-line tool sndfile-resample via Cygwin to Windows, but previous methods are likely more straightforward.

All those tools will produce very similar output with lot of aliasing and artifacts, results will be IMO pretty much indistinguishable among them.
However it doesn't mean it will completely null.. that would require absolutely exact same algorithm, which isn't the case of course

Michal

Why someone wants that with weird rates is still bit puzzling question to me.. but whatever

Last edited by msmucr; 2 weeks ago at 12:10 AM..
Old 2 weeks ago
  #10
Gear Head
 
Michael Grafl's Avatar
 

I had a chance to test this in Reaper now. It *does* render out in arbitrary sample rates, and at the lowest quality setting it yields plenty of aliasing artefacts. It's also extremely fast at this setting.

Since Reaper is a small download and can be run as an unrestricted evaluation version, I'd say give it a try.
Topic:
Post Reply

Welcome to the Gearslutz Pro Audio Community!

Registration benefits include:
  • The ability to reply to and create new discussions
  • Access to members-only giveaways & competitions
  • Interact with VIP industry experts in our guest Q&As
  • Access to members-only sub forum discussions
  • Access to members-only Chat Room
  • Get INSTANT ACCESS to the world's best private pro audio Classifieds for only USD $20/year
  • Promote your eBay auctions and Reverb.com listings for free
  • Remove this message!
You need an account to post a reply. Create a username and password below and an account will be created and your post entered.


 
 
Slide to join now Processing…
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Forum Jump
Forum Jump