Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
university
music_proj
Commits
5b5fabfb
Commit
5b5fabfb
authored
Aug 08, 2019
by
Kamal Nasser
Browse files
z axis
parent
06815acc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
socket-server/server_udp.py
socket-server/server_udp.py
+5
-2
No files found.
socket-server/server_udp.py
View file @
5b5fabfb
...
...
@@ -81,7 +81,7 @@ def remap_value_of_axis_range(axis, destination_low, destination_high, value):
def
zero_range_params
(
p
):
if
inside_zero_rect
(
p
):
print
"inside"
#
print "inside"
return
[
0.0
,
0.0
,
0.0
]
return
p
...
...
@@ -110,6 +110,7 @@ udp_msg_to_send = None
xAxisLength
=
axis_length
(
"x"
)
zAxisMidpoint
=
axis_midpoint
(
"z"
)
+
axis_length
(
"z"
)
/
4
def
get_optirx_data
():
...
...
@@ -133,10 +134,12 @@ def get_optirx_data():
if
params1
!=
(
0
,
0
,
0
,
0
)
and
params2
!=
(
0
,
0
,
0
,
0
):
xDistance
=
params1
[
0
]
-
params2
[
0
]
berlinPos
=
params1
[
2
]
msg
=
[
json
.
dumps
({
'drumVolume'
:
remap_value_of_axis_range
(
"y"
,
0.0
,
1.0
,
params1
[
1
]),
'groupCVolume'
:
remap_value_of_axis_range
(
"y"
,
0.0
,
1.0
,
params2
[
1
]),
'tempo'
:
int
(
remap_and_clip
(
-
xAxisLength
,
xAxisLength
,
60
,
132
,
xDistance
))
'tempo'
:
int
(
remap_and_clip
(
-
xAxisLength
,
xAxisLength
,
60
,
132
,
xDistance
)),
'berlin'
:
0
if
berlinPos
<
zAxisMidpoint
else
int
(
remap_value_of_axis_range
(
"z"
,
0
,
50
,
params1
[
2
]))
})]
global
udp_msg_to_send
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment