HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: lvqcl on 2013-02-10 21:58:35

Title: De-emphasis components
Post by: lvqcl on 2013-02-10 21:58:35
Plugins to do de-emphasis of pre-emphasized CDs:
* Postprocessing (foo_deemph): works only with lossless sources; always active during playback and ReplayGain scan.
* DSP plugin (foo_dsp_deemph): works with any source

* To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.
* There's no reason to use both components at the same time.
* Don't use both foo_deemph and foo_dsp_effect (the latter has its own de-emphasis postprocessor).
* Note that even foo_dsp_deemph works only when a track is tagged: just adding it to the list of active DSPs is not enough to make it work.

Changelog:
0.1.1
- recompiled with latest SDK (2018-10-11). Works with foobar2000 1.4.x; users of 1.3.x need to download and install MSVC redist (here (https://aka.ms/vs/15/release/VC_redist.x86.exe)).
Title: De-emphasis components
Post by: Porcus on 2013-02-10 22:34:29
Nice.

* Don't use both foo_deemph and foo_dsp_effect (the latter has its own de-emphasis postprocessor).


Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?
Title: De-emphasis components
Post by: mudlord on 2013-02-11 03:50:10
I should deprecate deemphasis support and just get people to use lvqcl's component.

or update mine to use the tags dbpowerAMP uses...
Title: De-emphasis components
Post by: Sandrine on 2013-02-11 08:39:46
Why another component? Mudlord already had a nice solution!
Title: De-emphasis components
Post by: Porcus on 2013-02-11 11:12:46
Why another component?


It is even another two, facilitating choice between DSP and post-processing.  (Is that an answer? ;-)

I guess users may diverge on a “one module for each task” philosophy and “one wonder-do-it-all” philosophy – it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based “foo_fix_weird_CDs_dsp”.
Title: De-emphasis components
Post by: Sandrine on 2013-02-11 23:20:53
it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based "foo_fix_weird_CDs_dsp".


I didn't quite understand that - do you mean there is yet another plugin which can do de-emph automatically?
Title: De-emphasis components
Post by: Porcus on 2013-02-12 00:18:08
it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based "foo_fix_weird_CDs_dsp".


I didn't quite understand that - do you mean there is yet another plugin which can do de-emph automatically?


Ah, me meandering randomly away. No, there are a couple of effects I enable permanently while playing CD rips (because CD rips is something I like to keep bitperfect), and that is HDCD correction and de-emphasis. From an end-user point of view (my end-user point of view, I'd have to add), it makes more sense to have these separate from that component I only need when I process file-->file (which I would do with RIAA correction on a vinyl rip or Dolby on a tape rip).
Title: De-emphasis components
Post by: lvqcl on 2013-02-12 15:58:08
Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?

If you have a lossless track with PRE_EMPHASIS tag equal to 1 then it will be processed twice: with foo_deemph and with foo_dsp_effect. Not a good thing.

Why another component? Mudlord already had a nice solution!

The main reason for me: foo_dsp_effect adds several entries into the list of available DSPs. I prefer to have only one column in this list: it's much simpler to select a particular DSP in this case. (I already removed official EQ but it wasn't enough)
Title: De-emphasis components
Post by: Porcus on 2013-02-12 19:37:00
Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?

If you have a track with PRE_EMPHASIS tag equal to 1 then it will be processed twice: with foo_deemph and with foo_dsp_effect. Not a good thing.


Certainly, but foo_dsp_effect has other features that may be useful if its de-emphasis filter is disabled. I take it to mean that you don't know any technical incompatibilities (and my fb2k hasn't crashed while testing).
Title: De-emphasis components
Post by: mudlord on 2013-02-12 20:43:37
But end users might not want the extra DSPs, like reverb/echo/bass boost/pitch shifting.
Title: De-emphasis components
Post by: Porcus on 2013-02-13 13:30:10
But end users might not want the extra DSPs, like reverb/echo/bass boost/pitch shifting.


That is kinda my point. Your component does jobs I actively choose for processing files.
HDCD and de-emphasis OTOH, I apply to playback streams without altering files, in the background without my interacting.
So to me it makes sense to enable your DSP precisely when I need it, and otherwise keep it out.

But by all means keep the deemphasis in. There is no reason to take that one out of a do-it-all DSP component.
Title: De-emphasis components
Post by: mjb2006 on 2013-02-14 04:44:48
I just tested with a sine sweep, generated with SoX like this:

Code: [Select]
sox -b 16 -r 44100 -c 2 -n output.wav synth 40 sine 0:22050 gain -6

In foobar2000, I tagged the resulting WAV with PRE_EMPHASIS=1, then used the converter with various settings to produce de-emphasized output files. I then looked at the frequency analysis curves in Audition (Blackmann-Harris, FFT size 32768, linear scale, zoomed in a bit).

These all produce output that is, for all intents, identical to that of WaveEmph (http://www.picosound.de/E_SOFT.HTM#emphasis):
However, foo_dsp_effect (with the "CD de-emphasis" IIR filter preset enabled) is shockingly wrong. It only boosts the bass, resulting in quite a bit of clipping and aliasing. It's not even close to being correct. Did I do something wrong?
Title: De-emphasis components
Post by: lvqcl on 2013-02-14 15:01:11
foo_dsp_effect postprocessing service vs. SoX:

(http://i.imgur.com/YnSgetH.png)

If you want to use foo_dsp_effect de-emph IIR DSP filter then you should select the last option: "High shelf" (some bug in its code, apparently). Also, there should be no PRE_EMPHASIS tag in the file.
But even without this bug, foo_dsp_effect curve is noticeably steeper.
Title: De-emphasis components
Post by: mjb2006 on 2013-02-14 17:29:19
Something else of note: foo_convolve results in more samples output than were input. With input of 1,764,000 samples, the Wombat impulse produces 1,765,376, and the SoX impulse produces 1,764,032.

So at this point, I can only recommend WaveEmph, SoX, foo_deemph, or foo_dsp_deemph.
Title: De-emphasis components
Post by: lvqcl on 2013-02-14 17:36:01
Something else of note: foo_convolve results in more samples output than were input.

Try this: http://www.hydrogenaudio.org/forums/index....showtopic=85107 (http://www.hydrogenaudio.org/forums/index.php?showtopic=85107)
Title: De-emphasis components
Post by: mjb2006 on 2013-02-14 23:57:22
Oh, thanks...that did the trick. All is well with foo_dsp_convolve.
Title: De-emphasis components
Post by: nu774 on 2013-02-15 03:03:08
Quickly glanced at the code: https://github.com/FauxFaux/foo_mudlord/blo.../iirfilters.cpp (https://github.com/FauxFaux/foo_mudlord/blob/master/foo_dsp_effect/iirfilters.cpp)
Seems basically the same as biquad filter implementation of SoX, but is using sqrt(A + A) instead of 2 * sqrt(A) in SoX.

BTW doesn't fb2k read "FLAGS PRE" in cuesheet? It would be nice if fb2k reads it as metadata, and this plugin could be applied to it.
Title: De-emphasis components
Post by: mudlord on 2013-02-16 11:11:35
thank you for alerting me to the bugs, I really should rewrite iirfilters.cpp
Title: De-emphasis components
Post by: Sandrine on 2013-02-16 18:02:51
I forgot to say thanks for keeping tag support the same as in mudlord's component, so thanks for that!
Title: De-emphasis components
Post by: kumbbl on 2013-02-17 18:59:46
How good is the de-emphasis applied by the foo_deemph.dll compared to "sox deemph"? Can anybody judge this? Thanks in advance!
Title: De-emphasis components
Post by: lvqcl on 2013-02-17 21:03:14
How good is the de-emphasis applied by the foo_deemph.dll compared to "sox deemph"?

~ the same.
Title: De-emphasis components
Post by: mjb2006 on 2013-02-17 21:19:43
I'm just eyeballing graphical frequency-analysis plots of deemphasized sine wave sweeps, but foo_deemph and SoX deemph overlap nearly perfectly. And they're still within a few hundredths of a dB of the output of WaveEmph. I don't know which is closer to the ideal, but they're so close, it doesn't matter. The analog components that do the deemphasis in real CD players probably result in even greater variation.
Title: De-emphasis components
Post by: kumbbl on 2013-02-18 15:55:53
just tested with some preemphasis CDs and works like a charm - many thanks for this great and very valuable foobar-component!
Title: De-emphasis components
Post by: mjb2006 on 2013-02-18 20:03:08
With mudlord's new DLL I'm getting the same result as before. "CD De-emphasis" IIR Filter preset results in a massive bass boost, no attenuation.
Title: De-emphasis components
Post by: mudlord on 2013-02-18 23:57:06
needs rewriting i suppose. people can use lvqcl's dsp in the meantime.

or: mudlord.info/temp/foo_dsp_effect.zip
Title: De-emphasis components
Post by: kumbbl on 2013-02-19 04:59:22
just tested with some preemphasis CDs and works like a charm - many thanks for this great and very valuable foobar-component!


this concerns to foo_deemph.dll and NOT to foo_dsp_effect.dll!
Title: De-emphasis components
Post by: mudlord on 2013-02-19 09:39:11
fair enough.
in the foo_dsp_effect thread, I made a optional download for people that dont want the foo_dsp_effect's deemp postprocessor service.

that way, they can still use the superior component without it interfering.
Title: De-emphasis components
Post by: mjb2006 on 2013-02-19 22:21:22
The latest update to foo_dsp_effect has resolved the problem, so I wouldn't call any of them superior now... they're all equally good, IMHO:

original sweep = green
foo_dsp_effect = red
SoX deemph = yellow
WaveEmph = blue

foo_deemph, foo_dsp_deemph, and foo_dsp_convolver all produce results (almost?) identical to that of SoX deemph, so I didn't plot them.

(http://skew.org/tmp/hydrogenaudio/deemph/comparison.PNG)

If you want to have a look yourself, the WAVs are in the same folder as the graph (http://skew.org/tmp/hydrogenaudio/deemph/).
Title: De-emphasis components
Post by: EpicForever on 2013-02-24 18:49:25
OK, I have the question - what is the practical difference (in usage) between foo_deemph and foo_dsp_deemph ?
Title: De-emphasis components
Post by: lvqcl on 2013-02-24 19:06:49
I highlighted the relevant part in the 1st post with blue color. Or do you want to know something else?
Title: De-emphasis components
Post by: EpicForever on 2013-02-24 19:17:43
That blue text was there before I asked the question? Sorry for bothering you, looks like sometimes I'm blind :/ . That's exactly what I wanted to know. So looks like I need only foo_deemph, not dsp. Thanks.
Title: De-emphasis components
Post by: lvqcl on 2013-02-24 20:20:22
The text was there, the color wasn't 
Title: De-emphasis components
Post by: ManekiNeko on 2013-05-06 00:52:42
* To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.


Could foo_deemph be made to read 'FLAGS PRE' that already exist in my EAC/Cueripper cue sheets. I ask because I don't believe it is possible for foobar to read 'PRE-EMPHASIS' tag from an external cue sheet, eg, 'REM PRE_EMPHASIS yes'.
Title: De-emphasis components
Post by: lvqcl on 2013-05-06 15:35:44
If all tracks were made with pre-emphasis then you can add PRE-EMPHASIS tag to the image file. (And don't forget to reload tags for the corresponding cue sheet)
Title: De-emphasis components
Post by: Porcus on 2013-05-09 19:29:48
Is there any reason why these components are not in the official repository?
Title: De-emphasis components
Post by: themanintheshadows_2451 on 2013-06-26 21:07:01
* To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.


What does "add a tag" specifically mean? I added PRE_EMPHASIS=1 to pre-emphasis wav files via the field option in foobar2000, converted them, then converted another copy of the album using the de-emphasis function in SoX. Results are:

1) fb2k -0.77
2) SoX  -0.03

Obviously, the tag I added with fb2k for the first set of files didn't work. Is the tag the right type of tag? And if it isn't, what's the proper way to tag the files so that the foo_deemph works correctly?
Title: De-emphasis components
Post by: themanintheshadows_2451 on 2013-06-27 00:57:56
Added PRE_EMPHASIS to the file names, nothing. Also added it to the tag info of every file name (like 01. trackname.PRE_EMPHASIS.wav), still nothing. I'm starting to think that this plugin doesn't work with the latest fb2k. Going back to command line SoX. At least I know the damn thing works the way it's supposed to!
Title: De-emphasis components
Post by: marc2003 on 2013-06-27 01:01:05
you add tags via the properties dialog. highlight playlist items>right click>properties.

now right click a blank area>add new field. give it the name/value as instructed above.
Title: De-emphasis components
Post by: themanintheshadows_2451 on 2013-06-27 07:51:01
Finally got the damn thing to work. The results? Not that great. Of course, being that it replicates what you get in SoX, I'm not surprised. IMO, the de-emphasize feature isn't all that it's cracked up to be. The method that I use, oddly, is based on work that actually improves upon what they've did. It makes Black Sabbath's Preemph "Paranoid" go from sounding like mud (with SoX) to sounding so clear it blows your mind. I forget who I got it from here, but, dude, you've, most definately, got some skills. Whoever you are.
Title: De-emphasis components
Post by: drSeehas on 2013-08-18 08:33:19
I have two questions:
Title: De-emphasis components
Post by: EpicForever on 2013-08-18 08:55:43
The method that I use, oddly, is based on work that actually improves upon what they've did. It makes Black Sabbath's Preemph "Paranoid" go from sounding like mud (with SoX) to sounding so clear it blows your mind. I forget who I got it from here, but, dude, you've, most definately, got some skills. Whoever you are.

I don't understand. Do you use other component? other DSP? what is the "method that you use"? I'm quite curious
Title: De-emphasis components
Post by: lvqcl on 2013-08-18 09:14:21
Will ALL files been de-emphasized, even the majority which doesn't need it?

No

Where/How do I add the tag named PRE_EMPHASIS or PRE-EMPHASIS? Do I have to add it only for the dsp version or for both versions (which would answer question 1)?

As usual: right click -> Properties; or use any tagging program. For both.
Title: De-emphasis components
Post by: drSeehas on 2013-08-19 17:08:22
... As usual: right click -> Properties; or use any tagging program...

Thank you very much!
So I will use Mp3tag.

BUT:
As far as I understand, you can tag only e.g. .mp3 or .flac files.
How does it work for .wav files?
Title: De-emphasis components
Post by: db1989 on 2013-08-19 17:54:21
BUT:
As far as I understand, you can tag only e.g. .mp3 or .flac files.
How does it work for .wav files?
Nope, WAV files can be tagged too, although fewer programs support this; foobar2000 became one such program in v1.1.9 (changelog (http://www.foobar2000.org/changelog)).
Title: De-emphasis components
Post by: drSeehas on 2013-08-19 18:14:32
... WAV files can be tagged too, ...

Thank you very much!

And now one last question:
If I have only lossless sources, what is the advantage/disadvantage of using the Postprocessing or the DSP version?
Title: De-emphasis components
Post by: lvqcl on 2013-08-19 19:24:56
Use postprocessing if you want to add correct ReplayGain tags to your files.
Use DSP if you have lossy files that you want to de-emphasize.
Otherwise, there's no difference.
Title: De-emphasis components
Post by: SEMteXXL on 2013-12-16 12:17:09
@lvqcl

Thanks for this very interesting alternative. Especially post processing (foo_deemph) plugin. Personally I'm using convolver plugin with loaded De-emphasis impulse files :
Waves_De-Emphasis. I can't remember where did I found this but it contains impulse files for all 16, 24 and 32 bit files. I was able to do some listening tests in comparison with my original cds de-emphasized by analog circuitry in my player and I can't tell any difference at all. These are really great. Can I upload them so we can make some comparison with all others like in mjb2006 graph in previous post?

My next question is about the possibility of adding a line in status bar about anytime the plugin is active (foo_deemph). Something like for HDCD post processing plugin: HDCD: $if2($info(hdcd),no) Is it possible?! It would be awesome to see status Pre-Emphasis: Yes/No without any clicking and checking let's say “Yes” status could be in re color. Somebody skilled in syntax who can help here? Thanks again for help.
Title: De-emphasis components
Post by: SEMteXXL on 2013-12-16 13:21:02
Ok I tried some files which I de-emphasized by this plugin (on playback not permanently) and the result is pretty bad. It totally kills audio which sounds dull and dead. Especially stereo imaging is non-existent. Original cds sounds nothing like this. Something is wrong with post processing here. As I said convolver loaded with my impulses is far better. Strange.    You can try. Of course uncheck “Auto level adjust” option in convolver.

Waves_De-Emphasis (http://d01.megashares.com/dl/R51pfkg/Waves_De-Emphasis.rar)
Title: De-emphasis components
Post by: lvqcl on 2013-12-16 16:40:18
My next question is about the possibility of adding a line in status bar about anytime the plugin is active (foo_deemph). Something like for HDCD post processing plugin: HDCD: $if2($info(hdcd),no) Is it possible?! It would be awesome to see status Pre-Emphasis: Yes/No without any clicking and checking let's say “Yes” status could be in re color. Somebody skilled in syntax who can help here? Thanks again for help.

This plugin works if PRE_EMPHASIS tag is set to "1" so you can try something like $ifequal(%pre_emphasis%,1,Yes,No)

Ok I tried some files which I de-emphasized by this plugin (on playback not permanently) and the result is pretty bad. It totally kills audio which sounds dull and dead. Especially stereo imaging is non-existent. Original cds sounds nothing like this. Something is wrong with post processing here. As I said convolver loaded with my impulses is far better. Strange.    You can try. Of course uncheck “Auto level adjust” option in convolver.

Not confirmed: there's almost no difference between deemph and Waves impulse.
Title: De-emphasis components
Post by: SEMteXXL on 2013-12-16 17:48:10
My next question is about the possibility of adding a line in status bar about anytime the plugin is active (foo_deemph). Something like for HDCD post processing plugin: HDCD: $if2($info(hdcd),no) Is it possible?! It would be awesome to see status Pre-Emphasis: Yes/No without any clicking and checking let's say “Yes” status could be in re color. Somebody skilled in syntax who can help here? Thanks again for help.

This plugin works if PRE_EMPHASIS tag is set to "1" so you can try something like $ifequal(%pre_emphasis%,1,Yes,No)

Ok I tried some files which I de-emphasized by this plugin (on playback not permanently) and the result is pretty bad. It totally kills audio which sounds dull and dead. Especially stereo imaging is non-existent. Original cds sounds nothing like this. Something is wrong with post processing here. As I said convolver loaded with my impulses is far better. Strange.    You can try. Of course uncheck “Auto level adjust” option in convolver.

Not confirmed: there's almost no difference between deemph and Waves impulse.


Thanks for the swift responses. I appreciate it. I thing the whole concept of your foo_deemph plugin is best by far. Your files are untouched, you don't need to care anymore for manually activate your dsp when you put the right tags in your file and I can confirm it works absolutely flawlessly. Is there any possibility for some advanced option to load your own impulses instead the default one from sox? Something like in plugin for playing of SACD DSD files in your  computer. It has different switchable filters which are transforming DSD into PCM. That could make this one as the ultimate plugin and all you need. I'm not really some kind of programmer and sorry if I misunderstood the concept of your plugin but I think that the output even on post precessing plugin is based on sox deeemp .wav impulse..Right? BTW Thanks for the syntax for status bar.
Title: De-emphasis components
Post by: lvqcl on 2013-12-16 17:58:29
No, it is implemented as a biquad filter, it doesn't use any impulses.
Title: De-emphasis components
Post by: SEMteXXL on 2013-12-16 19:17:54
I see. I tried a little with status bar syntax and here are some possibilities. It was easier than I thought.

Code: [Select]
Pre-Emphasis: $if($meta(pre-emphasis),Yes,No)
or
Code: [Select]
Pre-Emphasis: $if($meta(pre_emphasis),Yes,No)
Depends on your tag name. It doesn't matter which value you are using 1, on or yes. It simply scans for PRE-EMPHASIS or PRE_EMPHASIS tag name presence.

second 
Code: [Select]
Pre-Emphasis: $ifequal($meta(pre-emphasis),1,Yes,No)
or again
Code: [Select]
Pre-Emphasis: $ifequal($meta(pre_emphasis),1,Yes,No)
This one only works with value 1 and NOT with on or yes. I guess there are other possibilities. Hope this helps.
Title: De-emphasis components
Post by: Hotsoup on 2014-09-17 15:33:25
I'm experiencing a strange problem - I've uninstalled this component (foo_dsp_deemph) but still seem to notice the effect when applying the %PRE-EMPHASIS% tag or deleting it. There is no active DSP in my chain, just replaygain. I'm currently at work though, looking to test if the same thing happens at my work station where I don't think I've ever installed either plugin, foo_deemph or foo_dsp_deemph. Anyone else able to reproduce this?

EDIT: I also checked for any leftover .dll's in the programs' component folder and APPDATA components folder.
Title: De-emphasis components
Post by: eahm on 2014-09-17 16:03:17
Is there an effective way to know if a CD/track has pre-emphasis?

Thanks.
Title: De-emphasis components
Post by: lvqcl on 2014-09-17 16:05:22
foo_dsp_effect also has its own deemph postprocessing. But IIRC it uses only PRE_EMPHASIS tag, and not PRE-EMPHASIS.
Title: De-emphasis components
Post by: Hotsoup on 2014-09-17 16:13:22
Is there an effective way to know if a CD/track has pre-emphasis?
I had a few in my collection that were known to have pre-emphasis: an old Dark Side of the Moon, New Order's Low-life (old Nimbus Factory disc), Journey's Frontiers (original US disc and Japan)... But I recently acquired two more discs from Japan on the Canyon label. I wouldn't have known unless dBpoweramp tagged them for me with %PRE-EMPHASIS% = Yes

IIRC, I believe there is a flag on the disc's TOC and/or subchanel information that lets EAC or dBpoweramp know and I'm not sure if any other ripping software besides iTunes accounts for these old discs (although some were or are still being manufactured for whatever reason).
Title: De-emphasis components
Post by: eahm on 2014-09-17 16:20:09
I had a few in my collection that were known to have pre-emphasis: an old Dark Side of the Moon, New Order's Low-life (old Nimbus Factory disc), Journey's Frontiers (original US disc and Japan)... But I recently acquired two more discs from Japan on the Canyon label. I wouldn't have known unless dBpoweramp tagged them for me with %PRE-EMPHASIS% = Yes

Sorry for keeping OT... mostly for the Pink Floyd albums, what if you only have the files and not the discs anymore, I've never tried but can you scan with dBpa for that feature?
Title: De-emphasis components
Post by: Hotsoup on 2014-09-17 16:47:07
foo_dsp_effect also has its own deemph postprocessing. But IIRC it uses only PRE_EMPHASIS tag, and not PRE-EMPHASIS.
When I noticed this, I was definitely using PRE-EMPHASIS. I know nothing about your code (or coding in general, sorry) but is there some part of post-processing leftover even after removing the component(s)? I'm just spit-balling..

@eahm : To quote one of Greynol's old posts on the subject "apart from an educated guess? no." On the other hand, they'll probably sound especially bright when not de-emphasized. There's a pretty good list going here (http://www.studio-nibble.com/cd/index.php?title=Pre-emphasis_(release_list)) and on Steve Hoffman's forum of known pre-emph CDs.
Title: De-emphasis components
Post by: eahm on 2014-09-17 17:50:35
@eahm : To quote one of Greynol's old posts on the subject "apart from an educated guess? no." On the other hand, they'll probably sound especially bright when not de-emphasized. There's a pretty good list going here (http://www.studio-nibble.com/cd/index.php?title=Pre-emphasis_(release_list)) and on Steve Hoffman's forum of known pre-emph CDs.

Yes, I saw both while ago, I'll ask again in the future, maybe they'll come up with something and I may have one or two albums only anyway. Thanks.
Title: De-emphasis components
Post by: Hotsoup on 2014-09-18 04:04:53
foo_dsp_effect also has its own deemph postprocessing. But IIRC it uses only PRE_EMPHASIS tag, and not PRE-EMPHASIS.

After getting back to the home office I was able to test this. You're right it was foo_dsp_effect and I didn't even make the mental connection to Mudlord's component, especially since it wasn't part of the DSP chain. FWIW, foo_dsp_effect also worked for the tag "PRE-EMPHASIS" and "Yes", not just "PRE_EMPHASIS" and "1". Thanks for the help. I don't know how I got so confused.
Title: De-emphasis components
Post by: madman5150 on 2014-12-28 18:06:14
Hi, I have downloaded the foo_deemph.zip and have a few questions:

- Is there a set of step by step instructions that a novice can follow to install?

- I am using ASIO4all, does foo-deemph just sit in front of that and pass the processed signal to it?

- I gather the filter cuts in automatically ONLY when a pre-emphasised file is detected and that non pre-emphasised files will pass untouched. Is this correct?

- If so, how do I ensure that the relevant files have the correct flag/code.


Sorry for all the questions - I thought the zip would have an idiots guide text file. 

Thanks in advance.
Title: De-emphasis components
Post by: lvqcl on 2014-12-29 15:41:31
1) "How do I install additional components?" from http://www.foobar2000.org/FAQ (http://www.foobar2000.org/FAQ)
2) This component doesn't interact with ASIO4ALL
3) Yes
4) From the 1st post in this thread: "add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes"
Title: De-emphasis components
Post by: milavla on 2015-04-08 11:00:51
lvqcl What's the difference between 0.0.3 and 0.1.0 Version?
Title: De-emphasis components
Post by: lvqcl on 2015-04-08 11:39:23
0.0.3 works only with audio with 44100 Hz samplerate.

0.1.0 can apply deemph filter to audio with 44100, 48000, 88200, 96000, 176400, 192000 Hz samplerate.
Title: De-emphasis components
Post by: milavla on 2015-04-09 10:03:35
lvqcl thanks
Title: De-emphasis components
Post by: Steve Forte Rio on 2015-06-29 07:46:33
Quote
Postprocessing (foo_deemph): works only with lossless sources; always active during playback and ReplayGain scan.


Does it mean that it always performs frequency response correction, no matter if audio has pre-emphasis or not? Or it also needs some flags in audio data to start de-emphasis?
Title: De-emphasis components
Post by: Rollin on 2015-06-29 11:35:51
Does it mean that it always performs frequency response correction, no matter if audio has pre-emphasis or not? Or it also needs some flags in audio data to start de-emphasis?

No.
To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.
Title: De-emphasis components
Post by: gism on 2015-07-03 18:14:54
Use postprocessing if you want to add correct ReplayGain tags to your files.
Use DSP if you have lossy files that you want to de-emphasize.
Otherwise, there's no difference.

I have image files with embedded cuesheet which is replaygained.
Excuse my ignorance, does this mean that I have to re-scan RG after any of these components is installed?
How do they affect RG values?
Title: De-emphasis components
Post by: lvqcl on 2015-07-03 18:39:58
Pre-emphasis increases the loudness of audio, and de-emphasis decreases it. So it makes sense to calculate loudness after applying de-emphasis.

foo_deemph allows this, so you may re-scan albums with pre-emphasis to get better RG values. It's not necessary, but advantageous.

OTOH, foo_dsp_deemph is a usual DSP plugin. It's not possible to take it into account during RG analysis. So, if you use this component then there's no reason to re-scan files (and this means that their loudness will always be slightly off).
Title: De-emphasis components
Post by: mjb2006 on 2015-07-03 22:09:52
Quote
this means that their loudness will always be slightly off

Just in case anyone wonders how far off: on Dark Side of the Moon (first CD mastering), it's a difference of 0.03 to 0.08 dB for each track, and 0.05 dB for the whole album. I can't imagine it would be much higher on an album with more high-frequency content. So it's absolutely nothing to worry about. You probably can't detect differences of less than 0.5 dB even with test tones in headphones anyway; see http://www.audiocheck.net/blindtests_index.php (http://www.audiocheck.net/blindtests_index.php).
Title: De-emphasis components
Post by: lvqcl on 2015-07-03 22:52:12
I have an image+cue for Dark Side of the Moon, and here the difference is 1.13 dB (album gain = +1.78 dB w/o de-emphasis, +2.91 with it). But even 1dB difference isn't that big actually.
Title: De-emphasis components
Post by: mjb2006 on 2015-07-04 00:19:58
Oh, good catch. I was actually comparing the wrong files!

When I do the R128-based RG scan against the original rip, with de-emphasis i get +2.86 dB, and without I get +1.78. So yes, about a 1 dB difference.

My old tags in the original rip said +2.91 instead of +2.86. This was where I was getting the 0.05 difference from. I'm guessing this is reflecting the use of different de-emphasis algorithms.
Title: De-emphasis components
Post by: milavla on 2015-08-28 08:19:16
lvqcl: foo_deemph works with any lossless sources (ape, wv) or only flac?
Title: De-emphasis components
Post by: marc2003 on 2015-08-28 09:37:39
read the first post... 

Quote
Plugins to do de-emphasis of pre-emphasized CDs:
* Postprocessing (foo_deemph): works only with lossless sources; always active during playback and ReplayGain scan.
* DSP plugin (foo_dsp_deemph): works with any source
Title: De-emphasis components
Post by: lvqcl on 2015-08-28 14:34:53
lvqcl: foo_deemph works with any lossless sources (ape, wv) or only flac?

It works with any decoder that supports postprocessing service. Monkey's Audio and WavPack included. Maybe it won't work with the current OptimFROG decoder...
Title: De-emphasis components
Post by: milavla on 2015-08-31 12:56:50
lvqcl: I have Monkey's Audio and WavPack lossless files, which work only with foo_dsp_deemph. Possibly older versions these codecs do not support postprocessing?
Title: De-emphasis components
Post by: lvqcl on 2015-08-31 15:11:33
What versions of foobar2000 and foo_input_monkey do you use?
Title: De-emphasis components
Post by: milavla on 2015-09-01 10:27:34
lvqcl: I tested it again and the problem is with files image + cue sheet. The first must load only image file, add metadata and Apply. Only then you can load cue file. If first load cue file, so add metadata don't save and it does not work!
Title: De-emphasis components
Post by: milavla on 2015-09-02 11:16:26
I see. I tried a little with status bar syntax and here are some possibilities. It was easier than I thought.

Code: [Select]
Pre-Emphasis: $if($meta(pre-emphasis),Yes,No)
or
Code: [Select]
Pre-Emphasis: $if($meta(pre_emphasis),Yes,No)
Depends on your tag name. It doesn't matter which value you are using 1, on or yes. It simply scans for PRE-EMPHASIS or PRE_EMPHASIS tag name presence.


or also
Code: [Select]
$if(%pre-emphasis%or%pre_emphasis%,Yes,No)
Title: De-emphasis components
Post by: yuki96 on 2015-11-22 04:06:49
Sorry if this was already discussed, but what advantages does this component over foo_dsp_effect's own CD de-emphasis post-processor, in terms of implementation? In other words, which one should I use if I am looking for accuracy?
Title: De-emphasis components
Post by: Cynic on 2015-11-22 11:50:19
Plugins to do de-emphasis of pre-emphasized CDs:
* Postprocessing (foo_deemph): works only with lossless sources; always active during playback and ReplayGain scan.
* DSP plugin (foo_dsp_deemph): works with any source

* To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.
* There's no reason to use both components at the same time.
* Don't use both foo_deemph and foo_dsp_effect (the latter has its own de-emphasis postprocessor).
*  Note that even foo_dsp_deemph works only when a track is tagged: just  adding it to the list of active DSPs is not enough to make it  work.

Use postprocessing if you want to add correct ReplayGain tags to your files.
Use DSP if you have lossy files that you want to de-emphasize.
Otherwise, there's no difference.
Title: De-emphasis components
Post by: yuki96 on 2015-11-22 18:13:04
Thank you for replying, but please re-read what I've posted above; I'm already aware of that information, and it does not answer my question. I'm asking which plugin has a higher quality CD de-emphasis post-processor: mudlord's foo_dsp_effect plugin, or lvqcl's foo-deemph.

Note that the plugin name "foo_dsp_effect" is a tad misleading, as it contains the functionality of both of lvqcl's plugins: foo_deemph (a post-processor), as well as foo_dsp_deemph (a dsp filter). I am only discussing the former (the post-processor).
Title: De-emphasis components
Post by: mjb2006 on 2015-11-23 10:18:47
As mentioned in my post earlier in this thread (https://www.hydrogenaud.io/forums/index.php?showtopic=99394&view=findpost&p=824806), they are all within a fraction of a dB of each other. Sonically they should be indistinguishable.

Here's the image that is supposed to be in that post. The original image link is no longer working in some browsers due to the forum going to HTTPS.

(https://skew.org/tmp/hydrogenaudio/deemph/comparison.PNG)

original sweep = green
foo_dsp_effect = red
SoX deemph = yellow (foo_deemph, foo_dsp_deemph, foo_dsp_convolver are identical to this)
WaveEmph = blue
Title: Re: De-emphasis components
Post by: Gluoniel on 2016-09-04 00:07:34
Hi, I have a problem with the "foo_deemph" component. I think is taking too much treble off some Flac files.

The Flac files are from the Human League CD, Dare! (CDV 2192); known to have pre-emphasis.

I tested the component with Michael Jackson's Thriller (35.8P-11) and it sounds great. It's just that Dare! album that's having the problem.
Title: Re: De-emphasis components
Post by: kode54 on 2016-09-05 03:57:39
The original image link is no longer working in some browsers due to the forum going to HTTPS.
It should at least display a thumbnail, since that's what the current HTTPSizer script does. Cache locally as a thumbnail, display a link to the original image.
Title: Re: De-emphasis components
Post by: stephan_g on 2017-01-27 11:37:36
Here's my experience with these guys.

Contrary to what's stated in the OP, foo_deemph / foo_dsp_deemph do work when fed AAC LC as M4A - but foo_deemph will indeed disregard MP3s. (I suppose the DSP component has no way of checking input file format.)

I'd rather have them work irrespective of format, since I've encountered at least one case of an album on Amazon MP3 and iTunes lately that seems to have been sourced from a rip of an emphasis CD with no deemphasis applied, with the CD issue not being easily available.

It also gets a bit messy when you've got both DLLs installed at the same time. If foo_dsp_deemph is in the DSP chain, then:
MP3, PRE-EMPHASIS tag set: Deemphasis applied once
M4A/FLAC, PRE-EMPHASIS tag set: Deemphasis applied twice
This potentially affects both playback and conversion.
I'd rather have the DSP component be entirely "dumb", so you can just add it to the DSP chain when needed and be sure that it'll apply deemphasis no matter what (sample rate permitting). Modifying the DSP chain or creating an additional conversion preset is no biggie (emphasis material isn't that common either unless you're into Japanese '80s stuff), but unpredictable / incorrect results are.

Another source of confusion arises when you use the converter to create a second version with deemphasis already applied to audio data. Foobar will duly transfer all tags, including the PRE-EMPHASIS field, so on playback of the converted files, deemphasis will be applied again (and potentially even twice as we've seen, so if you don't know what you're doing this could be up to 4 times total). You have to remove the field by hand. I don't think there's much that can be done about this, but it's still a nuisance. I suppose that's what happened with the guy two posts up.

I do wish things could be made to work just a little more predictably, without having to double-check that you're in fact getting the desired results.
Title: Re: De-emphasis components
Post by: Porcus on 2017-01-27 12:38:09
Tested the post-processor foo_deemph only, since I am lazy:

foo_deemph / foo_dsp_deemph do work when fed AAC LC as M4A - but foo_deemph will indeed disregard MP3s. (I suppose the DSP component has no way of checking input file format.)

mp3 as m4a: pre-emphasis APPLIED
mp3 as mka: pre-emphasis tag DISREGARDED

As for conversion: is there any way the component can interfere with the conversion when DSP is set to be applied, so that it removes the tag?
Title: Re: De-emphasis components
Post by: lvqcl on 2017-01-27 12:47:22
Contrary to what's stated in the OP, foo_deemph / foo_dsp_deemph do work when fed AAC LC as M4A - but foo_deemph will indeed disregard MP3s.
foo_dsp_deemph should work with all formats, but foo_deemph should be inactive with lossy formats.
So the fact that foo_deemph is also active for AAC all codecs in MP4 container looks like a bug in foobar2000.

It also gets a bit messy when you've got both DLLs installed at the same time. If foo_dsp_deemph is in the DSP chain, then:
MP3, PRE-EMPHASIS tag set: Deemphasis applied once
M4A/FLAC, PRE-EMPHASIS tag set: Deemphasis applied twice
If you have them both installed and active then it's expected, no?

This potentially affects both playback and conversion.
It affects conversion only if "Enable decode postprocessing" checkbox is on, in this case foo_deemph is also active during conversion.
If this checkbox is off then only foo_dsp_deemph can work.

mp3 as m4a: pre-emphasis APPLIED
Maybe foobar2000 sends anything in MP4 container into postprocessing service because of ALAC codec.

As for conversion: is there any way the component can interfere with the conversion when DSP is set to be applied, so that it removes the tag?
I doubt it.
Title: Re: De-emphasis components
Post by: Porcus on 2017-01-27 12:59:51
Maybe foobar2000 sends anything in MP4 container into postprocessing service because of ALAC codec.

The tag seems to be disregarded for AC3-in-mp4.
Title: Re: De-emphasis components
Post by: Porcus on 2017-02-09 00:46:29
I've encountered at least one case of an album on Amazon MP3 and iTunes lately that seems to have been sourced from a rip of an emphasis CD with no deemphasis applied, with the CD issue not being easily available.

lvqcl:
If you allow a little bit of user configuration, this could be accommodated.
The component will apply de-emphasis if it reads a tag value of "1", "on" or "yes".
Suggestion: let the user choose the tag values that the DSP shall observe. E.g., the user could choose to let the DSP be triggered by the tag value "lossy". That is "human readable": the user will know that this is a file that "arrived as lossy with the wrong EQ". (Makes it easier to know whether I did myself carelessly convert from lossless to lossy.)
Title: Re: De-emphasis components
Post by: fireattack on 2017-06-30 11:36:45
Hi, is there any chance to let "foo_deemph" active with lossy format (with pre-emphasis tag) as well? Like a switch?

The reason I asked so is because I have some MP3 rips of pre-emphasis CDs which unfortunately are not available any more. So all I have are those MP3 copies.

While I can just use foo_dsp_deemph instead, the problem is that one doesn't work with ReplayGain. I.e. when calculating RG, it doesn't take de-emphasis into consideration because it's a DSP, not in post-processing.

Thanks.
Title: Re: De-emphasis components
Post by: lvqcl on 2017-06-30 15:15:53
It's limited by foobar2000 itself, not by this component.
Title: Re: De-emphasis components
Post by: Porcus on 2017-06-30 17:02:55
The reason I asked so is because I have some MP3 rips of pre-emphasis CDs which unfortunately are not available any more. So all I have are those MP3 copies.

Your problem is to get RG calculated? Unless you want to rely on the issue I had with mp3-in-m4a, see above, then I suggest:

1) Transcode them to a lossless format, with tags preserved.
2) Throw in the PRE-EMPHASIS tag in the lossless ones.
3) RG scan those.
4) Use MP3Tag to copy over the tags. It copies RG tags too.
5) Fix the PRE-EMPHASIS tag in the mp3s. (Delete or keep as a reminder, whatever suits you.)
Title: Re: De-emphasis components
Post by: fireattack on 2017-07-01 03:24:13
The reason I asked so is because I have some MP3 rips of pre-emphasis CDs which unfortunately are not available any more. So all I have are those MP3 copies.

Your problem is to get RG calculated? Unless you want to rely on the issue I had with mp3-in-m4a, see above, then I suggest:

1) Transcode them to a lossless format, with tags preserved.
2) Throw in the PRE-EMPHASIS tag in the lossless ones.
3) RG scan those.
4) Use MP3Tag to copy over the tags. It copies RG tags too.
5) Fix the PRE-EMPHASIS tag in the mp3s. (Delete or keep as a reminder, whatever suits you.)

