colinbdclark / osc.js-examples

Sample code illustrating how to use osc.js in a variety of scenarios.
104 stars 28 forks source link

node.js serial demo #6

Closed drart closed 1 year ago

drart commented 7 years ago

bye bye chrome apps, though this was simpler and faster to do. sorry about the stdin hack. not a musical example but simple enough to show how it works.

colinbdclark commented 7 years ago

Hi @drart, thanks for the pull request. I think it would be great to have an example like this. This PR, in its current form, though, seems to have some overlap with the examples provided elsewhere, such as those in the nodejs directory. I'd prefer to ensure that we have no cut and pasting between examples.

Do you think that this new serial-specific example should replace the serial-related code in the nodejs example? If so, can you update your pull request to do so?

Thanks again!

drart commented 7 years ago

I was wondering if something simpler might be useful. You're right, it does duplicate.

What if the arduino code was also duped or a readme was put at the base? It seems strange that there are two projects that use the Arduino code and it is only in the browser section. It also seems odd to have the browser point to the nodejs flocking install to run the example.

I'd be happy to update those things for now.

What if each platform folder had a separate demo for each protocol it supported?

colinbdclark commented 7 years ago

I'm not sure I understand what you mean by "the Arduino code is only in the browser section." It currently resides here, at top level. I'm confused!

My impression is that the best way to handle this is to put in some effort to simplify the examples significantly, moving to a "one feature per example" style. This would entail:

  1. Removing the serial logic from the code in the nodejs example
  2. Replacing it with your new example
  3. Removing the serial logic from the Chrome App example (because, remember, Chrome Apps aren't dead on Chrome OS) and replacing it with a standalone example
  4. Leaving the Arduino example in the utils folder or somewhere similar, where it can be referenced in documentation for any serial-related purpose.

I also think we should consider removing all Flocking-related example code, and move to a model where we simple print or log or display incoming/outgoing OSC messages—just enough to convey how to use the library itself. This will hopefully help to keep the examples very simple. I know from experience that people just cut and paste these examples and don't change anything—I've seen shipping applications that still have my name in them! :)

colinbdclark commented 7 years ago

And yes, it definitely makes sense that each platform has a simple example for each supported protocol—that's exactly what I'm thinking, too!

drart commented 7 years ago

When I forked I got a different top level structure. Check it out: https://github.com/drart/osc.js-examples

When i finish the conversion I will submit another pull request.

colinbdclark commented 7 years ago

Your fork is 27 commits behind master—looks like it hasn't been updated since 2014. You'll just need to run git pull upstream to update it to the latest.

drart commented 7 years ago

Thanks. Sorry. I thought I had forked this recently.

drart commented 7 years ago

I believe I have altered the nodejs folder appropriately. I haven't done #3 on your todo list yet. Let me know if I am on the right track or not.

colinbdclark commented 7 years ago

Looks like you've got the folder structure right. I've added some review comments for a bunch of very minor things that will make this PR merge-ready. Just to be clear, #3 on the list above isn't a blocker for merging this PR. We can do this in steps. Thanks for your help!

colinbdclark commented 1 year ago

Closing due to inactivity.