Skip to content

Commit f225d50

Browse files
committed
Generate docs for v0.0.3
1 parent 9492bf3 commit f225d50

31 files changed

+16073
-1
lines changed

docs/0.0.3/SonicPiAPI.html

Lines changed: 2304 additions & 0 deletions
Large diffs are not rendered by default.

docs/0.0.3/SonicPiOSCServer.html

Lines changed: 995 additions & 0 deletions
Large diffs are not rendered by default.
19.1 KB
Binary file not shown.

docs/0.0.3/fonts/OpenSans-Bold-webfont.svg

Lines changed: 1830 additions & 0 deletions
Loading
21.9 KB
Binary file not shown.
19.7 KB
Binary file not shown.

docs/0.0.3/fonts/OpenSans-BoldItalic-webfont.svg

Lines changed: 1830 additions & 0 deletions
Loading
Binary file not shown.
19.8 KB
Binary file not shown.

docs/0.0.3/fonts/OpenSans-Italic-webfont.svg

Lines changed: 1830 additions & 0 deletions
Loading
22.6 KB
Binary file not shown.
19.1 KB
Binary file not shown.

docs/0.0.3/fonts/OpenSans-Light-webfont.svg

Lines changed: 1831 additions & 0 deletions
Loading
21.7 KB
Binary file not shown.
Binary file not shown.

docs/0.0.3/fonts/OpenSans-LightItalic-webfont.svg

Lines changed: 1835 additions & 0 deletions
Loading
Binary file not shown.
19.4 KB
Binary file not shown.

docs/0.0.3/fonts/OpenSans-Regular-webfont.svg

Lines changed: 1831 additions & 0 deletions
Loading
22.1 KB
Binary file not shown.

