An electronic percussion instrument samples an input waveform. An unused
waveform number may be automatically assigned to the sampled waveform
upon sampling or when a user-specified waveform number is already in use
for another waveform. Musical time parameters for the input waveform may
be specified in advance of sampling, and an endpoint for the sampled
waveform may be automatically set in response to a stop sampling command
so that length of the waveform is a whole number of musical time units
such as bars or beats. The endpoint of the sampled waveform may be set to
the beginning or the end of the musical time unit during which the stop
command is received, depending on the time at which the stop command is
received. The sampled waveform may be edited by manually moving the
starting point by a specified amount and automatically moving the end
point by a corresponding amount, by changing the specified tempo of the
waveform, or by specifying a different number of musical time units.