Permalink
Browse files

Make FreeComp work again with Mirah (which defaults to float now). Th…

…ere are most likely still places with doubles, will check later.
  • Loading branch information...
1 parent d524b4a commit 788a866e389c331d39f4e1ff383691d3a1dd1b2b @thbar thbar committed Apr 27, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 plugins/DubyFreeComp/DubyFreeCompTools.mirah
@@ -16,13 +16,13 @@ class DubyFreeCompTools
def sample(spl0:float)
det = Math.abs(spl0) # instead of [spl0.abs, spl1.abs].max
- det += 10e-30
+ det += float(Math.pow(10,-29)) # cannot use 10e-30 currently
- @env = det >= @env ? det : det+@env_rel*(@env-det)
+ @env = det >= @env ? det : float(det+@env_rel*(@env-det))
gain = @env > @thresh ? Math.pow(@env,@transA)*@transB : @output_gain
@final_gain = float(gain < @final_gain ? gain+@att_coef*(@final_gain-gain) : gain+@rel_coef*(@final_gain-gain))
- spl0 *= @final_gain
+ spl0 *= float(@final_gain)
#spl1 *= final_gain
#[spl0, spl1]
spl0

0 comments on commit 788a866

Please sign in to comment.