Hello,
I am relatively new to SSR and I was trying to use SSR's network interface with MATLAB. I got stuck and while looking for an answer I found:
https://groups.google.com/forum/#!topic/SoundScapeRenderer/_i-IsraJ97Q , where Richard Hughes mentioned his own ssrcontroller MATLAB function. Therefore, I thought you might be able to help me with my problem.
What I tried:
1) On the computer (OS X 10.11.4) where I run SSR, I listened to a port with netcat: nc -l 4000
2) I established a connection with MATLAB from a different computer (Ubuntu 14.04 and MATLAB R2014b):
%prep
t = tcpip('192.168.2.12', 4000); %define ip and port
fopen(t); %open connection
set(t, 'Terminator', '0'); %change terminator to desired terminator binary zero as documented in
https://ssr.readthedocs.io/en/latest/network.html3) I checked the connection via sudo lsof -i -n -P | grep TCP on the MAC. As expected my connections where listed.
4) I send data with MATLAB and looked at the nc output from step 1. It came out just the way I wanted it to.
%write data
fprintf(t, '%s\n', '<request><scene volume="6"/></request>');
5) I closed all connections and cleaned up.
%cleanup
fclose(t);
delete(t);
clear t;
6) I opened an instance of SSR on the Mac and set the port to 4000 with the option --ip-server=4000.
I repeated step 2 and 4, but nothing happened.
I tried a bunch of different ways to send the data and I tried different commands too. In the end I want to move a source to certain coordinates.
Unfortunately, I did not get it to work so far. If I try to read data in MATLAB to see if the connection works with
data = fscanf(t)
it works perfectly fine. I get a string with all parameters:
<update><volume>0</volume><transport>stop</transport><reference><position x="0 .....
My first guess was that something is wrong with the Terminator, but I tried different things and nothing worked.
I am sure I am doing a dumb mistake here, but I just can't figure it out. I would be very glad if someone could help me out.
Thanks,
Alex