Skip to content
👷
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
builds
docs
src
test
.gitignore
Gruntfile.coffee
LICENSE
README.md
favicon.ico
index.html
package.json

README.md

subcollider.js v0.1.1

SubCollider.js is a JavaScript library that provides like SuperCollider functions to built-in prototypes and sc namespace. It is the recommended base library for timbre.js.

Download

Documents

documents

Installation

In browsers:

<script src="subcollider.js"></script>

Using npm:

npm install subcollider

Examples

 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 ]
You can’t perform that action at this time.