@toneflix/studio 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +52 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Toneflix
|
|
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,87 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Toneflix Studio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**The studio engine for the web.** Give any web app a real multitrack editor. Your users arrange, cut and shape audio as freely as in a desktop DAW, right in the browser.
|
|
6
|
+
|
|
7
|
+
- **Edit without limits.** Split anything, drag clips anywhere, layer them and move them between tracks. Nothing snaps back unless you ask it to.
|
|
8
|
+
- **Fast with big sessions.** Waveforms are drawn in the background and cached on the device, so long recordings open instantly the next time.
|
|
9
|
+
- **Fits any stack.** No framework and no dependencies. Restyle it with CSS variables and drop in your own track controls.
|
|
10
|
+
- **Open by design.** MIT licensed. Project exchange with the desktop DAWs musicians already use is on the roadmap.
|
|
11
|
+
|
|
12
|
+
Read the docs and try the playground at **[toneflix.github.io/studio](https://toneflix.github.io/studio/)**.
|
|
13
|
+
|
|
14
|
+
> Status: early. This release has the timeline and waveforms. Playback and recording come next.
|
|
15
|
+
|
|
16
|
+
## Use
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { StudioTimeline, Waveforms, makeClip, uid } from '@toneflix/studio';
|
|
20
|
+
|
|
21
|
+
const timeline = new StudioTimeline(document.getElementById('editor')!, {
|
|
22
|
+
grid: { bpm: 120, meter: [4, 4], snap: 'beat' },
|
|
23
|
+
createTrack: () => ({ id: uid('t'), name: 'New stem' }),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
timeline.load({
|
|
27
|
+
tracks: [{ id: 'vox', name: 'Vocals' }],
|
|
28
|
+
clips: [makeClip({ track: 'vox', source: 'vox.wav', start: 0, offset: 0, duration: 12 })],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Peaks are worked out in a worker and kept in Cache Storage, so a stem is analysed once per device
|
|
32
|
+
const waveforms = new Waveforms();
|
|
33
|
+
const peaks = await waveforms.get('vox.wav:v1', () => audioContext.decodeAudioData(bytes));
|
|
34
|
+
timeline.setSource({ id: 'vox.wav', duration: 12 }, peaks);
|
|
35
|
+
|
|
36
|
+
timeline.on('change', ({ state, final }) => final && save(state));
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Editing
|
|
40
|
+
|
|
41
|
+
| Gesture | What it does |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Drag a clip | Moves it in time and to other lanes; past or over other clips. Below the last lane makes a new one (with `createTrack`) |
|
|
44
|
+
| Drag a clip edge | Trims it, up to the ends of its audio |
|
|
45
|
+
| Drag a corner handle | Fade in or out |
|
|
46
|
+
| Click, Shift or Ctrl/Cmd click | Select, add to or toggle the selection |
|
|
47
|
+
| Drag on an empty lane or the ruler | Selects a time range; with Shift, selects the clips inside it |
|
|
48
|
+
| Alt while dragging | Turns snapping off |
|
|
49
|
+
| Ctrl/Cmd + wheel | Zoom around the pointer |
|
|
50
|
+
| S, Delete, Ctrl+D, Ctrl+A | Split at the playhead, delete, duplicate, select all |
|
|
51
|
+
| Arrows | Nudge by the snap step, or move up and down a lane |
|
|
52
|
+
| Ctrl+Z, Ctrl+Shift+Z | Undo and redo |
|
|
53
|
+
|
|
54
|
+
Where clips overlap on a lane, the one that starts later is on top and is the one heard. `audibleRanges(clips)` gives the heard part of each clip, for players and mix renderers.
|
|
55
|
+
|
|
56
|
+
## Packages
|
|
57
|
+
|
|
58
|
+
Install `@toneflix/studio` for everything, or only the parts your app uses. Every package is released with the same version.
|
|
59
|
+
|
|
60
|
+
| Package | What it gives you |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| [`@toneflix/studio`](packages/studio) | Everything below, from one import |
|
|
63
|
+
| [`@toneflix/studio-core`](packages/core) | Tracks, clips, pure edits (`splitClips`, `moveClips`, `trimStart`, `setFades`…), snapping, `TimelineModel` and `History`. No DOM or audio, so it also runs on servers and in tests |
|
|
64
|
+
| [`@toneflix/studio-waveforms`](packages/waveforms) | `Waveforms`, `PeaksWorker`, `PeaksCache` and `drawWaveform`: peaks off the main thread, cached on the device |
|
|
65
|
+
| [`@toneflix/studio-timeline`](packages/timeline) | `StudioTimeline`, the editor view. Restyle it with the `--tfs-*` CSS variables or fill track headers with `renderHeader` |
|
|
66
|
+
|
|
67
|
+
Playback and recording will arrive as their own packages.
|
|
68
|
+
|
|
69
|
+
## Develop
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
pnpm install
|
|
73
|
+
pnpm test # node --test, no browser needed
|
|
74
|
+
pnpm demo # the demo page with made-up audio
|
|
75
|
+
pnpm docs:dev # the docs site with a live playground
|
|
76
|
+
pnpm build # each package's dist/ with type declarations
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Release
|
|
80
|
+
|
|
81
|
+
Publish a GitHub release tagged with the version, like `v0.2.0`. The Publish workflow takes the version from the tag, runs the checks, publishes every package to npm and saves the version in each `package.json` on the default branch. A release marked as a pre-release goes out under the `next` tag.
|
|
82
|
+
|
|
83
|
+
To publish without a release, run the Publish workflow from the Actions tab with a version and a dist-tag.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toneflix/studio",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The studio engine for the web: multitrack audio editing that feels like a desktop DAW, in any browser app. Includes every Toneflix Studio package.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Toneflix <code@toneflix.com.ng>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/toneflix/studio.git",
|
|
10
|
+
"directory": "packages/studio"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://toneflix.github.io/studio/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/toneflix/studio/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"daw",
|
|
18
|
+
"audio",
|
|
19
|
+
"waveform",
|
|
20
|
+
"timeline",
|
|
21
|
+
"web-audio",
|
|
22
|
+
"music"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"@toneflix/source": "./src/index.ts",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@toneflix/studio-core": "^0.2.0",
|
|
42
|
+
"@toneflix/studio-waveforms": "^0.2.0",
|
|
43
|
+
"@toneflix/studio-timeline": "^0.2.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22.18"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public",
|
|
50
|
+
"provenance": true
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -p tsconfig.build.json"
|
|
54
|
+
}
|
|
6
55
|
}
|