docs/0.0.3/index.html

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Home</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Home</h1>
21+
22+
23+
24+
25+
26+
27+
28+
29+
<h3>@sunderb/sonic-pi-js-api 0.0.3</h3>
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
<section>
46+
<article><h1>sonic-pi-js-api</h1>
47+
<p>An experimental JavaScript API to start and interact with the Sonic Pi server. Compatible with Sonic Pi v4.x.</p>
48+
<p><a href="https://www.npmjs.com/package/@sunderb/sonic-pi-js-api"><img src="https://img.shields.io/npm/v/@sunderb/sonic-pi-js-api" alt="npm (scoped)"></a></p>
49+
<h2>📖 Documentation</h2>
50+
<p>Documentation is available online at https://sunderb.me/sonic-pi-js-api/latest/</p>
51+
<h2>✨ Features</h2>
52+
<table>
53+
<thead>
54+
<tr>
55+
<th>Feature</th>
56+
<th>Implemented?</th>
57+
</tr>
58+
</thead>
59+
<tbody>
60+
<tr>
61+
<td><strong>Booting</strong></td>
62+
<td></td>
63+
</tr>
64+
<tr>
65+
<td>Boot and initialise the server</td>
66+
<td>✅ Yes</td>
67+
</tr>
68+
<tr>
69+
<td>Shutdown the server</td>
70+
<td>✅ Yes</td>
71+
</tr>
72+
<tr>
73+
<td><strong>Basic commands</strong></td>
74+
<td></td>
75+
</tr>
76+
<tr>
77+
<td>Run code</td>
78+
<td>✅ Yes</td>
79+
</tr>
80+
<tr>
81+
<td>Stop all jobs</td>
82+
<td>✅ Yes</td>
83+
</tr>
84+
<tr>
85+
<td><strong>Buffers/workspaces</strong></td>
86+
<td></td>
87+
</tr>
88+
<tr>
89+
<td>Load workspaces</td>
90+
<td>🚧 Partial</td>
91+
</tr>
92+
<tr>
93+
<td>Save workspaces</td>
94+
<td>✅ Yes (untested)</td>
95+
</tr>
96+
<tr>
97+
<td>Save and play buffer</td>
98+
<td>✅ Yes (untested)</td>
99+
</tr>
100+
<tr>
101+
<td>Buffer new line and indent</td>
102+
<td>✅ Yes (untested)</td>
103+
</tr>
104+
<tr>
105+
<td><strong>Recordings</strong></td>
106+
<td></td>
107+
</tr>
108+
<tr>
109+
<td>Start recording</td>
110+
<td>❌ No</td>
111+
</tr>
112+
<tr>
113+
<td>Stop recording</td>
114+
<td>❌ No</td>
115+
</tr>
116+
<tr>
117+
<td><strong>Logging</strong></td>
118+
<td></td>
119+
</tr>
120+
<tr>
121+
<td>Handle and emit log messages</td>
122+
<td>✅ Yes</td>
123+
</tr>
124+
<tr>
125+
<td>Handle and emit errors</td>
126+
<td>🚧 Partial</td>
127+
</tr>
128+
<tr>
129+
<td><strong>Options &amp; IO</strong></td>
130+
<td></td>
131+
</tr>
132+
<tr>
133+
<td>Main volume</td>
134+
<td>✅ Yes</td>
135+
</tr>
136+
<tr>
137+
<td>Safe mode</td>
138+
<td>❌ No</td>
139+
</tr>
140+
<tr>
141+
<td>External synths</td>
142+
<td>✅ Yes</td>
143+
</tr>
144+
<tr>
145+
<td>MIDI options</td>
146+
<td>🚧 Partial</td>
147+
</tr>
148+
<tr>
149+
<td>Link</td>
150+
<td>❌ No</td>
151+
</tr>
152+
</tbody>
153+
</table>
154+
<h2>Attributions</h2>
155+
<ul>
156+
<li>Heavily based on on the <a href="https://github.com/sonic-pi-net/sonic-pi/tree/dev/app/api">official C++ Sonic Pi API</a> (although not a fully exact copy) - MIT License</li>
157+
</ul>
158+
<h3>Dependencies</h3>
159+
<ul>
160+
<li><a href="https://github.com/colinbdclark/osc.js">osc.js</a> - MIT or GPL-2.0 License</li>
161+
<li><a href="https://github.com/jsdoc/jsdoc">jsdoc</a> (development only) - Apache 2.0 License</li>
162+
</ul>
163+
<h2>License</h2>
164+
<p>This package is licensed under the MIT License. See <a href="LICENSE.md">LICENSE.md</a> for the full license.</p></article>
165+
</section>
166+
167+
168+
169+
170+
171+
172+
</div>
173+
174+
<nav>
175+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="SonicPiAPI.html">SonicPiAPI</a></li><li><a href="SonicPiOSCServer.html">SonicPiOSCServer</a></li></ul><h3>Events</h3><ul><li><a href="SonicPiAPI.html#event:received_ports">received_ports</a></li><li><a href="SonicPiAPI.html#event:shutdown_complete">shutdown_complete</a></li><li><a href="SonicPiOSCServer.html#event:ack">ack</a></li><li><a href="SonicPiOSCServer.html#event:error">error</a></li><li><a href="SonicPiOSCServer.html#event:exited">exited</a></li><li><a href="SonicPiOSCServer.html#event:log">log</a></li></ul>
176+
</nav>
177+
178+
<br class="clear">
179+
180+
<footer>
181+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sun May 21 2023 23:59:22 GMT+0100 (British Summer Time)
182+
</footer>
183+
184+
<script> prettyPrint(); </script>
185+
<script src="scripts/linenumber.js"> </script>
186+
</body>
187+
</html>

