@zeeuw/riff 0.0.0-stage → 0.1.0-beta.0

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 (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/data/registry-data.js +3 -0
  4. package/data/signatures.js +3 -0
  5. package/docs/clean-room.md +450 -0
  6. package/package.json +69 -4
  7. package/src/audio/clock.js +383 -0
  8. package/src/audio/engine.js +678 -0
  9. package/src/audio/index.js +394 -0
  10. package/src/audio/offline.js +73 -0
  11. package/src/audio/params.js +397 -0
  12. package/src/audio/samples.js +274 -0
  13. package/src/audio/unlock.js +70 -0
  14. package/src/audio/voices.js +44 -0
  15. package/src/combinators.js +150 -0
  16. package/src/compat.js +16 -0
  17. package/src/constructors.js +236 -0
  18. package/src/controls.js +199 -0
  19. package/src/draw.js +252 -0
  20. package/src/euclid.js +57 -0
  21. package/src/evaluate.js +251 -0
  22. package/src/extras/check.js +678 -0
  23. package/src/extras/describe.js +433 -0
  24. package/src/extras/editor.js +369 -0
  25. package/src/extras/index.js +10 -0
  26. package/src/fraction.js +300 -0
  27. package/src/hap.js +64 -0
  28. package/src/helpers.js +68 -0
  29. package/src/index.js +74 -0
  30. package/src/mini/index.js +36 -0
  31. package/src/mini/parser.js +400 -0
  32. package/src/ops.js +293 -0
  33. package/src/outline.js +175 -0
  34. package/src/pattern.js +365 -0
  35. package/src/random.js +344 -0
  36. package/src/register.js +83 -0
  37. package/src/registry.js +52 -0
  38. package/src/samples.js +14 -0
  39. package/src/sampling.js +123 -0
  40. package/src/scope.js +77 -0
  41. package/src/signals.js +76 -0
  42. package/src/stepwise.js +150 -0
  43. package/src/structure.js +636 -0
  44. package/src/time.js +70 -0
  45. package/src/tonal.js +583 -0
  46. package/src/transforms.js +125 -0
  47. package/src/transpile.js +394 -0
  48. package/src/util.js +80 -0
  49. package/src/visuals.js +216 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Danny de Zeeuw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,47 @@
1
- # Temporary Holding Version
1
+ # RIFF — Rhythm In Functional Form
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A live-coding music engine for the browser. Patterns are functions of time.
4
+ Code written for Strudel runs in RIFF and gives the same events. MIT licensed,
5
+ zero dependencies, plain ES modules (no build step).
6
+
7
+ > Status: beta. How RIFF can be MIT while running Strudel code: [`docs/clean-room.md`](docs/clean-room.md).
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install @zeeuw/riff@beta
13
+ ```
14
+
15
+ ```js
16
+ import { initStrudel, note, s, stack } from '@zeeuw/riff';
17
+ import { check } from '@zeeuw/riff/extras'; // optional: checker, describe, editor helpers
18
+ ```
19
+
20
+ ## Package
21
+
22
+ - Published to npm as `@zeeuw/riff` (scoped, public). The package holds `src/`
23
+ (engine plus the optional `src/extras/`), the generated `data/`,
24
+ `docs/clean-room.md`, `LICENSE` and this README; specs, fixtures and tools stay
25
+ in the repository.
26
+ - How RIFF was built clean-room so it can be MIT, and the evidence:
27
+ [`docs/clean-room.md`](docs/clean-room.md) (ships in the package).
28
+ - Works from a CDN or a vendored copy as-is: `src/` is browser ES modules.
29
+ - Release: bump `version`, run `npm test` and `npm pack --dry-run`, then
30
+ `npm publish --tag beta` (the operator's step, needs the npm login).
31
+
32
+ ## Test lab
33
+
34
+ `lab/` is a static page for testing RIFF by hand, one item per public name,
35
+ grouped by feature area. It is not part of the npm package.
36
+
37
+ - **Run:** `npm run lab`, then open <http://localhost:8080/> (`PORT`, `HOST`
38
+ override). Health: `/healthz/`, `/readyz/`.
39
+ - **Deploy:** the `Dockerfile` builds the lab image (port 8080, user 65532,
40
+ read-only root with `--tmpfs /tmp`).
41
+ - **How items light up:** an item is `not implemented` until `src/index.js`
42
+ exports the name (pattern methods: `Pattern.prototype.<name>`). Then the lab
43
+ runs its example and compares cycles with the oracle fixture: `matches`,
44
+ `mismatch`, `random (statistical)` or `no fixture`. Play/Stop enable when
45
+ RIFF exports `hush` plus `initStrudel`+`evaluate`, `play` or `Pattern.prototype.play`.
46
+ - **After a merge** that adds `spec/functions/` or `corpus/functions/`:
47
+ `npm run lab:catalog` and commit `lab/catalog.json`. Areas live in `lab/areas.json`.