mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-29 04:53:10 +00:00
describing how to use the build with requirejs
This commit is contained in:
parent
d1d155f58d
commit
b2eebe9dc4
1 changed files with 13 additions and 1 deletions
14
README.md
14
README.md
|
@ -31,7 +31,7 @@ To get all of the files in their directory structure, you can ```npm install ton
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: './base',
|
baseUrl: "./base",
|
||||||
paths: {
|
paths: {
|
||||||
"Tone" : "path/to/Tone.js/Tone"
|
"Tone" : "path/to/Tone.js/Tone"
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,18 @@ require(["Tone/core/Transport"], function(Transport){
|
||||||
//...
|
//...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also use the [Tone.js Build](https://raw.githubusercontent.com/TONEnoTONE/Tone.js/master/build/Tone.js) with requirejs by adding the build as a dependency in require.config
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
require.config({
|
||||||
|
deps : ["path/to/build/Tone"],
|
||||||
|
baseUrl: "./base",
|
||||||
|
});
|
||||||
|
//now pull in the modules individually by name
|
||||||
|
require(["Tone/instrument/Sampler"], function(Sampler){
|
||||||
|
//...
|
||||||
|
```
|
||||||
|
|
||||||
# AudioContext
|
# AudioContext
|
||||||
|
|
||||||
Tone.js creates an AudioContext when it loads and shims it for maximum browser compatibility. The AudioContext can be found at ```Tone.context``` or from within any Object extending Tone as ```this.context```.
|
Tone.js creates an AudioContext when it loads and shims it for maximum browser compatibility. The AudioContext can be found at ```Tone.context``` or from within any Object extending Tone as ```this.context```.
|
||||||
|
|
Loading…
Reference in a new issue