Very elegant solution! Thanks!
Title: Re: De-emphasis components
Post by: fireattack on 2017-07-01 05:37:07
I should add, though, the whole process is actually more tedious:

To get RG scan to include de-emphasis, I have to use foo_deemph (because DSP version will not work when calculating RG).

Then, when I finished the whole process, I have to switch back to DSP version for playback, because foo_deemph doesn't work with lossy format. And I can't just keep two versions active at the same time because that will double de-emph the lossless ones, obviously.

So basically, everytime I want to deal with some pre-emphasized lossy formats, I have to restart foobar2000 quite a few times to disable those components.

(Also, you said I can delete those pre-emphasis tag in MP3s at the end, but I actually still need them because my MP3s are still pre-emphasized.)

Oh, but maybe I can just apply de-emphasis during transcoding via DSP (instead of using tag; actually you surely should remove the tag afterwards to avoid essential double deemph), then RG scan, then copy RG info to previous MP3s. This way, I don't need foo_deemph at all.

Also thanks for your reply, lvqcl.
Title: Re: De-emphasis components
Post by: fireattack on 2017-07-02 10:59:09
Bug:

foo_deemph doesn't work with FLAC+embedded CUE when only some tracks have pre_emphasis tag.
The tag is totally disregarded (i.e no de-em applied).

