Hi,
I have roughly studied the code and found that madplay didn't have an equalizer function, though there exists a file, named equalizer.c . If I want to add the equalizer function in, how to do it? Can I just use the functions in equalizer.c ? And where should I call them?
By the way, where can I find the information of equalizing different type of music, ex classical, pop, jazz... I mean what should the values be from 60Hz to 16k Hz?
Thank you in advance.
On Wednesday, September 3, 2003, at 04:23 AM, hank.jan@billionton.com.tw wrote:
I have roughly studied the code and found that madplay didn't have an equalizer function, though there exists a file, named equalizer.c . If I want to add the equalizer function in, how to do it? Can I just use the functions in equalizer.c ? And where should I call them?
You can experiment with building an equalizer using just the provided subband samples, but experience has shown this does not always produce optimal results.
You are probably better off operating on the final output PCM samples. (You can use the extra resolution provided to avoid any loss of quality.)
On Tue, Sep 23, 2003 at 03:24:20PM -0700, Rob Leslie wrote:
You can experiment with building an equalizer using just the provided subband samples, but experience has shown this does not always produce optimal results.
You are probably better off operating on the final output PCM samples. (You can use the extra resolution provided to avoid any loss of quality.)
By the way, if anyone knows of fast (eg. fast enough to run a stream, possibly two, in realtime in a game), acceptable-quality, BSD-licensed or similar[1] implementations of an equalizer or resampler, I'd love to know of it. I don't know enough on the topic to write my own.
The only equalizer code I've looked at is the ones FB2k uses, but that takes about 8% CPU on my K7/1000 for a single stream, which is far too much.
I've looked at lots of resampling code, but most fall over on 44.1<->48khz. FB2k's does it, but it's also too expensive (also about 8% on my machine). I need arbitrary rate changes, as the game has modes which play music at variable rates (but it doesn't need to be able to change resample rates smoothly).
[1] or LGPL or GPL--beggars and choosers and so on--but permissive is preferable
On Tuesday, September 23, 2003, at 04:00 PM, Glenn Maynard wrote:
By the way, if anyone knows of fast (eg. fast enough to run a stream, possibly two, in realtime in a game), acceptable-quality, BSD-licensed or similar[1] implementations of an equalizer or resampler, I'd love to know of it. I don't know enough on the topic to write my own.
...
I've looked at lots of resampling code, but most fall over on 44.1<->48khz. FB2k's does it, but it's also too expensive (also about 8% on my machine). I need arbitrary rate changes, as the game has modes which play music at variable rates (but it doesn't need to be able to change resample rates smoothly).
Have you tried the resampling code in madplay? It supports arbitrary resampling ratios and is relatively fast. It uses a linear interpolation so it doesn't produce the best quality output, but for most uses it may be acceptable.
On Tue, Sep 23, 2003 at 04:34:28PM -0700, Rob Leslie wrote:
Have you tried the resampling code in madplay? It supports arbitrary resampling ratios and is relatively fast. It uses a linear interpolation so it doesn't produce the best quality output, but for most uses it may be acceptable.
I'm currently using a linear interp, but the output is too poor, especially when changing music rates, eg. 44.1khz * 90% -> 39.69khz.
Glenn Maynard wrote:
By the way, if anyone knows of fast (eg. fast enough to run a stream, possibly two, in realtime in a game), acceptable-quality, BSD-licensed or similar[1] implementations of an equalizer or resampler, I'd love to know of it. I don't know enough on the topic to write my own.
The only equalizer code I've looked at is the ones FB2k uses, but that takes about 8% CPU on my K7/1000 for a single stream, which is far too much.
I've looked at lots of resampling code, but most fall over on 44.1<->48khz. FB2k's does it, but it's also too expensive (also about 8% on my machine). I need arbitrary rate changes, as the game has modes which play music at variable rates (but it doesn't need to be able to change resample rates smoothly).
The best resampling library I know of is libsamplerate by Erik de Castro Lopo: http://www.mega-nerd.com/SRC/
It has 5 resamplers, including zero-order-hold, linear, and three quality levels of sinc interpolation. It's quite fast and sounds great.
Unfortunately it's GPL. This presented a problem for some projects I was working on, so I recently wrote a new resampling library, with the goal of coming close to the speed and quality of libsamplerate, but with a LGPL or BSD library. I ended up using the LGPL resample-1.7 code from CCRMA as a starting point, but rewrote the code to use a library interface and using modern C programming style and autoconf. My library is called "libresample" and is available here:
http://ccrma-www.stanford.edu/~jos/resample/Available_Software.html
I admit that libsamplerate is both faster and higher quality, so I hope it works for you. But if you need less restricted software, libresample is just as easy to use and should sound much better than just linear resampling.
Both libraries support changing the sample rate on the fly, so you can create nice warping effects, but libsamplerate is limited to a rate change of 1/12...12x. My resample library has no artificial limitations like that, but obviously the quality will degrade if the ratio is very large or very small.
BTW, I'm interested in Equalizers, too, so if you end up finding anything worthwhile, please let me know.
- Dominic