Hi,
Multiple musicians reading generated music involving video games? How awesome is that!
Here's one more insight and a few random ideas for you to try out.
Right now I'm trying to iterate the data instead of sending it all at once but I haven't been successful yet. For instance, I subscore out of the main bach.score, send that to a [bach.iter @out t], then into [mxj net.tcp.send...]. The iterated data comes out of [mxj net.tcp.recv...], then that goes into a bach.collect. The idea is that bach.collect will piece together the iterated information into its original form, although I'm finding that it probably doesn't work this way.
A quick random one: try [jit.net.send] / [jit.net.recv]. I haven't been successful with these objects (which can send messages and/or matrices) for my needs, but who knows... Your's are clearly different from mine, so it might be worth a shot.
As you've probably read on my reply to the other topic, I've had some trouble with sequential (or iterated) messages through [mxj net.tcp.*]. I've discovered that sometimes unwanted reordering would happen (although one would think it wouldn't happen with the TCP protocol). If you are going to piece together messages that arrive out of order, then you got yourself a problem.
One solution that comes to mind is to assign a key to each of the iterated bits so that you can properly parse them and ensure the right order is maintained. For example, you could do it with [bach.keys] and [bach.join], adding some logic to ensure all sent parts have been received, before triggering [bach.join].
Another random idea goes a bit against what Daniele said on the other topic, but since you are having to split the contents of the dumped score anyway, it might make sense to try out the following:
- do a selective dump (message 'dump separate' or only those you
really need (extras?));
- assign keys as mentioned above;
- parse with [bach.keys] directly to the corresponding inlets of your client's [bach.score];
- trigger the [bach.score] with a bang when all parts are in;
You might need an extra [bach.score] on the host side (if you aren't using one already) to use as a temporary buffer for the 'subscore' and where you can perform the selective dump.
I want to be able to send a full-length score with multiple voices of at least 100 measures. In my current example I can send a piano score of 100 measures just fine. But as soon as I kick it up to 200 measures Max crashes.(the musical material is light/thin too) So I guess it'll just be a game of me figuring out how much data I can and cannot send.
Firstly, if you ever discover what those limits are, please share! I'd be interested to know.
Secondly, because you are needing to send 100 or 200 measures at once, I wonder if you could just send the score as a file... in a pen-drive, by e-mail, using a shared folder or a server, maybe ?
Don't get me wrong: I'm not wanting to be sarcastic or anything!
but 100 measures seems a lot of music. If it is generated (and not precomposed, where you could indeed use a pen-drive) then I'm guessing it is not in a reactive fashion (as is the case in Comprovisador, which never generates more then a few dozen sixteenth notes at a time).
So maybe you do have the chance to save that generated score (or individual subscores) as a file (or files), send a notification to your clients and get them to read the saved file from your computer before performance begins. I know: it seems random, but it might work just fine!
Have a look at ways to configure a server in your computer. Old macs had Apache which can still be re-activated in newer macs (which is my case). I've also heard of python's "simple server" which you can use to serve the contents of a folder (like Apache, but (I'm guessing) you can choose a specific folder). Moreover, I'm sure you can do the same with node.js – and since Max 8 has Node For Max, there might be some advantages there!
If you set things up this way (server), you'll need [maxurl] on the client side to download the score file. Otherwise, if you have a shared (public) folder in your host machine, just tell your client's [bach.score] to read from it. If you opt for the shared folder, though, I'll give one advice: make sure it works across all platforms!
... I know... so many things you didn't ask for... sorry!
I hope I didn't cause more confusion than help.
Cheers,
Pedro Louzeiro