foo_dsp_deemph doesn't have this problem.
Title: Re: De-emphasis components
Post by: lvqcl on 2017-07-02 12:18:24
foo_deemph doesn't work with FLAC+embedded CUE when only some tracks have pre_emphasis tag.
The tag is totally disregarded (i.e no de-em applied).
I doubt that it's possible to hava different PRE_EMPHASIS tags in a FLAC file with embedded CUE.

AFAIK this tag inside embedded CUEs is ignored by foobar2000, and if it's in the FLAC file then it's applied to all tracks.


foo_dsp_deemph doesn't have this problem.
Do you mean foo_dsp_deemph made by mudlord or foo_dsp_deemph from this thread?
Title: Re: De-emphasis components
Post by: fireattack on 2017-07-02 21:23:07
AFAIK this tag inside embedded CUEs is ignored by foobar2000

You're right, but that exactly is why you can add "pre-emphasis" to only part of the the tracks:

(https://my.mixtape.moe/ywalvq.gif)

You actually can't do it with actual CUE files.

In the same vein, you can even have different "ALBUM" tags for different tracks within one single FLAC file, despite you can't do it with CUE (in foobar2000, embedded CUE is only there to provide index timestamps AFAIK).


Do you mean foo_dsp_deemph made by mudlord or foo_dsp_deemph from this thread?

The one developed by you in this thread. It can detect the tag correctly, de-em (and only de-em) the tracks with pre-em tags.
Title: Re: De-emphasis components
Post by: Juha on 2017-09-20 19:57:41
These quite accurate coefficients are calculated in Octave using MIM (Magnitude Invariance Method). I did these calculations 'bout a year ago.

Code: [Select]
IIR filter coefficients for CD 

pre-emphasis

order  [num]
       [den]

1   [ 0.46502919 -0.08587729 ]
    [ 1.0        -0.62084810 ]

2   [ 0.46039863 0.12793807 -0.04856151 ]
    [ 1.0       -0.15829192 -0.30193289 ]

3   [ 0.46017735 0.36661178 -0.00875582 -0.02057091 ]
    [ 1.0        0.36049763 -0.44176711 -0.12126812 ]

4   [ 0.46016861 0.60879421  0.15632160 -0.03386380 -0.00771702 ]
    [ 1.0        0.88680338 -0.31259764 -0.34623051 -0.04427164 ]

5   [ 0.46016813 0.85120377  0.44874398  0.02498515 -0.02531949 -0.00269302 ]
    [ 1.0        1.41358954  0.09309909 -0.53516182 -0.19924854 -0.01518974 ]

6   [ 0.46016811 1.09387524 0.869244888  0.22317697 -0.02253671 -0.01394880 -0.00090035 ]
    [ 1.0        1.94094357 0.776877703 -0.54272822 -0.46296216 -0.09803154 -0.00502000 ]

8   [ 0.46016811 1.07486732 0.614144690 -0.28201629 -0.37418109 -0.08705805  0.01121497 0.00482825 0.00025508 ]
    [ 1.0        1.89963712 0.240531593 -1.39566438 -0.70552789 0.172873179  0.17618023 0.03277840 0.00141473 ]

de-emphasis

order  [num]
       [den]
1   [ 2.12788780 -1.30498995 ]
    [ 1.0        -0.17710215 ]

2   [ 2.17089358 -0.30993361 -0.67547310 ]
    [ 1.0         0.29340958 -0.10792271 ]

3   [ 2.17300832  0.81716225 -0.96263811 -0.27531828 ]
    [ 1.0         0.81222848 -0.01347376 -0.04654055 ]

4   [ 2.17311339  1.95699625 -0.66588831 -0.76587166 -0.10071593 ]
    [ 1.0         1.33672688  0.35187712 -0.07344653 -0.01752371 ]

5   [ 2.17311860  3.10009349  0.23008501 -1.17063737 -0.44398916 -0.03464344 ]
    [ 1.0         1.86274168  0.99361199  0.05978604 -0.05597792 -0.00613466 ]

6   [ 2.17311885  4.24512445  1.72940632 -1.17435914 -1.02141556 -0.21945040 -0.01146182 ]
    [ 1.0         2.38964825  1.91337654  0.49890284 -0.04781872 -0.03109218 -0.00205401 ]

8   [ 2.17311887  3.84681874 -0.22310992 -3.62676223 -1.51777033  0.61575440  0.49615426 0.08964053 0.00387487 ]
    [ 1.0         2.20636064  0.93494492 -1.07017666 -1.03881467 -0.22165432  0.03315453 0.01320640 0.00069833 ]

Magnitude response comparison against sox (new) and BLT based filters:
https://s26.postimg.org/qzlvoowex/cd_emph.png
(plot range: 20Hz-22050Hz)
Title: Re: De-emphasis components
Post by: Juha on 2017-09-21 08:40:55
MIM method has some aliasing issue with low order filters so I made improved 1st order coefficients :

Code: [Select]
1 [ 0.45855794 -0.08474775 ]
  [ 1.0    -0.62618980 ]

1 [ 2.15724369 -1.33446450 ]
  [ 1.0    -0.17722082 ]

Magnitude quite close with sox new.
Title: Re: De-emphasis components
Post by: isidro on 2017-12-09 16:29:38
Is there a way to have stauts indication about PREemphasis being applied? (as in HDCD)
Thanks!
Title: Mudlord's (2018-02-09) component shows strange behavior? Or is it just me?
Post by: mus1c1smyl1fe on 2018-10-18 11:51:35
Hi everybody, I am new here. I had a strange problem with Mudlord's De-emphasis postprocessor I recently downloaded from https://www.foobar2000.org/components/view/foo_dsp_deemph - or let's say it worked differently from what I expected: As soon as it was installed, every audio file I played that had the pre-emphasis tag was played with de-emphasis applied, even when the plugin was not listed in "Actice DSPs". I wanted more control, so I removed the component, and I was happy to find out that the foo_dsp_deemph.zip (version 0.0.3) available at the beginning of this thread works exactly the way I like: Does not do anything as long as it is not added to Actice DSPs, and starts de-emphasising files during playback as soon as I add it to Active DSPs.

Anyway, given that the components posted here are from 2013, I am wondering if there are any updates? Or aren't there any updates because the tools work just right? (That would make sense.)

Also, did anyone else encounter the problem I had with (the current version of) Mudlord's component?
Title: Re: De-emphasis components
Post by: MJmusicguy on 2018-10-18 18:46:11
 use
 http://www.foobar2000.org/components/view/foo_dsp_effect instead put your cd in. File, Open Audio Cd, it should find your drive, hit Rip, A dialog box comes up, you can use any of the databases for the track listing, now hit the button "Proceed to the converter set up dialog"
Now another box comes up, in the left box it has your saved presets, if any just delete them all, we'll start from scratch, on the right hand side you can choose output format, pick whatever suits you, now click on 'processing' another box appears, check the box in the upper left, now in the right hand box you will see a box filled with different filters and such, scroll till you find IIR Filter, highlight it and click the arrow so it goes into the Active DSP box, now highlight that and click on 'configure selected' there will be a dropbox, select 'CD-De-emphasis" click ok, now you can go 'Back' now you "Save' that preset, and it should show in the left hand box "Saved Presets", I just named mine 'pre' , now hit the 'convert' button, a file destination folder will pop up, so just direct it where you want the files (songs) to go. a 'converter' box will pop up adding the new EQ while it's ripping the disc :)
Now whenever you have another disc with pre, after you hit 'Rip' you now have a choice of using the preset
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-21 19:11:34
use
 http://www.foobar2000.org/components/view/foo_dsp_effect instead put your cd in. File, Open Audio Cd, it should find your drive, hit Rip, A dialog box comes up, you can use any of the databases for the track listing, now hit the button "Proceed to the converter set up dialog"
