The best way to copy one buffer~ to another over the Internet?
My 1st attempt at this was with udpsend. Using the sync outlet from record~, I set it up so a barrage of uzi fire would follow just behind where actual recording was taking place and immediately peek~ the sample values out through udpsend where they would again be [peek~]ed into the 2nd buffer on the other side. It seems to work, for the first fraction of a second out of an 8 second buffer, but then I'm flooded with a couple million of these warnings
udpsend: Dropped packet. Total dropped packets:2265615
Is udpsend not meant for so many or so frequent messages? What's a better way to go about this?
UDP/OSC is a quite basic protocol. Besides the dropped packages (which may be solved by ramping up the maxquesize really high) there is no way to make sure the packages arrive in the right order. I remember having seen an example of streaming audio in a net with some jitter objects. Probably in the tutorials?
cheers!
What about sending the buffer content as a file? Or do you need the buffers synced on the fly?
Okay so I don't need or want to actually stream the audio and I would like to make sure that every sample arrives intact so there is no loss of quality, so it seems that TCP is the way for me to go. I tried switching out udpsend and udpreceive for [mxj net.tcp.send] and [mxj net.tcp.recv], but I'm still without luck. Now, at first, it seems that none of the messages go through and also strangely all my print objects go dead, but then as I try to do more with the patch, out of nowhere the record command will go off again and the messages seem to make it across, but in doing so CPU usage rockets upwards of 100% and Max becomes unresponsive. What am I doing wrong here? Here's my entire patch
with the relevant parts in red. For now by the way, I'm just using one computer and localhost as the address.
What about sending the buffer content as a file? Or do you need the buffers synced on the fly?
I don't necessarily need them synced on-the-fly, but sending the entire buffer contents all at once would be a little less than ideal, as it might take a decent amount of time with a buffer that's multiple minutes long. And that's the general size my buffer will be. Still though, it would be feasible, if I can't get it to work this way. How do you go about using Max to send files around?
i am not in front of max right now, so i can't take a look at your patch.
Two ideas that come to my mind regarding copying/sending files: you could copy them to remote using the shell object (scp/ftp/sftp i.e ) and notify the remote computer via udpsend when it's done (also telling the filename).
You could also run a webserver on the remote computer and use maxurl with a post request to send the file.
For the latter one you would need a server script...
you never send data that matters asynchronous.
is it not an option for you to save the buffer into a file and upload that file using a TCP (p2p or ftp) protocol?
sometimes workarounds are more straight forward than "all max" solutions.
-110
you could copy them to remote using the shell object (scp/ftp/sftp i.e ) and notify the remote computer via udpsend when it’s done (also telling the filename).
By 'shell object' are you referring to a Max object? If so I don't seem to have one by the name; is it an external?
You could also run a webserver on the remote computer and use maxurl with a post request to send the file.
Forgive me for not being well-versed in this sort of thing, but are you referring to using maxurl to communicate with something like FileZilla?
is it not an option for you to save the buffer into a file and upload that file using a TCP (p2p or ftp) protocol?
I suppose it could be. Would you happen to have a recommendation of a specific application or client that is simple and reliable? With my limited networking experience the only thing that comes to mind is Dropbox or some other cloud service, which would actually work in theory and probably be the most straightforward, but I'd be concerned about its responsiveness. I'm not sure that I could count on Dropbox to actually start transferring the file as soon as it appears. I would ideally like to have the buffer transferred as immediately as possible; a delay of several seconds could work, but a delay of minutes would be untenable. But a method that could avoid unnecessary network configuration, like setting up port forwarding, would be highly desirable.
Thanks for all the ideas. I'm sure I'll be able to get this working eventually!
Hi TO_THE_SUN,
sorry for the late reply. I was in a middle of a turmoil.
By ‘shell object’ are you referring to a Max object? If so I don’t seem to have one by the name; is it an external?
Yes I meant an external. I have never used it myself, but it is quite popular.
OS X comes with a build in ssh functionality. If you look in the system preferences under "Sharing"->"Remote Login" you can see something like "ssh username@computername". you can use the same address using the "scp" command instead of the "ssh" command to copy files to a remote computer using the shell/terminal : http://www.hypexr.org/linux_scp_help.php
Instead of the "computername" you might want to use your ip-adress "scp/ssh username@123.456.789.123". If you would to copy files to a computer via internet there are some router configurations to be taking into account. look for port-forwarding and NAT (network address translation).
Forgive me for not being well-versed in this sort of thing, but are you referring to using maxurl to communicate with something like FileZilla?
Not quite. FileZilla is basically a GUI front-end to access and copy files to ftp/sftp servers.
The web server approach would be a bit of an overkill i guess ...
You could also consider Bittorrent Sync: https://www.getsync.com/
Thanks everyone for the suggestions! I neglected to get back to this thread but it looks like BitTorrent Sync is going to work very well. It's easy to set up and automatic, plus it's reliable and responsive. When a file appears in the synced folder, it only takes about 2 seconds for the file to appear on the remote computer and begin transferring.