Toggle navigation
Toggle navigation
This project
Loading...
Sign in
노현욱
/
AR_instrument
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
노현욱
2023-06-12 00:14:34 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28d3223d5e7b0f6cb6db7f9d8e14f5277f65afa8
28d3223d
1 parent
b00b261d
feat : deleting none important target, effect
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
low_latency.py
low_latency.py
View file @
28d3223
...
...
@@ -8,13 +8,13 @@ from scipy.fft import fft, fftfreq
import
math
import
time
TARGET
=
"
frequency"
# frequency, amplitude
, decibel
EFFECT
=
"pitch_shift"
#
echo,
pitch_shift, low_filter
TARGET
=
"
decibel"
# frequency
, decibel
EFFECT
=
"pitch_shift"
# pitch_shift, low_filter
RATE
=
44100
CHUNK
=
1024
MAX_FREQ
=
40
# max freq for pitch shifting
MAX_AMPLITUDE
=
1
0000
# max amplitude for pitch shifting
MAX_AMPLITUDE
=
1
440735
# max amplitude for pitch shifting
MAX_DECIBEL
=
150
# max decibel for decibel shifting
MIN_DECIBEL
=
50
EFFECT_LEVEL
=
20
# number of effect level
...
...
@@ -142,7 +142,7 @@ class Effector:
elif
self
.
target
==
"amplitude"
:
param
=
min
(
MAX_AMPLITUDE
-
1
,
amplitude
)
/
MAX_AMPLITUDE
elif
self
.
target
==
"decibel"
:
param
=
min
(
MAX_DECIBEL
-
MIN_DECIBEL
,
db
-
MIN_DECIBEL
)
/
MAX_DECIBEL
-
MIN_DECIBEL
param
=
min
(
MAX_DECIBEL
-
MIN_DECIBEL
,
db
-
MIN_DECIBEL
)
/
(
MAX_DECIBEL
-
MIN_DECIBEL
)
param
=
max
(
param
,
0
)
return
param
...
...
Please
register
or
login
to post a comment