What you are describing is the process of companding as in
COM-pressing and EX-panding. It is certainly possible and is done in
lots of applications such as Dol bey sound systems of various types and
in communications systems. It is a neat way of faking out the ear in
to thinking there is less noise on the system than there really is,
assuming one doesn't have too much noise.
In order to properly expand the sound, however, one has to
know the characteristics of the level compressor such as the attack
and release times. What you are doing is a mirror image of what the
compressor did.
If you know that information, then you should be able to
restore dynamic range to the original recording.
Sometimes, this technique backfires and you can get some
effects that are worse than nothing at all. If the input level to the
expander is wrong, it will not track the compression and may cause a
booming effect to speech or music that wasn't originally there.
If there is a lot of noise on the channel that wasn't on the
input signal, the noise will appear to puff or pump along with the
audio.
If one gets the level compression ratio and or the attack and
release times wrong, there is a whole boatload of weird effects that
can happen. Your mileage will definitely vary.
Martin McCormick WB5AGZ Stillwater, OK
OSU Information Technology Division Network Operations Group
Andrew Gaydenko writes:
>Few days ago there was discussion in the list about mastering-CD/compressing/
>limiting/gain-upping and so on. I have strange feeling from the discussion.
Mark Knecht writes:
>I believe that all of these still exist, but you may just have out of
>date versions. There are a number of packages to Alsa now:
>
>alsa-drivers
>alsa-oss
>alsa-lib
>alsa-tools (you probably need this)
Got them. All x-based.
>alsa-utils (you probably need this too)
Got them and not totally sure what they do yet.:-)
>alsa-jack
>alsa-firmware
>
>Good luck,
Thank you. The hardware is working, I think. I now have
audio that is fed in to the line in jack being passed through to the
output. I found an ancient program called setmixer going back to 1994
in the Debian treasure trove of packages that one can download.
Interestingly enough, that ancient program along with aumix both do
one and only one thing to the sound card. By telling either mixer to
adjust the line volume, the pass-through or monitor level adjusts
perfectly in that setting line to 100 is quite loud while setting it
close to 0 is almost all the way down.
Both aumix and setmixer return sensable values for all the
other controls such as mic and PCM levels, but no other control has
any effect at all. If I cat /dev/dsp in to a file, I see the familiar
pattern of silence which is mostly 0x80 with the occasional 0x7f.
I did download a new version of alsaplayer and it probably
will work if I ever get audio out of the card. .wav files seem to
silently play for the right amount of time.
On the alsa site, I found several mixers and every darn one of
them requires a GUI. Unless there is one of them that will work from
the command line as well as from X, I haven't found anything that
I can use.
The other possibility is to find some documentation describing
the ioctl interface to /dev/mixer and start banging out a C program
that talks to the correct registers, sort of a modern version of
setmixer that works.
As one who has experimented with assembly language on several
processors, this has all the earmarks of a mapping problem. There is
probably a bit in some register that needs to be on or off, but the
old mixer control program is talking to the wrong register or the bit
is not even something this program knows about and it doesn't get set.
For now, it's back to 2.4.19 if I want to hear any digital
audio.
I really do appreciate all the help so far. This is nobody's
fault or anything like that. It is a case of rather complex
technology that is trying to work over a very wide range of hardware.
It's a miracle it works at all when you think of what all is
happening. On this computer, there is still one burned out bulb in
the string so to speak.
Martin
My thanks to a list member who wrote me off the list and told
me about the aabuild and aadebug scripts on the alsa site. I ran the
aadebug script and found that the biggest problem seems to be that
ALSA couldn't find my sound card after plug and play registered it.
Putting in the sound card driver as a built-in to the kernel
rather than a module seems to have cured that problem and I may
actually have it working.
Now, for the next part: Since ALSA is part of the kernel, I
need some command-line tools to take the place of aplayer and amixer
which were in the old distribution. As a computer user who is blind,
I do not use X windows because there isn't a truly working interface
to X that makes it talk to us yet. It is in the works, but it has
been there for about a decade although it really is getting a lot
closer.
I presently have aumix on the system and it did adjust some of
the controls on the sound card under the 2.4.19 kernel and the OSS
modules, but I gather that it doesn't talk to /dev/mixer, etc.
The old ALSA utilities I had on here had Amixer and aplayer
and dated back to December of 2001. They don't even try to work with
the present setup.
So, my question for now is, are there any command-line-based
applications that replace aplayer, amixer and something I saw called
alsamixer?
This is all a bit confusing since there is a lot of software
that is based on the old ALSA which doesn't seem to do anything at all
in the new setup.
Thanks to all.
Martin McCormick
Could someone advise me on what software
to use to isolate the bass line in a .wav file?
I'm running Linux Red Hat 9.0 but I have a
friend with an XP machine, so anything that
works on either would be OK.
That is, if it's not too expensive.
Hi
Is there any posibility to get this card working with 2.6 kernel?
If not, is there some resource on the net to get it working under
2.4.xx with jack and pd, because as far i was not able to get it
running without a lot of noisy clicks.
any ideas?
thanks
marc
tim hall writes:
>Now you need to configure it
>I have it in /etc/alsa/modultils/
>then do 'update-modules'.
I am still not there yet, but I keep finding new reasons why.
update-modules does nothing but exercise my fingers and return a new
shell prompt without so much as a single squawk about anything.
Unfortunately, there is no alsa directory in /lib/modules/2.6.5
although one can sure see all the modules in their proper directory.
The whole problem stems from the fact that the
module-management environment was and still probably is broken. I
installed Debian Linux in January of 2002 and things were different
then. Last night, I discovered that depmod which gets its replacement
if you install module-init-tools, was a symlink to the old depmod from
then. Also, modprobe is another symlink between /sbin/modprobe and
something called insmod which documentation says is for inserting
modules in to a running kernel. Two years ago, you just inserted
modules but never removed them. The code to remove them was there,
but experimental.
I took the liberty of re-doing both those links so they point
to the new versions of depmod and modprobe.
I then built a new 2.6.5 kernel, made the modules and
installed them. There was no complaining from the process at all. I
then did another update-modules and, as is the hallmark of this quest,
absolutely nothing new happened.
References to /dev/[anything audio] produce "no such device"
errors.
Another blast from the past that has been haunting me all this
time was that I had unsuccessfully tried to get alsa going in 2002
when it was a separate application. It was something like
/etc/init.d/alsa and was started and stopped at boot and shutdown by a
script in /etc/rc2.d and another in /etc/rc1.d called S20alsa. Those
were still trying to work. They are gone now.
At this time, that is where I stand. I did try another
MAKEDEV.snd script run from the scripts directory in the 2.6.5 source,
but that just repeated the same futile action as before. The audio
devices all exist, but return "no such device" errors when used.
I think it is really funny that usually, it is the hardware
end of the setup that is problematic, but log messages show PNP
finding the right card and the correct driver being registered.
The only thing I see on boot that even looks pathological is a
depmod message complaining about something called AF_PACKET not being
found. I don't think that relates to sound, so one thing at a time
for now.:-)
What else could it be? I've sure learned a lot about how
modules do or don't get installed, but I bet there is something really
stupid behind this whole standoff. I'd say someone stupid, but that's
getting close to home.
In my straw-grasping mode, I wonder if I should rebuild
module-init-tools after discovering the depmod and modprobe links
weren't right, but somehow, that doesn't sound really necessary.
Any more ideas besides starting from scratch? Many thanks.
Martin McCormick
Hi all,
I think this is one of the questions which rises on a regular base here but I
couldn't find something that maches my requirements so far so I ask as well
:-) (is there a FAQ for this list somewhere?)
I am finaly rebuilding my studio based on Linux-only apps so I need some
compatible hardware as well for my Synths. I still have quite a lot of MIDI
devices so I am looking for HW with as many MIDI I/O's as possible. Actually
I don't care how I have to connect them to my PC but I would prefer an USB
device or a PCI card.
What options do I have?
Thanks
Adrian
"Hi,
Maybe some folks on this list have insites into the
following conversation between Steve and myself. I
need all the help I can get. The last three paragraphs
are a topic for which I am woefully ignorant."
Hiya. I do the occasional master for releases, and "make it louder" is an all too common request. Whether it suits the track, the place in the album or the recording does not matter, they just want it LOUD. It's sad, but he who pays the piper....
Yes, you have to mash the audio (as you have found), and it kills me to hear carefully recorded tracks being brutally handled, so the idea is to do it as kindly as possible. :)
Here's some rambling about how I go about it.
First, where is all the energy in the track? What is taking up all your headroom?
Subsonics can really take up headroom, so going back to the mix and high passing any tracks that don't need bass end can give you more space to work with. Starting at 20hz on most tracks and work up from there.
Then, put a fast limiter across your main outputs, set it so it's fairly hammering the track, and listen for the moments when it really ducks.
Look what's going on in the track at those points and automate/eq those parts. Much of getting a 'loud' track is in the mixing.
Pretty much any limiter will work here. You *want* it to be offensive. :)
My chain for mastering is normally - EQ/Exciter -> Comp -> Multiband Comp-> Limiter -> Dither.
The first eq gets the general shape. Don't move on till you are happy. Try a steep highpass at 10hz or whatever here too. Creep it up till you can hear it then back off.
Getting this right really depends on your monitoring. If your monitors can't do anything below 40hz and you are mastering electronic/dance be careful as there can be a lot going on down there. Listening from outside the control room with the door open seems to help here. I have no idea why.
The next compressor is optional. If the tracks fairly dynamic I'll use one. It will subtle though. It's a good way to make the multiband more predictable when going for volume too.
Perversely, setting a very low threshold works here. You'd think that would mash the track, as the compressor is working nearly all the time, but as the ratio is so low (1.2:1 or whatever) combined with a long release (1 sec or greater) it just smooths out the dynamics before it hits the multiband. Soft knee is essential here. You should not hear this 'working' at all ideally. An opto comp hear will let some peaks through but still bring up the general ambience in a pleasent way.
You *want* to be using a multiband comp for volume.
Try finding the range where the vocals are and fitting your middle multibands around that. You need to be able to solo bands to do this ideally. This means that the bass end interfere won't with the vocals, so they don't duck when there is heavy kick or bass. If the vocals remain up front you are half way there. If you have more bands, try finding the space between the kick and bass. Don't go too heavy on the top end bands, they should still have punch.
As a rule of thumb, I play the track through the multiband, and play with the thresholds so each band is doing no more than 3-4db reduction at their respective loudest points, perhaps less on the upper bands.
Then, play with the input level to the multiband to see what you can get away with.
You can get away with more compression in the low end than the high end, and the more you control that low end the less the limiter has to try and control your kick/bass etc.
Also, using very fast attack/release in the upper bands can work well, but don't kill the snare. Try soloing the low band and reducing the attack release until you begin to hear distortion, then back off a long way.
Now the final limiter.
Ideally, the multiband is doing most of the work and the final limiter is not working hard. If you try and get all your level control out of that limiter it's going to be working too hard and everything will mash up. I can not get the same amount of clean limiting out of any apps on Linux as I can out of a Finalizer or Waves L2. That's just Life. :) If you are doing anything more than 6db reduction here, something is wrong earlier in the chain.
Overloads on your final master.
Take care. If there are too many flattened peaks you can end up with a CD that sounds OK on your player, but starts getting unpleasent on older/crappier ones. I have had this happen, even with stuff that is not actually digitally clipped, just heavily limited. You should not need to do hard digital clipping at all, ever. You will end up with high frequency hash that will make radio station's limiters do odd things and some CD players cry. If you are not getting the volume you need in other ways, buy or rent a finalizer and stick it through that. It's got automatic wizards to get you most of the way there. It's what everyone else does.
If you do want to drive it a bit, try mastering to a decent 2-track tape and pushing that. Depending on the machine it'll get rid of peaks wonderfully.
Just mastering on to tape at a normal level and re-recording+normalising the result can get you a few extra dbs without any obvious change to the sound.
A little clipping on an analog desk is not a problem. If it sounds good, go with it. :)
Just remember to keep an un-mashed master for when the current passion for square-waved CDs dies away. Your clients will thank you for it someday.
But really, a Finalizer does this kind of thing really well. They don't sound great but they do the job for volume.
Martin McCormick WB5AGZ Stillwater, OK
OSU Information Technology Division Network Operations Group
Subject: Re: [linux-audio-user] Fwd: [Jamin] Re: soft clip: Achieving Gain, inconsequential overloads
--------
Steve Harris writes:
>Actually thats not quite right - AD converters generally work in 1's or
>2's complement, depending on the brand/variety, so the middle point is at
>0, and the range is slightly larger in the -ve voltage range.
Correct. We may be talking about the difference between
signed and unsigned number representation. If you have an unsigned
value, the only possibilities are from 0 to the maximum value
represented by all ones. There are no negative numbers. When you
have a signed value, then an 8-bit number, for example can be
represented by +1 to +127 or -1 to -128.
Now, here is something I am a bit unsure of, myself. I know,
from actual observations that a straight PCM output from your basic
A/D converter if read as unsigned numbers moves in steps from 0 to all
1's on. I honestly have not tried to interpret those data as signed
numbers because it wasn't convenient at the time. If one wants to
have a valid representation of what the wave form is doing for
graphical or calculation purposes, then the mid-point would have to be
what one would call 0 level with -1 being one below and 1 being 1
above, etc. I am certainly not arguing with anyone, but am a wee bit
confused as to the correct way to represent the numbers.
This is probably off-topic, but any graphical software that shows
you your music wave forms or does DSP functions in an arithmetic
manner that is based upon an AC model has to behave as if the
mid-point value was 0.
Maybe someone can set me/us all straight in this manner.
G
tim hall writes:
>It sounds like you've installed ALSA ok.
>Now you need to configure it
>I have it in /etc/alsa/modultils/
>then do 'update-modules'.
I am logging in to the system in question from my work place,
but I see that the path described in /etc/modutils/alsa points to a
directory that doesn't yet exist. Somehow, I missed the
update-modules step.
It is elegant how that actually works since by using the uname
command, one's module path changes when the kernel does so you
automatically get the correct set of modules attached to your kernel
no matter what it is.
anyway, I can try it all out when I go home tonight. I bet
you have solved the puzzle. A thousand thanks.
Martin McCormick WB5AGZ Stillwater, OK
OSU Information Technology Division Network Operations Group