Skip to content

Commit

Permalink
allow different ports and addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Oct 8, 2024
1 parent 804bd2f commit 82a56a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion hudes/hudes_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
class HudesClient:
def __init__(
self,
addr,
port,
step_size_resolution=-0.05,
inital_step_size_idx=10,
seed=0,
Expand All @@ -30,7 +32,7 @@ def __init__(
self.quit_count = 0
self.seed = seed

self.hudes_websocket_client = HudesWebsocketClient("ws://localhost:8765")
self.hudes_websocket_client = HudesWebsocketClient(f"ws://{addr}:{port}")

self.request_idx = 0

Expand Down
8 changes: 6 additions & 2 deletions hudes/hudes_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ def main():
parser.add_argument("--seed", type=int, default=0)
parser.add_argument("--grid-size", type=int, default=41)
parser.add_argument("--grids", type=int, default=2)
parser.add_argument("--addr", type=str, default="localhost")
parser.add_argument("--port", type=int, default=8765)

args = parser.parse_args()

if args.input == "keyboard":
controller = KeyboardClient(seed=args.seed)
controller = KeyboardClient(addr=args.addr, port=args.port, seed=args.seed)
view = View()
elif args.input == "keyboardGL":
controller = KeyboardClientGL(
addr=args.addr,
port=args.port,
seed=args.seed,
step_size_resolution=-0.005,
inital_step_size_idx=100,
Expand All @@ -34,7 +38,7 @@ def main():
# controller = AkaiClient(seed=args.seed)
# view = View()
elif args.input == "xtouch":
controller = XTouchClient(seed=args.seed)
controller = XTouchClient(addr=args.addr, port=args.port, seed=args.seed)
view = View(use_midi=True)
else:
raise ValueError
Expand Down

0 comments on commit 82a56a8

Please sign in to comment.