Now another box comes up, in the left box it has your saved presets, if any just delete them all, we'll start from scratch, on the right hand side you can choose output format, pick whatever suits you, now click on 'processing' another box appears, check the box in the upper left, now in the right hand box you will see a box filled with different filters and such, scroll till you find IIR Filter, highlight it and click the arrow so it goes into the Active DSP box, now highlight that and click on 'configure selected' there will be a dropbox, select 'CD-De-emphasis" click ok, now you can go 'Back' now you "Save' that preset, and it should show in the left hand box "Saved Presets", I just named mine 'pre' , now hit the 'convert' button, a file destination folder will pop up, so just direct it where you want the files (songs) to go. a 'converter' box will pop up adding the new EQ while it's ripping the disc :)
Now whenever you have another disc with pre, after you hit 'Rip' you now have a choice of using the preset

Wow, thank you very much for the detailed description, it is appreciated!

However, this is not exactly what I want. I have ripped multiple pre-emphasised discs with EAC, they are now put away in store; I have the FLAC files on my PC, and what I am looking for is a way of playing these files the way they are, with de-emphasis added on the fly. The tools discussed here are exactly what I need.

Anyway, I am just interested in why Mudlord's plugin simply de-emphasises every PE-tagged file I play even when the plugin is NOT listed in "Active DSPs"; and if there's any updates the the components shared in the first post of this thread.

