Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -8,13 +8,13 @@ from scipy.fft import fft, fftfreq | ... | @@ -8,13 +8,13 @@ from scipy.fft import fft, fftfreq |
8 | import math | 8 | import math |
9 | import time | 9 | import time |
10 | 10 | ||
11 | -TARGET = "frequency" # frequency, amplitude, decibel | 11 | +TARGET = "decibel" # frequency, decibel |
12 | -EFFECT = "pitch_shift" # echo, pitch_shift, low_filter | 12 | +EFFECT = "pitch_shift" # pitch_shift, low_filter |
13 | 13 | ||
14 | RATE = 44100 | 14 | RATE = 44100 |
15 | CHUNK = 1024 | 15 | CHUNK = 1024 |
16 | MAX_FREQ = 40 # max freq for pitch shifting | 16 | MAX_FREQ = 40 # max freq for pitch shifting |
17 | -MAX_AMPLITUDE = 10000 # max amplitude for pitch shifting | 17 | +MAX_AMPLITUDE = 1440735 # max amplitude for pitch shifting |
18 | MAX_DECIBEL = 150 # max decibel for decibel shifting | 18 | MAX_DECIBEL = 150 # max decibel for decibel shifting |
19 | MIN_DECIBEL = 50 | 19 | MIN_DECIBEL = 50 |
20 | EFFECT_LEVEL = 20 # number of effect level | 20 | EFFECT_LEVEL = 20 # number of effect level |
... | @@ -142,7 +142,7 @@ class Effector: | ... | @@ -142,7 +142,7 @@ class Effector: |
142 | elif self.target == "amplitude": | 142 | elif self.target == "amplitude": |
143 | param = min(MAX_AMPLITUDE-1, amplitude) / MAX_AMPLITUDE | 143 | param = min(MAX_AMPLITUDE-1, amplitude) / MAX_AMPLITUDE |
144 | elif self.target == "decibel": | 144 | elif self.target == "decibel": |
145 | - param = min(MAX_DECIBEL-MIN_DECIBEL, db-MIN_DECIBEL) / MAX_DECIBEL-MIN_DECIBEL | 145 | + param = min(MAX_DECIBEL-MIN_DECIBEL, db-MIN_DECIBEL) / (MAX_DECIBEL-MIN_DECIBEL) |
146 | 146 | ||
147 | param = max(param, 0) | 147 | param = max(param, 0) |
148 | return param | 148 | return param | ... | ... |
-
Please register or login to post a comment