Logic Pro X
Sampling

Make sure you have to hand an appropriate sound for sampling
New track - type software instrument
In the channel strip, click and hold on the blue button in the middle
From the pop-up menu, choose EXS24 (Sampler), and then 'mono' in the pop-up.
The EXS Sampler window should appear
In the upper right hand portion of the window click the tiny button called 'edit'
This opens the instrument editor
Here you make an 'instrument' from one or more samples
From the Media browser choose your sample and drag it into the main window of the instrument editor
By default the sound should be placed across the entire range of the instrument
You can now 'play' the instrument with the keyboard

Save the instrument
Instrument/Save as...
You can then choose the instrument from the main Panel

Control Panel
Edit as desired

Add more samples
Drag into the instrument editor
Choose the appropriate ranges on the keyboard via the 'key range' columns

Edit playback, sample and loop columns
Show these columns via the 'View' submenu