Skip to content

Commit

Permalink
Core - improve density's error message when not given pos numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Apr 12, 2016
1 parent 540ce77 commit 3e55eec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/server/sonicpi/lib/sonicpi/lang/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,7 @@ def use_bpm_mul(mul, &block)

def density(d, &block)
raise "density must be called with a do/end block." unless block
raise "density must be a positive number" unless d.is_a?(Numeric) && d >= 0
raise "density must be a positive number. Got: #{d.inspect}." unless d.is_a?(Numeric) && d >= 0
reps = d < 1 ? 1.0 : d
with_bpm_mul d do
if block.arity == 0
Expand Down

0 comments on commit 3e55eec

Please sign in to comment.