blurhg... this reply's just gone over the top
I think there's a lot of confusion and mis-understanding about gain structure here. Some of what is being said is true, however that which is true is not applicable here or for - may I guess - at least 80% of the members of this forum. I think it is safe to assume that most people on this forum are using the typical studio-in-a-box solution of a standard computer audio interface that basically contains everything from the mic preamps and/or line/instrument inputs, through to the converters and the computer interfacing part. Most of them won't be patching into insert points, aux sending, or anything. Most of the people here are probably doing exactly what stupidfatandugly said he was doing - plugging straight into the interface and recording. I will come back to the studio-in-a-box thing later.
For now, I don't even know where to start replying to this without taking it back to an absolute beginers guide titled something like "OMG, WTF iS g@yN sTrUkShEr 'n' WTF dUs W33 n33d 2 w0rR33 @B0uT iT 4?! LOLZZZ!!!111!1!!!!11!!1!" Maybe I might just do that... here we go.
OMG, WTF iS g@yN sTrUkShEr 'n' WTF dUs W33 n33d 2 w0rR33 @B0uT iT 4?! LOLZZZ!!!111!1!!!!11!!1!
There are two key elements to understanding why we worry about gain structure. 1) Every piece of equipment has a finite amount of headroom available, and; 2) Every piece of equipment creates a certain amount of self noise.
1) Headroom
To understand what headroom is, first try and understand that every component in your signal chain has the potential to overload. That is to say that, if we feed it a signal that is of a greater level than what it can handle it will give up and chop off everything that is higher than the level it can handle. When this happens, we get distortion.
The next thing to understand is that every component has an intended operating level - a level at which it was designed to operate at. The reasons for, and the ways in which we measure, the intended operating level are varied, not the least of which is that it allows us to easily use several pieces of equipment in a convenient manner where we know that if we have a signal leaving the 'abc' box at such and such a level, we can then plug that into the 'xyz' box without too much trouble. We know that our +4dBU rated equipment is designed to receive and send levels at a nominal - for now, think average - level of 1.23V/+4dBU, which means we're not going to overload/starve the next component in our chain of +4dBU items by keeping the levels going in and out of our equipment in this range. The reasons we need standards like this is because of the vast differences between equipment needs/potential. Internally, a vacuum tube preamp can have signals in it running far above the overload point on a good console, and we may wish to plug this vacuum tube preamp into an AD converter. The converter alone will only need a signal that measures a fraction of what a signal coming straight from the anode of a vacuum tube could be. Because we're attempting to interface eqipment that can run signals into tens of volts with equipment that can only receive a fraction of this, the inputs and outputs of all our equipment are buffered in such a way that the signal leaving one piece of equipment will be suitable for the next piece of equipment that will be receiving it. The input and output buffers will take care of this (as well as impedance, but that's a whole other story).
Understanding that we have both a recommended and maximum level in each piece of equipment, it should now be easy to understand that headroom refers to how far above our operating level we can go without reaching the overload point. We need this headroom to account for transients/peaks, what the equipment is doing (say it's an eq where someone may potentially boost the voltage in a certain frequency range up to, say, 15dB), and any other imperfect variations such as a slightly hotter than ideal signal coming from the previous stage. Headroom is our friend in achieving clean audio.
2) Noise
Anyone who's ever turned on their home stereo at a reasonable level will probably have noticed that it creates a hissing noise that you can hear when there's quiet passages of music, or no music being played at all (or all the time if it's really bad). This is an example of self noise. What they'll also notice is that the self noise stays at a constant level no matter what the sound that is or isn't playing is doing. Apart from being distracting and annoying, this noise also has the potential to swallow up and smother the details of signals which fall too close to that of the noise being created by the equipment. Because the self noise of equipment is a constant, in order to reduce the ratio of noise that is combined with the signal, it makes sense to run the signal at a significantly higher level than the noise. To achieve that, we want the signal leaving one piece of equipment to be at such a level that we're not having to add gain to it (if possible) at the next stage to bring it up to a suitable level. The quieter the signal is, the closer it will be to the noise floor, so the more noise we will hear, and vice versa. When we add gain, we are turning up the signal. If that signal has picked up noise from anything previous in the signal chain, that noise will also be turned up. The ratio will not change once that noise is there.
So why are these two considerations so important to gain structure? Well, the very essence of good gain structure lies in running our signals at levels which still allow us headroom, whilst simultaneously getting as far above the self generated noise of our equipment as possible. Run your signals too hot and you'll run into distortion, run them too low and you'll introduce more noise than necessary.
Applying the concept of headroom and noise in the world of fixed point digital
Before we apply the concept of headroom and noise to the digital world, we must first understand the concept of dynamic range. Simply put, dynamic range refers to the difference between loud and quiet. In the studio, the greater the dynamic range of our signal chain is, the more we are able to cleanly capture sources that have varying dynamics.
In the analogue world, our dynamic range is limited by voltage and noise. The higher we can run our voltage, and the lower we can get our noise, the greater the dynamic range our equipment will have. Dynamic range is a good thing to have because it allows us to deal with something that has more dynamics and complexities than a square wave. By having more dynamic range, we can deal with signals that have greatly varying dynamics without introducing extraneous amounts of noise, or distorting it.
The way this changes in the world of fixed point digital is that we no longer have a recommended operating level defined by noise and headroom. We now deal with dynamic range defined by 'bits' - we essentially have a point where if a signal is too low it cannot be represented in the digital domain, and vice-versa. The dynamic range we have to deal with is the bit rate multiplied by 6. For 16 bit we have a dynamic range of 96dB, for 24 bit we have a theoretical dynamic range of 144dB. I say theoretical because whilst we have 144dB of dynamic range to play with once working in the 24bit digital domain, more often than not we are limited to a lesser dynamic range of the signal being captured by virtue of limitations imposed by the analogue front end and DACs.
So saying this, it would seem to make sense that good gain structure in the digital domain requires us to maximise dynamic range. Sure, the -18dBFS advice may keep you out of trouble insofar as you'll never run into distortion from overload, but why not work in 12 bit? This is essentially what you're doing following this advice because you've thrown away 18dB of dynamic range by doing so. (Well, 13 bit assuming you're recording at 16 bit). The problem with setting signals in the digital domain to such low levels is that generally people set levels at the assumed loudest dynamic, but during the actual performance they may go from very loud to very soft. Start playing too soft, and while you will still be capturing the performance, the low level wave forms that may be just as complex as the louder ones will only be represented by a few bits, essentially truncating some of the complexities and details and, god forbid, introducing distortion.
Now, this may be acceptable and inaudible to the regular listener 90% of the time, however we run into further problems if we take into account what happens when we compress a highly dynamic performance as is so commonly done now. Say we're recording to 16 bit, we've set our levels to -18dBFS and we have a performance where we have 54dB of dynamic range from the loudest section to the quietest details such as finger noise on a guitar and we compress it to bring the levels into line a bit more. What we're now doing is turning up details that have only been captured by 4 bits which are not only lacking detail or even becoming a little lost, but are probably sounding a little distorted. By the time your audio's been sent through the mastering engineers limiter, you're possibly looking at creating extra distortion that could have been avoided by utilising more of your dynamic range in the first place.
Applying all this to the typical studio-in-a-box
The typical recording solution that the majority of home recordists seem to use now is the 'computer audio interface' which contains everything they need except for the microphones and musicians. When I offered the 'below 0 peak' advice, I made quite an important disclaimer... "In your case..."
As stupidfatandugly has already said, "the piano is just straight from my keyboard into the interface." Now, I'm prepared to wager that a signal on the input side of one of these off the shelf solutions never even aproaches line level, except for when it's been inserted as a line input, in which case it's probably being attenuated immediately by a pair of resistors acting as a voltage divider. Why? A couple of reasons, going along the lines of typical manufacturer cost cutting, the fact that nearly all of them weren't designed and aren't able to be patched into and, common sense. It makes a lot of sense that the less complicated one of these are, the better.
Now, we're well past the days of fixed gain mic amps, and now it is standard to control gain using feedback... start with an amp that has a +'ve and -'ve input designed to give x amount of gain, and return the output signal into the -'ve input. The more feedback we return, the lower the gain. This feedback topology means we have a consistent s/n ratio that has already been defined by the microphone itself and the level of the source it's picking up, and the preamp design. No matter where we set our gain, our s/n ratio remains fairly constant as the out of phase feedback contains both the noise and the signal. This is how mic preamps have been made for quite a while now.
So, we have a preamp which will have a fairly constant s/n ratio regardless of gain, and we're going to feed this into an adc which, will probably overload if fed a typical line level signal... so why gain it up to line level in the first place to only attenuate it before it hits the ADC, even though we're not gaining anything insofar as we're not trying to drive compressors, eq's, or anything else that has a noise floor to contend with? Sure, we might start hitting on, or even a few dB's over, line level with a sin wave, but is this leading us to unwanted distortions??? Well, no. We're probably feeding an ADC that can't take much more than 2V on the input... say we're running a worst case scenario of 5V usb power with a questionable preamp, we're still going to have at least 6dB of headroom in the analogue circuitry.
The thing to remember with all this 'line level' brouhaha is that line level is merely a recommended operating level for the typical audio signal that still maintains a serviceable amount of headroom whilst still keeping us well above the noise floor. What happens if you go above line level??? Well, not much really, unless you peak above the overload point... then we hit distortion. Run a sin wave at +15dbU through a good console channel strip, and it will still come out a sin wave. Run a percussive guitar part through at +15dBU and it will be a different story... the thing to remember here is that the limiting factors are the overload point and the noise floor. Sure, if you go running too much above line level, you're going to give the power supply a run for it's money, but I wasn't really recommending running much above line level in the first place.
I'm going to finish up here, but I'd like to pose one question to those that keep hammering away about line level being so critical...
In a typical mix situation using an analogue console, how do I maintain line level through the console? If my inserts, eq, aux sends, groups, summing busses and what not are all meant to be driven at line level, how can I achieve this? The obvious answer is to not touch the eq or faders... apart from that I'm lost.
Peace and love and all that other tree hugging stuff.