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

Listen to /n_go and /n_end messages from the server #18

Open
munshkr opened this issue Feb 14, 2017 · 0 comments
Open

Listen to /n_go and /n_end messages from the server #18

munshkr opened this issue Feb 14, 2017 · 0 comments
Labels
enhancement supercollider Related to SuperCollider Stream

Comments

@munshkr
Copy link
Member

munshkr commented Feb 14, 2017

Right now, if an instrument ends before it is gated off (because it has a fixed envelope generator, for example), the /n_set commands fails because the synth node has already been freed. To avoid that, track nodes in the server by listening to /n_go and /n_end OSC messages that the server sends, to know with certainty if a node exists or not at a given time.

This is a code example for Supercollider that shows how the OSC messages look like:

(
OSCresponderNode(s.addr, '/n_end', { arg time, responder, msg;
    [time, responder, msg].postln;
}).add;
)

n = s.nextNodeID;
s.sendMsg("/s_new", "sin", n, 0, 0, "freq", 850);
s.sendMsg("/n_set", n, "freq", 600);
s.sendMsg("/n_free", n);
@munshkr munshkr transferred this issue from xi-livecode/xi-supercollider May 4, 2019
@munshkr munshkr added enhancement supercollider Related to SuperCollider Stream labels May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement supercollider Related to SuperCollider Stream
Projects
None yet
Development

No branches or pull requests

1 participant