supersonic-scsynth-samples 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/README.md +10 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -10,10 +10,13 @@ npm install supersonic-scsynth-samples
10
10
 
11
11
  ## Usage
12
12
 
13
- ### Via CDN (Recommended)
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
14
16
 
15
17
  ```javascript
16
- import { SuperSonic } from 'supersonic-scsynth';
18
+ // Self-hosted core library
19
+ import { SuperSonic } from './dist/supersonic.js';
17
20
 
18
21
  const sonic = new SuperSonic({
19
22
  sampleBaseURL: 'https://unpkg.com/supersonic-scsynth-samples@latest/samples/'
@@ -30,14 +33,15 @@ await sonic.allocReadBuffer(2, 'ambi_choir.flac');
30
33
  sonic.send('/s_new', 'sonic-pi-basic_mono_player', -1, 0, 1, 'buf', 0);
31
34
  ```
32
35
 
33
- ### Via npm install
36
+ ### Self-hosted core and samples
37
+
38
+ Copy samples to your public directory and reference them locally:
34
39
 
35
40
  ```javascript
36
- import { SuperSonic } from 'supersonic-scsynth';
37
- import { SAMPLES_DIR } from 'supersonic-scsynth-samples';
41
+ import { SuperSonic } from './dist/supersonic.js';
38
42
 
39
43
  const sonic = new SuperSonic({
40
- sampleBaseURL: SAMPLES_DIR + '/'
44
+ sampleBaseURL: './samples/'
41
45
  });
42
46
  ```
43
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supersonic-scsynth-samples",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "All 206 Sonic Pi audio samples for SuperSonic scsynth",
5
5
  "main": "index.js",
6
6
  "type": "module",