Free a sample on the synth server

sample_free  path (string)

Frees the memory and resources consumed by loading the sample on the server. Subsequent calls to sample and friends will re-load the sample on the server. You may pass multiple samples to free at once.

Introduced in v2.9

Examples

# Example 1

sample :loop_amen
sleep 2
sample :loop_amen
sleep 2
sample_free :loop_amen
sample :loop_amen



# The Amen break is now loaded into memory and played
 
# The Amen break is not loaded but played from memory
 
# The Amen break is freed from memory
# the Amen break is re-loaded and played



# Example 2

puts sample_info(:loop_amen).to_i
puts sample_info(:loop_amen).to_i
                                 
sample_free :loop_amen
puts sample_info(:loop_amen).to_i



# This returns the buffer id of the sample i.e. 1
# The buffer id remains constant whilst the sample
# is loaded in memory
 
# The Amen break is re-loaded and gets a *new* id.



# Example 3

sample :loop_amen
sample :ambi_lunar_land
sleep 2
sample_free :loop_amen, :ambi_lunar_land
sample :loop_amen                       
sample :ambi_lunar_land                 



 
 
 
 
# re-loads and plays amen
# re-loads and plays lunar land