Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental Bundles #48

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Experimental Bundles #48

merged 2 commits into from
Apr 22, 2021

Conversation

MylesBorins
Copy link
Owner

@MylesBorins MylesBorins commented Apr 22, 2021

This PR adds "experimental" support for processing OSC Bundle.

There is a new type of event on the osc Server called "bundle" that will get called with a decoded bundle when the OSC Server receives a bundle. It is possible for bundles to be recursive. There is currently no logic for processing a bundle as a series of messages.

import { Server } from 'node-osc';

var oscServer = new Server(3333, '0.0.0.0', () => {
  console.log('OSC Server is listening');
});

oscServer.on('bundle', function (bundle) {
  bundle.elements.forEach((element, i) => {
    console.log(`Timestamp: ${bundle.timetag[i]}`);
    console.log(`Message: ${element}`)
  });
  oscServer.close();
});

This PR also refactors the internals fairly significantly to have the Server now use osc-min rather than manually decoded packets using jspack. This allows us to drop support for the jspack dependency and get Bundle support for free 🎉. This changes some internal errors and as such I am cautiously marking this PR as Semver-Major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant