A musical sound generation device, comprising: a performance operation element for receiving a user operation for musical performance; a first memory storing a plurality of pieces of waveform data; a second memory having an access speed faster than the first memory for temporarily storing data transferred from the first memory; a processor that transfers data stored in the first memory to the second memory; and a sound source circuit including a waveform reader that can read data only from the second memory for generating digital musical sounds, wherein in response to an operation of the performance operation element designating a specific piece of waveform data, the processor determines whether the designated specific piece of waveform data is already in the second memory, and if not, attempts to allocate a non-ring buffer region or a ring buffer region in the second memory, the non-ring buffer region being configured to store an entirety of the designated specific piece of waveform data to be read by the waveform reader in response to the operation of the performance operation element, the ring buffer region being configured to store the designated specific piece of waveform data as a ring buffer so as to be updated by data from the first memory and read by the waveform reader in a ring-buffer manner in response to the operation of the performance operation element, characterised in that, in attempting to allocate the non-ring buffer region or the ring buffer region, the processor first determines whether the non-ring buffer region having sufficient space to receive the designated specific piece of waveform data can be allocated in the second memory, and if so, transfers the designated specific piece of waveform data from the first memory to the non-ring buffer region of the second memory, and wherein, if the non-ring buffer region having sufficient space to receive the designated specific piece of waveform data cannot be allocated in the second memory, the processor attempts to allocate the ring buffer region in the second memory, and if allocated, transfers the designated specific piece of waveform data from the first memory to the ring buffer region of the second memory in the ring-buffer manner so as to be accessible by the waveform reader as the ring buffer. a performance operation element for receiving a user operation for musical performance; a first memory storing a plurality of pieces of waveform data; a second memory having an access speed faster than the first memory for temporarily storing data transferred from the first memory; a processor that transfers data stored in the first memory to the second memory; and a sound source circuit including a waveform reader that can read data only from the second memory for generating digital musical sounds, wherein in response to an operation of the performance operation element designating a specific piece of waveform data, the processor determines whether the designated specific piece of waveform data is already in the second memory, and if not, attempts to allocate a non-ring buffer region or a ring buffer region in the second memory, the non-ring buffer region being configured to store an entirety of the designated specific piece of waveform data to be read by the waveform reader in response to the operation of the performance operation element, the ring buffer region being configured to store the designated specific piece of waveform data as a ring buffer so as to be updated by data from the first memory and read by the waveform reader in a ring-buffer manner in response to the operation of the performance operation element, characterised in that, in attempting to allocate the non-ring buffer region or the ring buffer region, the processor first determines whether the non-ring buffer region having sufficient space to receive the designated specific piece of waveform data can be allocated in the second memory, and if so, transfers the designated specific piece of waveform data from the first memory to the non-ring buffer region of the second memory, and wherein, if the non-ring buffer region having sufficient space to receive the designated specific piece of waveform data cannot be allocated in the second memory, the processor attempts to allocate the ring buffer region in the second memory, and if allocated, transfers the designated specific piece of waveform data from the first memory to the ring buffer region of the second memory in the ring-buffer manner so as to be accessible by the waveform reader as the ring buffer.