Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (64 sloc) 2.68 KB
<!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>