P.s.: I just noticed that lvqcl's foo_dsp_deemph.zip seems to have a weird bug: I played two FLAC files from two different folders, both have the PRE-EMPHASIS tag properly set to "1"; and lvqcl's DSP plugin is listed in "Active DSPs". Now, one file gets de-emphasised - and one doesn't! I experimented a bit and found out this: When I copied he file that didn't get de-emphasised to a different location on my hard drive with much less subdirectories and shorter folder names, it suddenly did get de-emphasised properly. I added both, the original file at the original location and the one I had moved to a different location, to the playlist, and indeed: 100% identical files sound differently because one does not get de-emphasised apparently because its file path is too long! I am just happy I figured this out quickly. Will re-organise my folders now in order to avoid long paths with too many letters.
Title: Re: De-emphasis components
Post by: Rollin on 2018-10-21 19:15:16
I am just interested in why Mudlord's plugin ignores simply de-emphasises every PE-tagged file I play even when the plugin is NOT listed in "Active DSPs"
Because it is postprocessor, not just DSP. Did you read its description?
Quote
Performs RIAA CD/phono deemphasis eith as a decode postprocessor or selectable DSP.
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-21 19:18:38
I am just interested in why Mudlord's plugin simply de-emphasises every PE-tagged file I play even when the plugin is NOT listed in "Active DSPs"
Because it is postprocessor, not just DSP. Did you read its description?
Quote
Performs RIAA CD/phono deemphasis eith as a decode postprocessor or selectable DSP.

