Squash and repeat time

density  d (density)

Runs the block d times with the bpm for the block also multiplied by d. Great for repeating sections a number of times faster yet keeping within a fixed time.

Introduced in v2.3

Examples

# Example 1

use_bpm 60  

density 2 do      
                  
  sample :bd_hause
  sleep 0.5       
end


# Set the BPM to 60
 
# BPM for block is now 120
# block is called 2.times
# sample is played twice
# sleep is 0.25s
 



# Example 2

density 2 do |idx|
  puts idx        
  sleep 0.5       
end


# You may also pass a param to the block similar to n.times
# prints out 0, 1
# sleep is 0.25s