How to record an instrument - freepats/documentation GitHub Wiki
In order to make a sound bank, you will need to record notes from a real instrument. First choose the instrument that you want to record. It should be an acoustic instrument or an analog electric one, but never a digital sample-based synthesizer because you will be recording from a recording.
How many samples are needed?
The individual recordings are usually called "samples" of an instrument.
You will need different notes of the instrument, from the lowest to the highest pitch than the instrument can produce. It is not necessary to record each individual semitone from all octaves of the chromatic scale, usually 3 notes per octave (C,E,G#) is good enough. Any missing semitones can be created by the sythesizer by varying speed (and thus pitch) of the closest note.
The correct number of samples will depend on the instrument. If there are too little samples, the synthesizer will have to strech them too much and they will start to sound like if they were slow motion, which is an indication that more samples are needed.
Some instruments will sound good with only 2 samples per octave, but others will require all of its individual notes (it may happen when the instrument produce fixed harmonics or frequencies which are not proportional to the base note).
High quality sound banks
If you are building a high quality sound bank, and have enough free time to spend, you can always record each individual note (possibly several times). Sound banks with different sizes can be created later with the same sample set.
Some instruments (grand piano, guitars...) will sound more natural if they have each note sampled individually. Sometimes the same note can be recorded and included several times, so the synthesizer can choose a random sample each time the same note is played. This is more important for percussion instruments to avoid the "machine gun" effect, our ears will detect repetitions very easily and they will appear artificial.
Velocity layers
The synthesizer will usually simulate a strong or soft performance by changing the amplitude (volume) of the samples played. The intensity on which a note is played is called "velocity" in the General MIDI standard. Real instruments however may sound different when played strong or soft, it is not only a variation of their loudness. Typically percussive instruments will produce much richer harmonic content when they are attacked strong.
If you want to build a high quality sound bank, the instrument can be recorded several times for different intensities (or velocities). The set of samples with similar velocity are usually refered as a "velocity layer".
You may want to record two velocity layers (medium and strong), or maybe more, it all depends on you and how much time do you want to dedicate. Sampling an instrument with full detail can be a laborious project, but it can be a fun and rewarding too.
Sample duration and loops
Some instruments will have a natural decay of the sound, think for example a piano. These are usually the easier to create, just record the whole note duration until it is completely silent. Large sound banks can include full note decays, and smaller sound banks could use trimmed down samples.
Other instruments don't have a natural decay, think for example an organ, wind or bowed string instruments. They usually require loops that can be created later with software. During the recording process you only needed worry about recording a few seconds of each sample, processing will be done at a later time.