Thanks! Yes, I read that. But I am pretty new to this kind of stuff, I wasn't sure what it means. Does it mean that as soon as the Plugin is installed, it will start de-emphasising every file that is played and has the PRE-EMPHASIS tag set to "1" or "yes"?

EDIT: But given that the description says EITHER postprocessor or selectable DSP, there should be a way to use it as DSP rather as postprocessor, no? I just didn't find out how I can do that.
Title: Re: De-emphasis components
Post by: Rollin on 2018-10-21 19:27:04
As postprocessor it works on files that have tag PRE_EMPHASIS or PRE-EMPHASIS with value "1", "on" or "yes" even if it is not in active DSP list. As DSP it works on ALL files if it is in active DSP list.
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-21 20:20:37
As postprocessor it works on files that have tag PRE_EMPHASIS or PRE-EMPHASIS with value "1", "on" or "yes" even if it is not in active DSP list. As DSP it works on ALL files if it is in active DSP list.

I see, thanks! So that's a big difference to lvqcl's foo_dsp_deemph.zip, right? Because on my PC, lvqcl's DSP plugin does only de-emphasise files that have the  PRE_EMPHASIS or PRE-EMPHASIS with value "1", "on" or "yes". Why is lvqcl's DSP plugin not available on Foobar's official components page anyway?
Title: Re: De-emphasis components
Post by: MJmusicguy on 2018-10-21 21:41:15
what it means is post processing rarely works unless marked loading as a dsp is mush simpler especially when the preset is used but be sure only use it on content you know needs it because it will per mentally alter the file
dont worry about anything just follow my  instructions
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-23 16:47:04
what it means is post processing rarely works unless marked loading as a dsp is mush simpler especially when the preset is used but be sure only use it on content you know needs it because it will per mentally alter the file
dont worry about anything just follow my  instructions

