-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
72 lines (64 loc) · 2.68 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>subcollider.js</title>
<meta property="og:title" content="subcollider.js">
<meta property="og:description" content="SubCollider.js is a JavaScript library that provides like SuperCollider functions.">
<meta property="og:url" content="http://mohayonao.github.io/subcollider.js">
<meta property="og:image" content="http://mohayonao.github.io/subcollider/docs/logo.png">
<meta name="description" content="SubCollider.js is a JavaScript library that provides like SuperCollider functions.">
<meta name="keywords" content="JavaScript,SuperCollider,timbre.js">
<link rel="shortcut icon" href="favicon.ico" id="favicon">
<link rel="stylesheet" href="./docs/index.css">
<link rel="stylesheet" href="./docs/prettify.css">
<script src="./builds/subcollider.js"></script>
<script src="./docs/prettify.js"></script>
<script>window.onload=function() { prettyPrint(); }</script>
</head>
<body>
<h1><a href=".">subcollider.js</a> <sup>v0.1.1</sup></h1>
<div id="doc-index">
<h2>Downloads</h2>
<span>version: 0.1.1</span>
<ul>
<li><a href="./builds/subcollider.js">subcollider.js</a></li>
<li><a href="./builds/subcollider-min.js">subcollider-min.js</a></li>
<li><a href="./builds/subcollider-min.map">soucemap</a></li>
</ul>
<h2>Documents</h2>
<ul>
<li><a href="./docs/">documents</a></li>
</ul>
<h2>Project</h2>
<ul>
<li><a href="https://github.com/mohayonao/subcollider.js">GitHub</a></li>
</ul>
</div>
<div id="doc-body">
<div style="padding:15px;letter-spacing:0.1em">
SubCollider.js is a JavaScript library that provides like SuperCollider functions to built-in prototypes and <b>sc</b> namespace. It is the recommended base library for <a href="http://mohayonao.github.io/timbre.js" target="timbre.js">timbre.js</a>.
</div>
<pre class="prettyprint lang-js">
sc.midicps(69);
// => 440
sc.midicps([69, 71]);
// => [ 440, 493.8833012561241 ]
(4).ampdb();
// => 12.041199826559248
[4, 16].ampdb();
// => [ 12.041199826559248, 24.082399653118497 ]
sc.Range("0..5");
// [ 0, 1, 2, 3, 4, 5 ]
sc.Range("1...50").select("isPrime");
// => [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 ]
sc.Scale.major().degreeToFreq(sc.Range(7), 440).asInteger();
// => [ 440, 493, 554, 587, 659, 739, 830, 880 ]
sc.Scale.major("just").degreeToFreq(sc.Range(7), 440).asInteger();
// => [ 440, 495, 550, 586, 660, 733, 824, 880 ]
sc.Scale.minor("just").degreeToFreq(sc.Range(7), 440).asInteger();
// => [ 440, 495, 528, 586, 660, 704, 792, 880 ]
</pre>
</div>
</body>
</html>