supersonic-scsynth-samples 0.23.1 → 0.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,13 +10,8 @@ npm install supersonic-scsynth-samples
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
**Important:** SuperSonic cannot be loaded from a CDN. You must self-host the core library and serve it with COOP/COEP headers. Samples can be loaded from a CDN.
|
|
14
|
-
|
|
15
|
-
### Self-hosted core with CDN samples
|
|
16
|
-
|
|
17
13
|
```javascript
|
|
18
|
-
|
|
19
|
-
import { SuperSonic } from './dist/supersupersonic.js';
|
|
14
|
+
import { SuperSonic } from 'https://unpkg.com/supersonic-scsynth@latest';
|
|
20
15
|
|
|
21
16
|
const supersonic = new SuperSonic({
|
|
22
17
|
sampleBaseURL: 'https://unpkg.com/supersonic-scsynth-samples@latest/samples/'
|
|
@@ -27,23 +22,12 @@ await supersonic.init();
|
|
|
27
22
|
// Load any sample
|
|
28
23
|
await supersonic.allocReadBuffer(0, 'bd_haus.flac');
|
|
29
24
|
await supersonic.allocReadBuffer(1, 'loop_amen.flac');
|
|
30
|
-
await supersonic.allocReadBuffer(2, 'ambi_choir.flac');
|
|
31
25
|
|
|
32
26
|
// Play with basic_mono_player synthdef
|
|
33
27
|
supersonic.send('/s_new', 'sonic-pi-basic_mono_player', -1, 0, 1, 'buf', 0);
|
|
34
28
|
```
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Copy samples to your public directory and reference them locally:
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
import { SuperSonic } from './dist/supersupersonic.js';
|
|
42
|
-
|
|
43
|
-
const supersonic = new SuperSonic({
|
|
44
|
-
sampleBaseURL: './samples/'
|
|
45
|
-
});
|
|
46
|
-
```
|
|
30
|
+
SuperSonic works directly from CDN with zero configuration.
|
|
47
31
|
|
|
48
32
|
## Available Samples
|
|
49
33
|
|