Bach Lists Across Network

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
fiboribo
Posts: 21
Joined: Thu Apr 14, 2016 6:17 pm

Bach Lists Across Network

Post by fiboribo » Mon Jul 16, 2018 3:08 pm

Hello!

I'm working on a piece that will use Bach to generate scores for multiple performers across a wireless network. I'm using udpsend/receive which works like a charm. But when sending data across computers using Bach objects there is an obvious problem, which is that Bach lists are stored in the main computer only. Is the only way to send data from, let's say a bach.roll on one computer a bach.roll on another, to extract the data from each outlet of the first, reformat it as needed and feed to each inlet of the new bach.roll? This is obviously doable but I'm wondering if there is a simpler way to do this. I have no doubt that someone on this forum has a solution! ;-)

Federico

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: Bach Lists Across Network

Post by danieleghisi » Tue Jul 17, 2018 9:11 am

Hi, I'm no expert on networking. I know that some people do that, and I'll let them answer more thoroughly.
We had bach.encode and bach.decode for that matter, but they are both deprecated since they had some issues - Andrea may step in, since it's his field of expertise.

I just want to point out that in any case I wouldn't dump EACH outlet, you might want to send a "dump body" instead and retrieve the gathered syntax from the first outlet (see #gathered+syntax vs. #separate+syntax), which can be fed to the first inlet to rebuild the object. Not sure how this will behave when sent over the network...

Again, I'll let Andrea add to this.

d

andreaagostini
Posts: 209
Joined: Fri Dec 03, 2010 1:51 pm

Re: Bach Lists Across Network

Post by andreaagostini » Tue Jul 17, 2018 2:48 pm

Hi,
the problem with bach.encode is that, for some reason I've never been able to fathom, when the encoded data are transmitted over a network some get typically lost. I've seen this happen with both the TCP/IP and the UDP protocols. I'd really need some help from someone with a real understanding of how computer networks work...
andrea

fiboribo
Posts: 21
Joined: Thu Apr 14, 2016 6:17 pm

Re: Bach Lists Across Network

Post by fiboribo » Mon Jul 23, 2018 6:14 pm

Thank you!

Federico

Dtronlujan
Posts: 15
Joined: Sun Apr 14, 2019 1:27 am

Re: Bach Lists Across Network

Post by Dtronlujan » Wed May 01, 2019 10:53 pm

Hello I am actually trying to do the exact same thing! (I just made a post about it) I'm using ethernet cables but I'm essentially having the same problem. Was there ever an answer to this?

pedrnun
Posts: 74
Joined: Sun Jan 17, 2016 3:23 am
Contact:

Re: Bach Lists Across Network

Post by pedrnun » Thu May 02, 2019 4:17 am

Hi all,

I can add a bit to this discussion.
My approach in Comprovisador (see website* for details) has been to let the client application do most of the work and to send the least possible data over the network.
For example, if I want to add a chord to a particular client's [bach.roll], I'll make use of 'addchord' messages (or a simplified version of it that can be parsed in the client side).
In this example, I would use UDP because this stuff happens in real time and synchronisation is more important than an occasional lost note.
In other cases, I might have to send a bunch of data at once (when calling a preset, for example) and I really need all values to arrive; I then use TCP, as reliability comes first, in this case.

One important thing I learned (the hard way, indeed!) is that all values should be packed in one message before being sent, in order to avoid unwanted reordering – even with TCP, which is odd! But in fact, that's my experience with [mxj net.tcp.send] / [mxj net.tcp.recv].
Hence I pack all my key-value pairs with [bach.collect @inwrap 1 @out t] so I'm able to parse them in the client side. I haven't had any problems since and I've used the system with up to 14 client laptops ("Comprovisação nº 7") connected wirelessly to a router.

Recently, I've implemented the possibility of using precomposed scores (actually, subscores). It has been used live during the performance of "Comprovisação nº 10" (video not yet available, but it will be... someday).
At login, each client requests from the host a set of subscores (according to instrument) and stores them in a [bach.shelf]. This is done via TCP. These scores can then be deployed instantly during performance. I have actually had one problem with a truncated score, once, but I haven't had the time to debug it yet... and I cannot exclude human error!

I hope this is helpful.

Cheers,
Pedro Louzeiro
* https://comprovisador.wordpress.com

p.s. - I have some papers that mention this subject – see Publications section on my site.

Post Reply