I do appreciate your comments. However, altering the file permanently really isn't what I want. I want the de-emphasis to be done on-the-fly. And given that, it seems that for now, I will have to accept one drawback or other: Either I use Mudlord's plugin as a postprocessor, in which case I will have to accept that the only way of stopping it from automatically de-emphasising all PE-tagged files is to uninstall it. (My problem with this is that sometimes I WANT to hear how a PE'ed recording sounds without de-emphasis treatment.) Or I use lvqcl's foo_dsp_deemph.zip, in which case I will have to accept that it doesn't work with long file paths. That's why I would be very interested in an update for lvqcl's DSP plugin.
Title: Re: De-emphasis components
Post by: lvqcl on 2018-10-23 17:30:53
it doesn't work with long file paths.

I very much doubt it. Are you sure that foobar2000 sees PRE-EMPHASIS tag in that file?

Also try this: right click on the file -> Tagging -> Reload info from files (if you don't have such menu item then hold Shift key during right click).
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-23 19:29:18
it doesn't work with long file paths.

I very much doubt it. Are you sure that foobar2000 sees PRE-EMPHASIS tag in that file?

Also try this: right click on the file -> Tagging -> Reload info from files (if you don't have such menu item then hold Shift key during right click).

Thanks for your response! As explained above, I made an exact copy of the file to a different folder with a shorter path, and that one worked without a problem. Anyway, I can do another test, I will report my finding. Thanks for your great tool anyway, even with the path problem it is still very helpful.
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-24 11:02:33
it doesn't work with long file paths.
I very much doubt it. Are you sure that foobar2000 sees PRE-EMPHASIS tag in that file?
Also try this: right click on the file -> Tagging -> Reload info from files (if you don't have such menu item then hold Shift key during right click).

Thanks again for your reply. I just repeated the test. And now your plugin just works, for both copies of the file. I have no idea why it didn't before, I did repeat the test several times when I did it first. Anyway, the important thing is that it works now. :-)

Is the version that you posted at the beginning of this thread the most recent one?

Thanks and kind regards
Title: Re: De-emphasis components
Post by: lvqcl on 2018-10-24 17:15:16
There's also beta version: https://hydrogenaud.io/index.php/topic,115734.0.html
Title: Re: De-emphasis components
Post by: Porcus on 2018-10-25 09:36:39
There's also beta version: https://hydrogenaud.io/index.php/topic,115734.0.html
Oh. What about taking them to the official repository?
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-25 13:59:04
There's also beta version: https://hydrogenaud.io/index.php/topic,115734.0.html

Great, thank you very much!
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-25 16:12:43
There's also beta version: https://hydrogenaud.io/index.php/topic,115734.0.html
Oh. What about taking them to the official repository?

Good idea!
Title: Re: De-emphasis components
Post by: lvqcl on 2018-10-25 18:00:38
Oh. What about taking them to the official repository?

There's already foo_dsp_deemph (http://www.foobar2000.org/components/view/foo_dsp_deemph) (by mudlord) there.
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2018-10-26 09:49:28
Oh. What about taking them to the official repository?

There's already foo_dsp_deemph (http://www.foobar2000.org/components/view/foo_dsp_deemph) (by mudlord) there.

Yes, but as discussed above, it works very differently from yours. I didn't even know that before it was explained by Rollin above. For my purposes, your plugin is much better. Why not add it to the repository and shortly explain the difference in the description? And maybe rename yours in order to avoid confusions? Just making suggestions of course.
Title: Re: De-emphasis components
Post by: dartira on 2020-02-11 16:33:42
Thank you, lvqcl, for this great component.
It works like a charm and I prefer the post-processing way.
Very handy for ReplayGain.

I have a question: would it be possible to indicate its status when the de-emph porcess is active?
Of course, you could use the PRE_EMPHASIS tag, but I'm talking about visual feedback when the component is actually in circuit, during playback.
Is there some way doing that?

Thanks.
Title: Re: De-emphasis components
Post by: Cannonaire on 2020-09-30 19:40:06
I don't know if there's a better place to put this, but I made a column script to display "Yes" if the PRE-EMPHASIS or PRE_EMPHASIS tag is present and valid. It will display "INVALID" if the tag is not valid. I made sure it works for all valid tags regardless of capitalization because the values "yes" or "on" are not case-sensitive for activating the de-emphasis plug-in. I found this functionality useful and thought others here might as well.

$if(%PRE-EMPHASIS%,$if($or($stricmp(%PRE-EMPHASIS%,1)$stricmp($upper(%PRE-EMPHASIS%),ON)$stricmp($upper(%PRE-EMPHASIS%),YES)),Yes,INVALID))$if(%PRE_EMPHASIS%,$if($or($stricmp(%PRE_EMPHASIS%,1)$stricmp($upper(%PRE_EMPHASIS%),ON)$stricmp($upper(%PRE_EMPHASIS%),YES)),Yes,INVALID))
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2020-12-30 12:41:54
Oh. What about taking them to the official repository?

There's already foo_dsp_deemph (http://www.foobar2000.org/components/view/foo_dsp_deemph) (by mudlord) there.
Does anyone here know why mudlord's foo_dsp_deemph component is not available on the Foorbar2000 components webpage anymore?
(I don't find it anywhere else anymore either.)
Sorry if this is the wrong thread to ask that, I just didn't know what the right place was.
Happy new year everybody.

EDIT: The mudlord component can still be found here:
https://web.archive.org/web/20200628051501/http://www.foobar2000.org/components/view/foo_dsp_deemph
Title: Re: De-emphasis components
Post by: thomian on 2021-11-25 14:05:22
here is the latest version 2.0 of the component...
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2021-11-25 14:14:32
here is the latest version 2.0 of the component...
Thank you very much.
Title: Re: De-emphasis components
Post by: thomian on 2021-11-25 18:43:28
and here is the installation file, for those who aren't able to install the component manually...
Title: Re: De-emphasis components
Post by: mudlord on 2021-11-28 08:35:16
Does anyone here know why mudlord's foo_dsp_deemph component is not available on the Foorbar2000 components webpage anymore?

Because I thought lvqcl's stuff completely replaces it :/
Title: Re: De-emphasis components
Post by: mus1c1smyl1fe on 2021-11-28 08:47:06
Does anyone here know why mudlord's foo_dsp_deemph component is not available on the Foorbar2000 components webpage anymore?

Because I thought lvqcl's stuff completely replaces it :/
Thanks for the reply!

Sounds like one more reason to try and get lvqcl's plugin into the official components' list.