test1() -> run_code("use_synth :fm\nplay 50\n"). run_code(Prog) -> %% Prog is a io-list P1 = lists:flatten(Prog), M = ["/run-code" , "erl-id", P1], E = osc:encode(M), {ok, Socket} = gen_udp:open(0,[binary]), ok = gen_udp:send(Socket, "localhost", 4557, E), gen_udp:close(Socket).
play(N) -> run_code(["/playNote", N]). run_code(M) -> E = osc:encode(M), {ok, Socket} = gen_udp:open(0,[binary]), ok = gen_udp:send(Socket, "localhost", 6677, E), gen_udp:close(Socket).