A sample-based synthesizer's ability to reproduce the nuances of natural instruments is determined primarily by its library of sampled sounds. In the earlier days of sample-based synthesis, computer memory was expensive and samples had to be as short and as few as possible. This was achieved by looping a part of the sample (often a single wave), and then using a volume envelope curve to make the sound fade away. An amplifying stage would translate key velocity into gain so that harder playing would translate into louder playback. In some cases key velocity also modulates the attack time of the instrument, leading to a faster attack for loud passages.