docs/0.0.3/osc_osc-server.js.html

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Source: osc/osc-server.js</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Source: osc/osc-server.js</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
<article>
29+
<pre class="prettyprint source linenums"><code>const osc = require('node-osc');
30+
const { EventEmitter } = require('events');
31+
32+
/**
33+
* A class used to receive messages from the Sonic Pi server.
34+
*/
35+
class SonicPiOSCServer {
36+
37+
/**
38+
* Creates an instance of the `SonicPiOSCServer` Class
39+
* @constructor
40+
* @classdesc A class used to receive and acknowledge messages from the Sonic Pi server.
41+
* @param {string} ip - the IP address of this OSC server
42+
* @param {number} port - the port to listen on
43+
* @param {string} spider_ip - the IP address of the Sonic Pi server
44+
* @param {number} spider_port - the port to send acknowledgements to
45+
*
46+
*/
47+
constructor(ip, port, spider_ip, spider_port) {
48+
let _this = this;
49+
50+
this.m_port = port;
51+
this.m_ip = ip;
52+
this.emitter = new EventEmitter();
53+
this.osc_client = new osc.Client(spider_ip, spider_port);
54+
55+
this.osc_server = new osc.Server(port, ip, () => {
56+
console.log(`OSC server is listening on ${ip}:${port}`);
57+
});
58+
59+
this.osc_server.on('message', function (msg) {
60+
switch (msg[0]) {
61+
/**
62+
* Logging
63+
*
64+
* @event SonicPiOSCServer#log
65+
* @type {object}
66+
* @property {string} type - `info`, `error` or `multi_message`
67+
* @property {object[]} message_info - Varies depending on the type
68+
*/
69+
case "/log/info":
70+
_this.emitter.emit('log', {
71+
type: "info",
72+
message_info: msg.slice(1)
73+
});
74+
break;
75+
case "/log/error":
76+
_this.emitter.emit('log', {
77+
type: "error",
78+
message_info: msg.slice(1)
79+
});
80+
break;
81+
case "/log/multi_message":
82+
_this.emitter.emit('log', {
83+
type: "multi_message",
84+
message_info: msg.slice(1)
85+
});
86+
break;
87+
88+
// Boot errors
89+
case "/exited-with-boot-error":
90+
var info = {
91+
message: msg[1]
92+
};
93+
_this.emitter.emit("boot_error", info);
94+
break;
95+
96+
97+
/**
98+
* Runtime/syntax errors
99+
*
100+
* @event SonicPiOSCServer#error
101+
* @type {object}
102+
* @property {string} type - Either `runtime_error` or `syntax_error`
103+
* @property {number} job_id
104+
* @property {string} message
105+
* @property {number} line_number
106+
* @property {string} line_number_string - Syntax errors only
107+
* @property {string} line_string - Syntax errors only
108+
* @property {string} backtrace - Runtime errors only
109+
*/
110+
case "/error":
111+
var error_info = {
112+
type: "runtime_error",
113+
job_id: parseInt(msg[1]),
114+
message: msg[2],
115+
backtrace: msg[3],
116+
line_number: parseInt(msg[4])
117+
}
118+
_this.emitter.emit("error", error_info);
119+
break;
120+
case "/syntax_error":
121+
var error_info = {
122+
type: "syntax_error",
123+
job_id: parseInt(msg[1]),
124+
message: msg[2],
125+
line_string: msg[3],
126+
line_number: parseInt(msg[4]),
127+
line_number_string: msg[5]
128+
}
129+
_this.emitter.emit("error", error_info);
130+
break;
131+
132+
/**
133+
* Emitted when the Sonic Pi server exits.
134+
*
135+
* @event SonicPiOSCServer#exited
136+
*/
137+
case "/exited":
138+
_this.emitter.emit('exited');
139+
140+
/**
141+
* Emitted when the Sonic Pi server acknowledges a message.
142+
*
143+
* @event SonicPiOSCServer#ack
144+
* @type {object}
145+
* @property {object} id
146+
*/
147+
case "/ack":
148+
var info = {
149+
id: msg[1]
150+
}
151+
_this.emitter.emit('ack', info);
152+
153+
default:
154+
155+
}
156+
console.log(`Message recieved: ${msg}`);
157+
_this.osc_client.send("/ack");
158+
})
159+
}
160+
161+
destructor() {
162+
this.osc_server.close();
163+
this.emitter.dispose();
164+
}
165+
}
166+
167+
module.exports = {
168+
SonicPiOSCServer
169+
};
170+
</code></pre>
171+
</article>
172+
</section>
173+
174+
175+
176+
177+
</div>
178+
179+
<nav>
180+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="SonicPiAPI.html">SonicPiAPI</a></li><li><a href="SonicPiOSCServer.html">SonicPiOSCServer</a></li></ul><h3>Events</h3><ul><li><a href="SonicPiAPI.html#event:received_ports">received_ports</a></li><li><a href="SonicPiAPI.html#event:shutdown_complete">shutdown_complete</a></li><li><a href="SonicPiOSCServer.html#event:ack">ack</a></li><li><a href="SonicPiOSCServer.html#event:error">error</a></li><li><a href="SonicPiOSCServer.html#event:exited">exited</a></li><li><a href="SonicPiOSCServer.html#event:log">log</a></li></ul>
181+
</nav>
182+
183+
<br class="clear">
184+
185+
<footer>
186+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sun May 21 2023 23:59:22 GMT+0100 (British Summer Time)
187+
</footer>
188+
189+
<script> prettyPrint(); </script>
190+
<script src="scripts/linenumber.js"> </script>
191+
</body>
192+
</html>

0 commit comments

Comments
 (0)