sc_quit
Stop the SuperCollider audio server and release all audio resources to clean up the audio synthesis environment.
Instructions
Quit the SuperCollider audio server and clean up resources.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:266-279 (handler)The main handler for the sc_quit tool. It checks if the SuperCollider server is booted, calls scServer.quit() to shut it down, resets the synthDefsLoaded flag, and returns a success message.case 'sc_quit': { if (!scServer.getBooted()) { return { content: [{ type: 'text', text: 'SuperCollider server is not running' }], }; } await scServer.quit(); synthDefsLoaded = false; return { content: [{ type: 'text', text: 'SuperCollider server quit successfully' }], }; }
- src/index.ts:52-59 (registration)Registration of the sc_quit tool in the tools array, including name, description, and empty input schema (no parameters required). This is used by the ListTools handler.{ name: 'sc_quit', description: 'Quit the SuperCollider audio server and clean up resources.', inputSchema: { type: 'object', properties: {}, }, },
- src/supercollider.ts:137-152 (helper)The SuperColliderServer.quit() method, which implements the core quitting logic by executing 'Server.default.quit;' via sclang and then killing the process. Called by the tool handler.async quit(): Promise<void> { if (!this.isBooted || !this.sclangProcess) { throw new Error('SuperCollider server is not running'); } return new Promise((resolve) => { // Gracefully quit the server first this.executeCode('Server.default.quit;').then(() => { setTimeout(() => { this.sclangProcess?.kill(); this.isBooted = false; resolve(); }, 500); }); }); }