<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div>Last week I sent out an email to the list about a synchronization protocol I was working on with Perry and Dan for PLOrk. I thought I'd share the current product and invite you all to check it out, try it out, and give me feedback if you'd like. All relevant materials can be found at:</div><div><br></div><div><a href="http://www.princeton.edu/~mcerquei/networking/">http://www.princeton.edu/~mcerquei/networking/</a></div><div><br></div><div>The protocol that was rather successful in testing is the Time-Tagged OSC (TOSC) and the source code for all that code is in the appropriately named folder. Apologies for the lack of comments in the source code for the new classes I wrote. The sample client and server programs I wrote have some comments which pretty much covers the main differences from OSC to TOSC.&nbsp;In the final report pdf file, the TOSC section will outline what's going on in general so that's worth checking out. You can also check out a demo that compares a controlled recording/TOSC test/OSC test in the Demo.tar file (it plays in Audacity).&nbsp;</div><div><br></div><div>I'll be continuing to work on this project next year for my senior thesis. There are a number of things I already want to fix/work on, but recommendations/suggestions&nbsp;are, again, very welcomed!</div><div><br></div><div>1. Code everything into the ChucK source code. Everything is written in ChucK right now so it can be made more efficient by coding directly into the source.</div><div>2. Improve the NTP protocols. My algorithms to synchronize clocks/calculate good time-to-open offsets are very, very, very crude and can certainly be improved on. Better NTP = better synchronization.</div><div>3. Netclock - Making TOSC interoperable with Netclock would be useful, as Kassen mentioned in an earlier email.&nbsp;</div><div><br></div><div>Thanks!</div><div><br></div><div>Best,</div><div>Mark</div><div><br><div><div>On Apr 29, 2009, at 1:30 PM, Kassen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Mark,<br><br>That seems quite similar in approach to this;<br><a href="http://netclock.slab.org/wiki/index.php/FAQ">http://netclock.slab.org/wiki/index.php/FAQ</a><br><br>I'd like to invite you to have a look at that and perhaps join the<br>mailinglist on it. If these two could be made inter-operable it could<br>be used to sync ChucK to a range of other open source music and<br>graphics systems.<br><br>Yours,<br>Kas.<br><br>2009/4/29 Mark Cerqueira &lt;mcerquei@princeton.edu>:<br><blockquote type="cite">I've spent this semester doing some independent work with Perry and Dan on<br></blockquote><blockquote type="cite">how to get good network synchronization for PLOrk so that we don't need a<br></blockquote><blockquote type="cite">conductor and can focus on doing other things. I implemented a Time-Tagged<br></blockquote><blockquote type="cite">OSC protocol similar to the stuff Adrian Freed does. Essentially the<br></blockquote><blockquote type="cite">protocol first synchronizes everyone's clock via a protocol that is based on<br></blockquote><blockquote type="cite">the Network Time Protocol (NTP). On the PLOrk network, one machine runs as a<br></blockquote><blockquote type="cite">NTP Server and all others run as NTP Clients - NTP Clients calculate the<br></blockquote><blockquote type="cite">offset of their VM time to the server VM time, as well as keeping track of<br></blockquote><blockquote type="cite">the round-trip time of packets sent to synchronize to account for that in<br></blockquote><blockquote type="cite">the offset.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Once the clocks are synchronized, packets sent over the network include the<br></blockquote><blockquote type="cite">current time (which should be synchronized pretty closely if the above<br></blockquote><blockquote type="cite">protocol works) and a time-to-execute offset. When someone receives the<br></blockquote><blockquote type="cite">packet they add the current time plus the time-to-execute offset and<br></blockquote><blockquote type="cite">schedule the packet to be opened only at that time. The NTP-like<br></blockquote><blockquote type="cite">synchronization protocol I described above also keeps track of all RTTs and<br></blockquote><blockquote type="cite">broadcasts to everyone what a good time-to-execute field is (i.e. make sure<br></blockquote><blockquote type="cite">we give enough time for the packet to travel over the network). If all works<br></blockquote><blockquote type="cite">well, everyone should open the packet at the same time.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Not sure how successful this implementation will be...I'm testing it<br></blockquote><blockquote type="cite">tomorrow during PLOrk rehearsal! If anyone's interested in seeing the<br></blockquote><blockquote type="cite">code/my write-up I can pass around a copy once I *crosses fingers* complete<br></blockquote><blockquote type="cite">it and hand it in on Monday.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Best,<br></blockquote><blockquote type="cite">Mark<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Tom Lieber wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Wed, Apr 29, 2009 at 12:28 PM, Kassen &lt;signal.automatique@gmail.com><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Yeah, a wireless network. And for whatever reason (AirPort updates, OS<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">X updates, variation in laptop hardware), timing issues got worse from<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the previous year. Actually, I don't know how this was solved in the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">end, because I think things had improved by the end (or maybe we<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">stopped relying on the network so much and I didn't notice)...<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Wed, Apr 29, 2009 at 12:27 PM, Daniel Trueman &lt;dtrueman@princeton.edu><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On Apr 29, 2009, at 11:36 AM, Tom Lieber wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">A lot<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">of rehearsal time in PLOrk this past semester was dedicated to<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">synchronizing the performers because we lacked good network<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">synchronization.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">i've come to view this as a feature, not a bug... ;--}<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I chose my words carefully! There's no way I can view getting<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">everybody to practice being in sync as a bad thing, but having the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">option of good network synchronization means we can make pieces where<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">players can give their full attention to something else, like making<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">patterns in beepsh.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">chuck-users mailing list<br></blockquote><blockquote type="cite">chuck-users@lists.cs.princeton.edu<br></blockquote><blockquote type="cite">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br></blockquote><blockquote type="cite"><br></blockquote>_______________________________________________<br>chuck-users mailing list<br>chuck-users@lists.cs.princeton.edu<br>https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br></div></blockquote></div><br></div></body></html>