HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: judd on 2016-04-27 04:01:17

Title: New Audio File Conversion Tool
Post by: judd on 2016-04-27 04:01:17
Hi all,

I have been a long-time lurker of this forum, and have benefited greatly from the resources here.
Now  I'm hoping that I can contribute something of value back to the community.

I have been in the process of developing a sample-rate conversion tool. The goal of this is to achieve very clean sample-rate conversions, with a minimum of artifacts. This project started out primarily as a coding exercise to help better understand some DSP principles, but it slowly seems to be growing into a potentially very useful tool. By virtue of the fact that it uses libsndfile (http://www.mega-nerd.com/libsndfile/), it can convert between around 20 different sound file formats.

The binaries, source code, and documentation are available on GitHub. There are two components:


I have only managed to build it for Windows so far, but I have tried to keep the code reasonably portable for future Linux or Mac builds - just haven't had time to look at that yet. I would also like to add mp3/m4a/opus/wavpack support in the not too distant future.

I encourage everyone to try it out. Any critiques / bug reports / suggestions / contributions you have would be most welcome.

best regards,
Judd






Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-04-28 02:26:27
How does one set the output file in the GUI? I cannot seem to.

Also, would be nice to highlight a bunch of files at once. What src does it use?  Wondering how it compares to SoX
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-04-28 03:14:09
How does one set the output file in the GUI? I cannot seem to.

Hi Ron - thanks for checking it out. I think I have found what you are referring to:

If you browse to a folder somewhere, and then type a new filename, it fails because the file doesn't exist (yet). Is that what you mean ? i think i can fix that ...

Edit: This should be fixed now. The "Select Output File" Dialog will now happily accept files that don't exist.

Note also that with the output filename, if you first choose an input file, and then click into the blank "Output File" box, it will automatically generate a default one for you by appending "(Converted)" to the name (before the extension). You can also leave the output file box balank, and it will create the default (converted) name as well.

Also, would be nice to highlight a bunch of files at once.
Agreed. batch-processing is definitely on my to-do list.

What src does it use?  Wondering how it compares to SoX

I wrote my own algorithms to do the SRC, but they are basically use the same interpolation/decimation techniques which other SRCs use. When using a "simple" ratio (eg 1:2 or 2:1), it uses a 511-tap Kaiser-Windowed FIR lowpass filter. When using "complicated" ratios, eg (96k->44.1k), it uses a much larger filter (32767 taps). This is of course slower, but the results are very clean, with detectable aliasing suppressed to under -150dB (below the noise floor of 16- and 24-bit).

Anyway, this is the response I get for a 0-48kHz sweep when down-converting from 96kHz to 44.1kHz:
https://github.com/jniemann66/ReSampler/blob/master/Swept_24.png (https://github.com/jniemann66/ReSampler/blob/master/Swept_24.png)

You can compare that to other converters (SoX included) on this site: http://src.infinitewave.ca/ (http://src.infinitewave.ca/)
(note: mine isn't submitted there yet - want to do even more tuning first)

cheers,
Judd


   
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-04-28 23:27:47
Very nice fix.  I like it!

Suggestions:

1. Maybe save settings for default output format? I would think this should be WAV in most cases.
2. In conjunction with 1, have no need to specify output name when specifying output folder. In this case, one could just set the output folder and the output name would automatically be the same as the input name (input_name.wav).
3. Perhaps echo the normalization and dither settings in the GUI output screen so the user can verify that the options are being used properly.
4. Do you think normalization should default to 0 and not 1, since most may convert to FLAC later with replaygain tags? Not sure on this.

Notes:

-It is not clear to me how the dither should work...what is triangular in this case?
-Will the GUI (ferocious) always have the latest SRC in it? It is a separate download from GitHub. It may be useful to have an option to set the location of the ReSampler as well, other than the first run.


I really like this!! Congrats!

Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-04-29 07:39:03
that's great feedback, Ron. Much appreciated. I'm working on implementing your suggestions ...
cheers,
Judd
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-04-29 17:00:30
That is awesome...I'll keep checking github..are you file versioning there?

If you get a chance, can you go over in more detail your dither options (1 to 6) and how they relate to triangular, etc.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-04-29 19:07:51
OK,

I added the following changes:

1. Added an "Output File Options" menu item, which allows user to set:

If, for example, you wanted the output file to have the same file name, but different folder, and force it to be a .wav file, you would set it like this:

Append Suffix: no (unchecked)
Output Directory: yes (checked), <your folder location>
Default to this file type: wav

Note: these options set the rules for the generation of the default output file name. You are of course free to manually change the output filename to whatever you want at any time

2. Added Menu item (Converter location ... ) to allow user to select the location of resampler.exe at any time.

These settings are persistent.



I have tried to test this as much as I can, but given the amount of fancy string manipulation involved, there may still be a couple of weird bugs in there. I think things will get interesting once I start porting it to Linux, due to the differences in File Systems between to OSes - no doubt, it will take some tweaking.

In regard to your other points:

Quote
Do you think normalization should default to 0 and not 1, since most may convert to FLAC later with replaygain tags? Not sure on this.

Notes:

-It is not clear to me how the dither should work...what is triangular in this case?
-Will the GUI (ferocious) always have the latest SRC in it? It is a separate download from GitHub. It may be useful to have an option to set the location of the ReSampler as well, other than the first run.

With Normalization, 0 means silence and 1.0 means the peaks will be amplified to the maximum possible level for the output format. Often, when mastering for CD, you would normalize to 0.98 or something like that, to prevent clipping on some older DACs which have a bit of overshoot. Normalizing controls the peak output level, but the overall loudness of the track is another thing again.

With dithering, "triangular" refers to a particular type of noise, called triangular probability density function (tpdf) noise, being deliberately added to the signal to reduce distortion. If you can imagine a game of monopoly, or backgammon, where you have two dice - when you roll the two dice together, the probability of getting a "medium-sized" number is higher than that of getting a really low or really high number. In fact, the probability curve for this resembles a triangle, hence the term "triangular". With dithering, it is similar, and the noise is based on adding two random numbers together. The dither noise is then "shaped" (EQ'd) to distribute the noise in a manner that is least audible (or objectionable) to our ears. This particular type of noise has some desirable properties, such as being decorrelated with the original signal. The "dither amount" controls the magnitude of dither added, in bits. You use this whenever you convert from 24-bit to 16-bit or from 16-bit to 8-bit, to help preserve the really quiet passages which would otherwise be below the threshold of the target format. It increases the dynamic range at the expense of having a bit of added noise. I would recommend using a value between 1 and 2. There are some good resources on the web that can explain it better than me. Nigel Redmon's video (https://www.youtube.com/watch?v=zWpWIQw7HWU) is quite good

With the distribution of the GUI, I have included the converter as a convenience, mainly to make it easy for people to try it out, because I've found that if people can't get it to work straight away, they may just give up. But, yes, they are two separate projects. usually when I update resampler.exe, I also update ferocious. I don't know if I'll continue to bundle them like that in the future - it may get too tricky to maintain. I think there is a better way on github using submodules etc, but I need to explore that.

I started versioning , too - this latest build is 1.0.1 :)

Cheers,
Judd






 
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-04-30 00:07:29
It is really getting better! Just a couple of points.

1. The options menu has a font colour of white. I did not see it right away because it is on a nearly white "menu bar" itself. Perhaps change the font to black?

2. Upon entering my preferences in the options bar and exiting, all was ok and remembered. But when I chose a file to convert, nothing was populated in the output file menu. If I clicked straight on convert, it did not save into the preferred folder.

For example, if I have chose output file options as directory H:\music\ and file type as wav, the output file menu portion is not populated as H:\music\test.wav once I have chosen my input files as test.flac


3. Maybe put the version number in the GUI up top?  For example: Convert Sample Rate 1.0.1? Or Ferocious Audio Converter V1.0.1 (it is not really a file converter)....just nit picky....only relevant if you think it is.



Nice job so far!
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-04-30 02:23:48

1. The options menu has a font colour of white. I did not see it right away because it is on a nearly white "menu bar" itself. Perhaps change the font to black?

2. Upon entering my preferences in the options bar and exiting, all was ok and remembered. But when I chose a file to convert, nothing was populated in the output file menu. If I clicked straight on convert, it did not save into the preferred folder.

For example, if I have chose output file options as directory H:\music\ and file type as wav, the output file menu portion is not populated as H:\music\test.wav once I have chosen my input files as test.flac


3. Maybe put the version number in the GUI up top?  For example: Convert Sample Rate 1.0.1? Or Ferocious Audio Converter V1.0.1 (it is not really a file converter)....just nit picky....only relevant if you think it is.


Thanks Ron. I made the following changes (now v1.0.2):

1. Updated CSS in menus to render them properly - it was an issue anytime you used "aero" style windows (I use old-school).
2. Previously, you had to click into the output filename textbox to trigger it to update. I have now added code to update it immediately upon editing the input filename, or browsing to a file. This feels much more responsive
3. I'm still mapping out the design for a proper versioning system. And, yes - maybe I should call it "Ferocious File conversion" instead of converter. Thanks for your feedback - it's been very helpful !
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-04-30 04:32:10
2. Previously, you had to click into the output filename textbox to trigger it to update. I have now added code to update it immediately upon editing the input filename, or browsing to a file. This feels much more responsive
Note: just one more thing - output filenames are only auto-generated when the output filename box is empty. This is to prevent it overwriting a filename that the user may have intentionally put there.
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-04-30 21:22:23
Looks good!!

One thing you may want to add in options is the default flac compression value. I use 5, but others like 8. This would likely be useful for those making flac output.

I am able to enter dither values from 0 to 8. Values above 8 revert to 1.0 and negative numbers revert to 0. Are you able to explain what happens as the values change from 0 to 8 (I have not watched the movie you suggested yet...sorry if it explains it...does it?).

Also, can you explain what you resample method does?  I also have voxengo r8brain pro, which does not dither on truncates. It offers Linear phase, minimum phase and an ultra steep mode option. Is yours more like a linear phase?

To be clear, as long as I set normalize less than 1 there will be no clipping right?

excellent tool!
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-01 15:46:06
Looks good!!

One thing you may want to add in options is the default flac compression value. I use 5, but others like 8. This would likely be useful for those making flac output.

ok, I'll look into it.

Quote
I am able to enter dither values from 0 to 8. Values above 8 revert to 1.0 and negative numbers revert to 0. Are you able to explain what happens as the values change from 0 to 8 (I have not watched the movie you suggested yet...sorry if it explains it...does it?).

Yes, I limited the range to be from 0-8. The higher the number, the louder the dither ...
1 is the default. I can't imagine any practical reason reason for going higher than 8, except for "research" purposes. All it means is that if you set it to 1, it will fill the lowest bit of your output file with dither. If you set it to 4, it will fill the lowest 4 bits with dither etc.

If you create an 8-bit output file, and use 8-bits of dither, then the entire sound file would be dither (it would just be a bunch of noise). If you have a 16-bit file, with 8 bits of dither, then the lowest 8 bits of the file would be all dither etc. Note that you can also have "in-between" values, such as 0.7 or 3.2 - it's a continuum. This is possible because the dither magnitude is set prior to the final quantization stage when the file is being written out to disk. The best level to set it at depends on the program material. In practice (with 16-bit files), it is a challenge to hear the difference because it is all happening down around -90dB ! The most obvious place to listen for the effects of dither (or lack of dither) is in the fade-out at the end of a song.

I am still tweaking the dither algorithm to make it sound better. One process I have been using to test it, is to convert down to 8-bit, where the noise floor is still relatively loud (-42dB) and the effects are quite audible, as follows:

1. Take a passage of music in a 16- or 24-bit file and, with a wave editor, reduce the overall level to be too quiet for 8-bit (ie quieter than -42dB)
2. Convert that to 8-bit without any dither and verify that it is being truncated (will typically sound very distorted with lots of "sputtering" and "splatting" as the music goes below the threshold of the quietest levels 8-bit can normally produce)
3. For comparison, convert the same file to 8-bit, but this time with some amount of dither, and verify that the (quiet) music can now be heard properly in 8-bit, albeit with a wash of dither noise mixed in - ideally, it should be inoffensive and sound a bit like tape hiss - and not harsh or fatiguing to the ears.

By using the process above, I have been iteratively going back and auditioning and tuning the noise-shaping filter to produce the best results. This is somewhat subjective, and it is no surprise that there already exists a whole variety of different noise-shaping curves amongst all the commercial products out there. A lot of products offer a choice of several different noise-shaping curves, and I will probably do that too, once I have found a couple of formulas that I am really happy with. 

Quote
Also, can you explain what you resample method does?  I also have voxengo r8brain pro, which does not dither on truncates. It offers Linear phase, minimum phase and an ultra steep mode option. Is yours more like a linear phase?

Yes, it's linear phase. I'm working on minimum phase, but to be honest, the maths is doing my head in at the moment :-)
Interestingly, Aleksey Vaneev (author of r8brain and r8brain pro) has made the source code for his resampling routines available on gitHub. It would be tempting to use his library, but I like the challenge of working it out myself, so I'm going to keep slugging it out.

Quote

To be clear, as long as I set normalize less than 1 there will be no clipping right?

That's correct - actually, you are safe setting it to be less than or equal to 1. (At 1, the loudest peak will just touch the highest possible level). Any higher than 1 is guaranteed to clip (GUI won't let you do it, but command-line version will, and it will give you a warning...)

Quote
excellent tool!

Thank you very much.
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-01 17:59:30
thanks for the reply..

I'll have to play with the dither values, as I am not sure how to relate them to some of the standard ones, such is triangular, MBIT in izotope and POWR in yet again others. With your converter I have 8 to choose from LOL. Perhaps renaming the dither setting that best matches TPDF could help users. If it was, say, 3, then 3 in the drop down menu would be listed as 3 (TPDF).

Since you seem interested in tackling the maths, I notice that iZotope offers an Auto-blanking options, whereby dither is stopped for sections of audio where "the input signal is completely silent (0 bits of audio) for at least 0.7 seconds."  This could be a neat option on the main GUI page. Not sure it is easily to implement or not as I do not know how to code...I can only provide suggestions LOL.

I hope others are trying this tool...it is cool and fun to use.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-02 00:57:19
thanks for the reply..

I'll have to play with the dither values, as I am not sure how to relate them to some of the standard ones, such is triangular, MBIT in izotope and POWR in yet again others. With your converter I have 8 to choose from LOL. Perhaps renaming the dither setting that best matches TPDF could help users. If it was, say, 3, then 3 in the drop down menu would be listed as 3 (TPDF).

It's always TPDF, just with an adjustable volume. You may be confusing the PDF with the noise shaping curve - these are two different aspects of dithering. The PDF refers to the distribution of random numbers used to make the noise. My program always uses triangular (TPDF). You may see other PDFs in other products such as rectangular or Gaussian. (rectangular is analogous to throwing 1 die, triangular is analagous to throwing 2 dice, Gaussian is analogous to throwing many dice ...). However, TPDF is generally considered to be the most effective for audio.

The noise shaping refers to how the noise is boosted or attenuated at specific frequencies to make the noise either less audible or less objectionable to human ears. This old paper (http://audio.rightmark.org/lukin/dither/dither.pdf) shows measurements of the noise shaping curves of various commercial products, and compares them. It's pretty cool. The curve I have been working with sort of resembles the Cool-Edit "C1" curve - sort of - but is still quite unique.

Quote
Since you seem interested in tackling the maths, I notice that iZotope offers an Auto-blanking options, whereby dither is stopped for sections of audio where "the input signal is completely silent (0 bits of audio) for at least 0.7 seconds."  This could be a neat option on the main GUI page. Not sure it is easily to implement or not as I do not know how to code...I can only provide suggestions LOL.

yep, I have already done this, but only in the CLI (using the --autoblank switch).
I just haven't got around to it in the GUI yet. With autoblank switched on, it will blank after 30,000 samples of silence (0.68 seconds for 44.1k,  0.31 seconds for 96k). Any input less than -193 dB is considered silence.

Quote
I hope others are trying this tool...it is cool and fun to use.

Me too. As you can see, I am willing to take feedback, so everyone who tries it and makes suggestions will be helping to make it better.

Cheers, Judd
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-02 18:45:18
I think I'm getting it for your 1-8 settings for dither...I'll just play around and see, but I'll likely stay at 1.

I really like how you can have multiple input types (flac, etc). r8brain always bothered me because you cold only have wav in and wav out. Your program really saves time, has no installer and the resulting output sounds excellent.
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-04 20:16:39
I noticed that change to 1.0.5 of the GUI with the Help-About tab.  When using Help-About there is an error.  See attached screen shot

Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-05 01:49:42
I noticed that change to 1.0.5 of the GUI with the Help-About tab.  When using Help-About there is an error.  See attached screen shot



Thanks Ron - I'll check it out.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-05 12:48:53
I noticed that change to 1.0.5 of the GUI with the Help-About tab.  When using Help-About there is an error.  See attached screen shot

Hi Ron - have you checked that Ferocious is pointing to the latest version of resampler.exe ?
(The reason I ask is that versions of resampler.exe prior to 1.0.3 don't understand the --version command, and will give the error you have shown above).

Let me know how you go.

PS - version 1.0.5 of resampler.exe is now up. I also refreshed the Ferocious packages to include it.
Ferocious and resampler are both aligned at version 1.0.5 now

Cheers,
Judd

Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-05 15:31:41
yes...it works fine now!

Looking good...not sure what else I can add at this point. If I remember the last things I suggested were

1. Ability to choose many files (batch)
2. Add GUI check for auto-blanking
3. Add option for FLAC compression level.

Again just suggestions...not demands.

Quite useful!
Title: Re: New Audio File Conversion Tool
Post by: Brazil2 on 2016-05-05 16:13:32
Resampler.exe doesn't run on Windows XP, because of this:
https://hydrogenaud.io/index.php/topic,109766.msg906816.html#msg906816

I had to do the edit at 158H and 160H for Resampler.exe to be able to run on XP.
So it's a just a flag to turn on in the compiler.

More info about that:
https://software.intel.com/en-us/articles/linking-applications-using-visual-studio-2012-to-run-on-windows-xp
http://www.msfn.org/board/topic/172970-why-not-a-valid-win32-application-xp-programs/
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-06 05:47:52
Resampler.exe doesn't run on Windows XP, because of this:
https://hydrogenaud.io/index.php/topic,109766.msg906816.html#msg906816

I had to do the edit at 158H and 160H for Resampler.exe to be able to run on XP.
So it's a just a flag to turn on in the compiler.

More info about that:
https://software.intel.com/en-us/articles/linking-applications-using-visual-studio-2012-to-run-on-windows-xp
http://www.msfn.org/board/topic/172970-why-not-a-valid-win32-application-xp-programs/

Thanks very much for this - I'll see what I can do to fix it. I'm using VC2015, but from what I can see in the intel.com article you provided, it should be possible to change the build options to make it work on XP.

Also, I noticed that Qt (which is used to build Ferocious) will be dropping support for XP in the forthcoming 5.7 version (I'm still using 5.5, though ... )

Cheers,
Judd
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-06 06:20:27
Resampler.exe doesn't run on Windows XP, because of this:
https://hydrogenaud.io/index.php/topic,109766.msg906816.html#msg906816

Rightio - I've just rebuilt it on my system to work with Windows XP onwards, but I just want to do a but of regression testing first to make sure I haven't broken anything before I commit it. I don't have an XP machine handy at the moment, either - I might have to crank up a VM.

I also did a check on the PE header for ferocious.exe, and I note that it sets "Operating System Version" and "Subsystem Version" to 4.0 , so I assume this means that it is intended to run on NT 4.0 hehe ! (No way I can actually test that, right now, though)
Title: Re: New Audio File Conversion Tool
Post by: j7n on 2016-05-06 08:04:23
Current ReSampler 1.0.5 works on WinXP after editing the header (it requires SP2 or later). Actually only Subsystem matters. These fields are seldom set to the exact OS version required.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-06 08:19:00
I just put a new build (https://github.com/jniemann66/ReSampler) up for XP - so let me know how that goes. (The only changes are to the binaries, so I'm not bumping the version number - there are no changes to functionality, at least not intentionally, anyway ...  ;D )
Title: Re: New Audio File Conversion Tool
Post by: Brazil2 on 2016-05-06 13:03:58
I just put a new build (https://github.com/jniemann66/ReSampler) up for XP - so let me know how that goes.
Works :)
Thanks for that ;)
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-10 20:23:18
You ever thought about calling it Ferocious SRC? Because it occurred to me that it is a sample rate converter not a file converter.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-11 03:08:15
You ever thought about calling it Ferocious SRC? Because it occurred to me that it is a sample rate converter not a file converter.
It does both of those functions :-)

1.convert sample rate
2. change file file format.

However, we still have the basic problem that resampler.exe actually does all the converting, whereas ferocious is a controller. So, the semantics are indeed a bit messed up.

Anyway, thanks for the suggestions - rest assured I am giving this all some serious thought - unfortunately, you have to give a project a name when you start it, and sometimes the name just sticks.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-11 03:14:47
Hi all. just letting you know that there is a new build of Ferocious (https://github.com/jniemann66/ferocious) available.
Wildcard functionality has been added, allowing you to process multiple files.

Some documentation on the behaviour of this feature is available here:
https://github.com/jniemann66/ferocious/blob/master/Ferocious-Wildcard-specs.pdf

regards,
Judd
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-18 12:21:05
Is one able to select the files in the file open dialog? I must admit I find the pattern matching thing a bit unintuitive.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-18 14:28:39
Is one able to select the files in the file open dialog? I must admit I find the pattern matching thing a bit unintuitive.
Ok, thanks for the feedback. The idea behind the wildcards is simply so that if you have a folder full of files that you want to convert, you just select one of them, and then type over the last bit of the filename to change it from, for example, e:\music\abba\dancingQueen.wav to e:\music\abba\*.wav and it will process all .wav files in the e:\music\abba folder.

I hear what you are saying about multiple file selction, and I'm planning that as well, but it will have to be for a future release, as there will be quite a bit of code involved.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-18 18:17:17
3. Add option for FLAC compression level.

On another note, I have just managed to get the flac compression level setting working. I need to test it fully before releasing, though.

Initially, I tried adding an additional textbox on the main screen to take the compression level, but that design just wasn't working. So, I'm putting it in the Options menu, under  Compression Levels >> flac.

I'm doing a similar thing for Ogg Vorbis.

The settings will be persistent.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-18 18:31:47
I'm pleased to announce that the latest release of Ferocious (v1.0.7) now has Minimum Phase conversion (in addition to Linear Phase).
Ferocious v1.0.7 (https://github.com/jniemann66/ferocious)

I don't mind admitting that coding the algorithms to do this was pretty tough (for me, anyway - probably easy for someone who is much smarter than I ... :P ). Very educational, though ... learned a lot in the process !
The min-phase filtering is performing well, but I may need to do some tweaks to the cutoff frequency / sidelobe attenuation, so it's still a WIP ...

I also added some tooltips to the GUI - these can be switched off if/when they become annoying, via the menu.




Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-19 04:14:29
3. Add option for FLAC compression level.

On another note, I have just managed to get the flac compression level setting working. I need to test it fully before releasing, though.

Initially, I tried adding an additional textbox on the main screen to take the compression level, but that design just wasn't working. So, I'm putting it in the Options menu, under  Compression Levels >> flac.

I'm doing a similar thing for Ogg Vorbis.

The settings will be persistent.

As promised, the latest build (v1.0.8 ) (https://github.com/jniemann66/ferocious) allows you to set the compression level for flac (0 - 8 ) , and the quality level for vorbis (-1 - 10). This is available under the "options" menu. The settings are persistent (will be remembered the next time you start the app)

(Please note that as of the last 2 versions, an additional dll (libfftw3-3.dll) is required to be in the same folder as resampler.exe. This is because FFTs are required for the minimum-phase calculations, and therefore I used the fftw library.)
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-19 15:45:22
Hey...nice. Linear and min phase are in the GUI!!

Looking great!

Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-19 22:30:17
Using the latest GUI from today:

1. It will say not responding when converting (even though it is working fine).
2. The converter output remains blank when doing a batch conversion (probably shouldn't so user doesn't worry if working or not). Once processing is done the screen will fill.
3. In batch mode, the current file being processed is stated just near the bottom of the GUI, but never increments as a new file is processed.
4. On my screen the file name being processed has processed misspelled...says "rocessed"
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-20 02:18:22
Using the latest GUI from today:

1. It will say not responding when converting (even though it is working fine).
2. The converter output remains blank when doing a batch conversion (probably shouldn't so user doesn't worry if working or not). Once processing is done the screen will fill.
3. In batch mode, the current file being processed is stated just near the bottom of the GUI, but never increments as a new file is processed.
4. On my screen the file name being processed has processed misspelled...says "rocessed"

Thanks for the feedback - much appreciated. I think the whole multi-file processing engine needs an overhaul. I'm on it ...
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-23 17:24:21
Using the latest GUI from today:

1. It will say not responding when converting (even though it is working fine).
2. The converter output remains blank when doing a batch conversion (probably shouldn't so user doesn't worry if working or not). Once processing is done the screen will fill.
3. In batch mode, the current file being processed is stated just near the bottom of the GUI, but never increments as a new file is processed.
4. On my screen the file name being processed has processed misspelled...says "rocessed"

Build v1.0.9 should address those issues. It now has multiple-input-file selection, and it also has a multi-line editor to edit the list of files (or paste them in from clipboard if you really wanted to ...).
 
There are also "clear" buttons on the input and output filename boxes, for convenience.

When in multi-file mode, the output filenames are automatically generated according to the rules you set in "Output File Options". 
(I tried doing it various other ways, but they were getting way too complicated)
 
The problems with "Not responding" notifications and not updating the output window should be completely gone now.

I will update the documentation shortly. Ferocious File Conversion (https://github.com/jniemann66/ferocious)
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-25 02:12:16
I love this update...especially the flashing green conversion button!

A couple of notes:

1. I have not used the GUI for a while...just busy, but was at first disappointed that the Autoblank was missing...but there it was when dither was clicked! I just forgot. So, maybe it is useful to always have it displayed and greyed out if dither option is not used. It is the only option not presented anyway, so why not have it up?

2. Do you think having a prevent clipping box under normalization would be useful? I've never really understood the normalization values. With r8brain, SoX and others, they have prevent clipping options. No sure if you think it is a good idea or not.

3. Have a suggested dither amount populated. I'm not sure again what a dither of 1, vs 1.5 really means. Maybe it is just me.

Overall nice job!!!
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-25 04:25:02
Thanks very much for the feedback. I really appreciate you taking the time to test it out.

I love this update...especially the flashing green conversion button!

A couple of notes:

1. I have not used the GUI for a while...just busy, but was at first disappointed that the Autoblank was missing...but there it was when dither was clicked! I just forgot. So, maybe it is useful to always have it displayed and greyed out if dither option is not used. It is the only option not presented anyway, so why not have it up?

2. Do you think having a prevent clipping box under normalization would be useful? I've never really understood the normalization values. With r8brain, SoX and others, they have prevent clipping options. No sure if you think it is a good idea or not.

3. Have a suggested dither amount populated. I'm not sure again what a dither of 1, vs 1.5 really means. Maybe it is just me.

Overall nice job!!!

1. Autoblank is only relevant when dither is activated, Originally, I did have it disabled (rather than hidden) when dither was deactivated, but I didn't like the aesthetics of the way Qt rendered the disabled button - maybe I can work on it a bit with some css styling tweaks !

2.  Clipping protection is always activated - whenever clipping occurs, the program will notify you and run a second pass with an adjusted gain level to avoid clipping. The normalization values are 1.0 = maximum level (100%), 0.0 = silence (0%), anything between will give you something in between. eg 0.5 = half. Actually,  0.5 is about -6dB in decibels because of the logarithmic nature of hearing - to convert gain to dB, you use the formula dB=20*log10(gain)
It works the same way as Cool edit's normalize function except the latter uses a percentage (ie 0-100), whereas mine uses the equivalent range (0-1)

3. Done - I have pre-populated it with 1.0, and this will be in the next release.
I'm not sure how else I can explain the dither setting other than it represents how much dither to add. A lot of pro sound programs I know (eg Ozone, Cool Edit Pro, Samplitude etc) work the same way. For example, in Cool Edit Pro's "Convert Sample Type" function, it has "Dither depth (bits)" and the default is 1.

Anyway, once again - thanks very much. I will endeavour to make it as user-friendly and useful as possible.

Cheers,
Judd
 
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-25 21:46:06
sounds good!!

when you say:

Quote
2.  Clipping protection is always activated - whenever clipping occurs, the program will notify you and run a second pass with an adjusted gain level to avoid clipping. The normalization values are 1.0 = maximum level (100%), 0.0 = silence (0%), anything between will give you something in between. eg 0.5 = half. Actually,  0.5 is about -6dB in decibels because of the logarithmic nature of hearing - to convert gain to dB, you use the formula dB=20*log10(gain)
It works the same way as Cool edit's normalize function except the latter uses a percentage (ie 0-100), whereas mine uses the equivalent range (0-1)

What happens if one does not fill in a value for normalization?

I am under the impression that normalization changes overall volume to reach a fixed target level. And I think you only do this to either get the maximum volume you can or to match volumes. If one is simply re-sampling audio from, say 192/24 to 44.1/16, you really only need to worry about clipping, which is why some SRCs have a "Prevent Clipping" option. If yours already does this sanity check, then what is the default normalization value? I would think in most cases one would not want to have any value there? Seems to me this is the case, as I think normalization it technically destructive, even at 32-bit float.

Also, you interested in adding a "Stop" button to the gui?  Not sure if easy or necessary.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-26 03:56:02
What happens if one does not fill in a value for normalization?

Normalization is not activated unless you tick the Normalization box.
If You Tick it, and do not enter a value, it will default to 1.0

Quote
I am under the impression that normalization changes overall volume to reach a fixed target level. And I think you only do this to either get the maximum volume you can or to match volumes.
Yes, but technically it's the peak level. Normalization forces the peak level to be a particular level. In my app, if you switch normalization on, and set the value to 1.0, it will force the peak level to be 1.0 (ie maximum).
If you activate normalization, and set the value to 0.8, it will force the peak level to be 80% of maximum.

If you don't switch normalization on, it won't do this.

Quote
If one is simply re-sampling audio from, say 192/24 to 44.1/16, you really only need to worry about clipping, which is why some SRCs have a "Prevent Clipping" option. If yours already does this sanity check, then what is the default normalization value? I would think in most cases one would not want to have any value there? Seems to me this is the case, as I think normalization it technically destructive, even at 32-bit float.

It doesn't normalize unless normalizing is switched on. It runs the conversion, and keeps track of the peak level. If the peak output level doesn't exceed the maximum level, then great - conversion completed.
If, for whatever reason (usually due to filter overshoot), the peak signal exceeds the maximum value, then this is counted as clipping. The program keeps track of how much it exceeded the maximum level by, and then runs a second conversion, but this time with the level scaled down by the same amount as what it exceeded the maximum by, so that clipping won't happen the second time around.

Anyway, i don't really understand why anyone would actually want clipping (other than for experimental reasons), so the clipping protection mechanism is always on. 

Also, when you are going from 24-bit to 16-bit, I think you seem to be under the impression that 24-bit "goes louder" than 16-bit (and thus could potentially cause clipping), but the usual interpretation is that 0dB FS in 24bit is the same as 0dB FS in 16-bit (ie they both have the same maximum level). The difference is that the extra 8-bits of resolution in 24-bit are used for the "quiet" parts, so 24-bit is capable of going much quieter than 16-bit relative to the maximum level (-144dB vs -96dB respectively). This is the reason why dither is used when going from 24-bit to 16-bit (to try to preserve some of the lost resolution, which would otherwise be lost through truncation).

Now, about this "destructive" thing - If normalization is destructive ( a simple linear scaling of the data by a constant factor), then running your signal through a Low-pass Finite Impulse Response filter (Necessary to do resampling) must be significantly more destructive, because it has a large number of multiplications and additions performed on every sample, which theoretically introduce small, but cumulative arithmetic errors. In other words, the evils of normalization or any type of gain change are nothing compared to something like running a basic DSP filter.

Quote
Also, you interested in adding a "Stop" button to the gui?  Not sure if easy or necessary.

Absolutely - are you reading my mind ? :-)
Stop / pause / abort / save project ... etc - all in good time :-)
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-26 05:44:39
sounds good!!

What happens if one does not fill in a value for normalization?


I have given this some thought, (and in anticipation of what I suspect you may ask me next :-) - apologies if I was wrong ...) , I have populated the Normalization value with a default of 0.999 (99.9%) - I chose this instead of 1.0 because the conventional wisdom says that there is still some (mostly older) hardware out there with analog restoration filters that clip under some circumstances when given a Full-Scale digital signal. I don't know if this is still relevant these days, but it's just a precaution. I'm open to feedback if anyone can elaborate on it.

Cheers,
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-26 14:22:08
Quote
Yes, but technically it's the peak level. Normalization forces the peak level to be a particular level. In my app, if you switch normalization on, and set the value to 1.0, it will force the peak level to be 1.0 (ie maximum).
If you activate normalization, and set the value to 0.8, it will force the peak level to be 80% of maximum.

If you don't switch normalization on, it won't do this.

So, just to be clear, by utilizing your setting of 1.0, the volume of the audio file will be as loud as possible given the peak volume calculated at 0 dBFS, since normalizing to this value will make the "loudest" file subject to your prevent clipping detection? I've never normalized any audio..I don't record any and I figure the music I have is fine on its own, so I'm just trying to educate myself.  Do you use normalization?  If so, why?


One final thing, with long path names, sometimes the S in "Status: processing" gets cut off in the bottom of the GUI, maybe wrap it? Seems like enough room to wrap.

cheers!
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-05-26 15:36:04
So, just to be clear, by utilizing your setting of 1.0, the volume of the audio file will be as loud as possible given the peak volume calculated at 0 dBFS, since normalizing to this value will make the "loudest" file subject to your prevent clipping detection?

yes, setting it to 1.0 will force the peaks hit the maximum possible level, and make the file as loud as it can safely be (whilst still preserving the relative dynamics of the music). However, always keep in mind that the peak level and the "loudness" are two different, but related things.

For example, in contrast to normalizing, if you were to use a limiter or compressor, you could "squash" the dynamics of a track to make it sound louder, even though the peak levels are still the same. This is the basis of the dreaded "loudness war" which plagues so much of music mastered in the last 10-15 years.

Quote
I've never normalized any audio..I don't record any and I figure the music I have is fine on its own, so I'm just trying to educate myself.  Do you use normalization?  If so, why?

You need to have a specific reason to normalize.

Do I normalize my whole music collection ? No. and I don't recommend it - If you have some audio that has already been professionally mastered (which all professional releases should be), then just leave things alone.
 
However, there are other situations where normalizing is appropriate:
For example, suppose you are creating a sample library, to be played back on a MIDI keyboard. You are sampling an instrument (let's say a tenor saxophone), and you want to sample every note on the instrument. You want each of the samples to be as consistent as possible, So, you would probably want to normalize them so that they are all at a consistent level. (Later, you will be setting the attack/decay/sustain/release/ loop points etc for each note, and it's actually really hard work - I did this sort of thing once, years ago)

Another (more common) example, is when someone has given you a video (or just audio) recording to clean up and, for whatever reason, when they captured it, the microphone levels were not set up properly, and they are too quiet. In this situation, one of the first things you would consider doing is normalizing it, to get the level up. (Then you might consider some audio restoration techniques such as noise reduction etc, depending on how poor the quality of the source material).

Another application is in forensic audio, where you might need to amplify something really quiet.

Or, another situation (which I recently have been in), is testing out the dithering in my app - In order to really hear what it's doing, i sometimes normalize it to hear it up close (like a microscope for audio).

But to sum up - should you be using normalization on your pristine hi-fi. hi-rez audio ? I don't think so, unless you have a specific reason to do so.
  
Quote
One final thing, with long path names, sometimes the S in "Status: processing" gets cut off in the bottom of the GUI, maybe wrap it? Seems like enough room to wrap.

Ok, thanks - I'll look into it.
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-26 19:07:30
here is what I meant by the S being cut off

Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-05-28 14:25:31
New build fixes display issue....nice.

What else can I complain about???
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-06-03 07:14:24
New build fixes display issue....nice.

What else can I complain about???
haha - go for it !
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2016-06-04 14:09:46
maybe saving tags upon conversion? Is that possible?
Title: Re: New Audio File Conversion Tool
Post by: judd on 2016-07-11 05:14:07
maybe saving tags upon conversion? Is that possible?
Hey, yes, tagging would be possible for those formats which support metadata (tags) in the file.
However, I'd really like to get the UI design right for doing this, so I want to take some time to get it right.

Also, please note that the most recent build of Ferocious has a progress bar, which should help to give the app a more responsive feel.
The 64-bit binary is available here ferocious-converter64.zip (https://github.com/jniemann66/ferocious/blob/master/ferocious-converter64.zip) (click on "View Raw" to download the zip file).
Title: Re: New Audio File Conversion Tool
Post by: skypickle on 2016-10-31 01:43:38
thank you for making this tool. I wanted to convert an entire folder of files on a NAS. I can select all the files i want to convert when i 'browse' to the directory. However, I cannot specify the output directory. I tried typing in 'c:\music\*.flac' but when i hit the save button, nothing happens. I read the wildcard usage pdf but it seems, wildcards don't work in windows?
Title: Re: New Audio File Conversion Tool
Post by: ron spencer on 2017-02-01 14:49:04
I'm stuff using this program and think it is cool.

I notice on the github page:

https://github.com/jniemann66/ferocious

that you updated the resampler to 1.1.6. The about page on the exe does not have the updated version info. Just thought I'd let you know.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2017-03-09 04:22:38
Hi Ron,

Sorry - I haven't been on HA for a while, and haven't checked this thread until now.
I have resumed work on this in the last few months, and have made a lot of progress.

(Many thanks to the various users who have privately provided invaluable feedback - y'all know who you are !)

It's now up to v1.2.5 for both the front-end (Ferocious (https://github.com/jniemann66/ferocious)) and the command-line converter (ReSampler (https://github.com/jniemann66/ReSampler))

Some of the new features include:

... as well as a number of bugfixes.

The Ferocious front-end also now allows themes to re-skin the appearance of the app. (It would be cool if anybody out there who has good CSS skills could contribute some tasteful themes.).

The Windows binaries are available here:

Ferocious v1.2.5 (https://github.com/jniemann66/ferocious/releases/tag/v1.2.5) (Front-End - includes latest copy of ReSampler)

note: I haven't made an installer for this as yet - you just unpack the zip file to your hard drive. There are two flavors - 64-bit or 32-bit. (You can also replace the 64-bit ReSampler executable with the AVX version if your CPU supports it)

ReSampler v1.2.5 (https://github.com/jniemann66/ReSampler/releases/tag/v1.2.5)

Note: There are four different binaries here:

Work is also underway with porting it to Linux, with Mac and Android also being future possibilities.
I have also had discussions with various people about making a foobar2000 plugin version.

Cheers,

Judd
Title: Re: New Audio File Conversion Tool
Post by: judd on 2017-03-10 04:23:16
thank you for making this tool. I wanted to convert an entire folder of files on a NAS. I can select all the files i want to convert when i 'browse' to the directory. However, I cannot specify the output directory. I tried typing in 'c:\music\*.flac' but when i hit the save button, nothing happens. I read the wildcard usage pdf but it seems, wildcards don't work in windows?

Sorry for the late reply. The way I would do this is to go into the Options / Output File Options menu, and put in your target directory and file type (flac), and hit ok. This will automatically populate the "Output File(s)" box on the main screen for you.

Then, for input files, browse and select the files you want to convert.
Note: you can subsequently edit the list using the '...' button.
(Also, there is a limitation at the moment in that it doesn't traverse subdirectories - this may be a target for future enhancement).

(https://image.ibb.co/h5sr6F/Capture.png) (https://ibb.co/fXGJmF)
upload pic (https://imgbb.com/)

I hope this helps.
Title: Re: New Audio File Conversion Tool
Post by: judd on 2017-04-26 01:14:45
Just addressing this feedback, which came up in this thread (https://hydrogenaud.io/index.php/topic,113986/topicseen.html)

Maybe a bit off-topic but it seems that your software's UI is not DPI-aware. While hi-res audio does no harm to my ears a hi-res monitor does hurt my eyes. The recent Windows 10 Creators Update advocating improvement in UI scaling is a pure joke, I used it for no more than 3 hours and reverted to Windows 7.


Thanks for the feedback. Yes, it's true - ferocious just works on static pixel dimensions.
I will investigate what needs to be done to make it scale effectively to look great on a range of resolutions, for a future release.

Regards
Judd