Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
larme committed Sep 5, 2020
1 parent cdba7f1 commit 0628fa5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fakebox/dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from fakebox.conf import DEFAULT_SAMPLE_RATE, DEFAULT_BIT_N

DSPFloat = np.float64
DSPEpislon = DSPFloat(1e-8)
DSPZero = DSPFloat(0.0)
DSPOne = DSPFloat(1.0)
DSPOne_L = DSPFloat(1.0 - 1e-8)
DSPOne_L = DSPFloat(1.0) - DSPEpislon

class DSPContext(object):

Expand Down
4 changes: 2 additions & 2 deletions fakebox/stdlib/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fakebox.dsp import DSPObj, DSPZero
from fakebox.dsp import DSPObj, DSPZero, DSPEpislon

class LineSegs(DSPObj):

Expand Down Expand Up @@ -34,7 +34,7 @@ def _tick(self, ins):
time_points.append(time_points[-1] + dur)


if running_time > time_points[-1]:
if running_time > time_points[-1] - DSPEpislon:
self.running = False
return DSPZero

Expand Down
6 changes: 3 additions & 3 deletions fakebox/stdlib/math.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from fakebox.dsp import DSPObj, DSPZero, DSPOne

def Sum(DSPObj):
class Sum(DSPObj):

def __init__(self, c=None, in_n=None):

Expand All @@ -22,7 +22,7 @@ def _tick(self, ins):
return res


def Mul(DSPObj):
class Mul(DSPObj):

def __init__(self, c=None, in_n=None):

Expand All @@ -43,7 +43,7 @@ def _tick(self, ins):
return res


def Neg(DSPObj):
class Neg(DSPObj):

def __init__(self):

Expand Down

0 comments on commit 0628fa5

Please sign in to comment.