forked from robaru/sofamyroom
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.py
More file actions
73 lines (58 loc) · 2.07 KB
/
test.py
File metadata and controls
73 lines (58 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# from pyroomsim import py_mul_struct
# print(py_mul_struct(1, 4.2))
# from pyroomsim import make_sources
#
# hey = dict(first=1, second=2.0)
# hey2 = dict(first=12, second=22.0)
#
# s = make_sources(hey, hey2)
# print(s[0])
# WORKS
# from roomsim import make_options
# from api import Options
# options = Options()
# # For options, we'll need the get config, starts to be too much.
# hey = make_options(options.get_config())
# print(hey)
# from roomsim import make_surface
# from api import Surface
#
# surf = Surface()
# make_surface(surf.get_config())
# print(surf.get_config())
# WORKS
# from roomsim import make_room
# from api import Room
#
# room = Room()
# make_room(room.get_config())
# # Worked
# from api import RoomSetup, Sources, Receivers
# from roomsim import make_sensors
# # sources = Sources(location=(8, 2.5, 1.6), orientation=(180, 0, 0), description="subcardiod")
# sources = [
# Sources(location=(8, 2.5, 1.6), orientation=(180, 0, 0), description="subcardiod"),
# Sources(location=(2, 3.3, 2.6), orientation=(0, 180, 0), description="subcardiod"),
# ]
#
# make_sensors([sources[0].get_config(), sources[1].get_config()])
from pysofamyroom.internal import make_roomsetup, generate
from pysofamyroom.api import RoomSetup, Sources, Receivers
sources = [
Sources(location=(8, 2.5, 1.6), orientation=(180, 0, 0), description="subcardioid"),
Sources(location=(2, 3.3, 2.6), orientation=(0, 180, 0), description="subcardioid"),
]
# sources = Sources(location=(8, 2.5, 1.6), orientation=(180, 0, 0), description="subcardiod"),
receivers = Receivers(location=(5, 3, 0), orientation=(0, 0, 0), description="subcardioid")
setup = RoomSetup(sources=sources, receivers=receivers)
make_roomsetup(setup.get_config())
generate(setup.get_config())
# hey = setup.get_config()
# ok = RoomSetup.from_config(hey)
# import yaml
# yaml.safe_dump(hey, open("conf2.yml", "w"), default_flow_style=None)
# setup.to_yaml("conf.yml")
# import ipdb; ipdb.set_trace()
# new = RoomSetup.from_yaml("conf.yml")
# setup = RoomSetup.from_txt("sampleroomsetup.txt")
# print(setup.options.get_config())