osc.js icon indicating copy to clipboard operation
osc.js copied to clipboard

Writing OSC files for Supercollider's non-realtime mode

Open bwestergard opened this issue 5 years ago • 1 comments

Hello! Thanks for writing this library.

I would like to be able to write OSC bundles to a file from nodejs in order to generate audio with supercollider's non-realtime mode. The supercollider NRT osc file format is simply a concatenation of osc bundles, with each bundle prefixed by a 32 bit length integer. I have a very rough proof of concept working here.

Would you be amenable to merging a pull request adding a method like osc.generateNrtFile() which would accept an array of json bundles and generate a Uint8Array in the format Supercollider expects for NRT?

bwestergard avatar Nov 06 '19 05:11 bwestergard

Hi @bwestergard, I'm so sorry for the delay in responding to your question! My day job has been super busy recently. This sounds like a great feature. Yes, I'd be very amenable to merging a pull request to add this functionality.

One question: does it make sense to expose it as a single stateless function in the lower layers of osc.js, or as a new Port object? Or both? If it were a new kind of Port, you could repeatedly send bundles to it and at any point export it to SuperCollider's NRT format. But perhaps that's a bit of a stretch of the whole abstraction.

colinbdclark avatar Nov 27 '19 02:11 colinbdclark