@hraness/dawg 0.2.0 → 0.4.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/CHANGELOG.md +201 -0
- package/DAWG.md +762 -11
- package/README.md +79 -30
- package/core/chords.ts +1724 -0
- package/core/diff.ts +261 -0
- package/core/euclid.ts +670 -0
- package/core/fx.ts +1065 -0
- package/core/key.ts +43 -0
- package/core/kits.ts +320 -0
- package/core/params.ts +111 -0
- package/core/pitch.ts +60 -0
- package/core/rhythm.ts +287 -0
- package/core/score.ts +1054 -14
- package/core/sdk/eval-child.ts +125 -0
- package/core/sdk/eval.ts +260 -0
- package/core/sdk/print.ts +675 -0
- package/core/sdk/sync-chords.ts +54 -0
- package/core/sdk/v1.ts +4159 -0
- package/core/slug.ts +19 -0
- package/core/synth.ts +1001 -0
- package/package.json +8 -5
- package/src/agent/agent.ts +317 -16
- package/src/agent/brief.ts +50 -5
- package/src/agent/chord-tools.ts +357 -0
- package/src/agent/drum-tools.ts +135 -0
- package/src/agent/gateway.ts +215 -41
- package/src/agent/models.ts +633 -0
- package/src/agent/ops.ts +3 -18
- package/src/agent/pack-tools.ts +369 -0
- package/src/agent/planner.ts +55 -2
- package/src/agent/preview-tool.ts +270 -0
- package/src/agent/provider.ts +234 -106
- package/src/agent/rhythm-tools.ts +145 -0
- package/src/agent/sse.ts +31 -7
- package/src/agent/tools.ts +705 -14
- package/src/agent/usage.ts +296 -0
- package/src/agent/workspace.ts +683 -0
- package/src/agent/xcb-agent.ts +35 -14
- package/src/agent/xcb.ts +233 -21
- package/src/audio/audition.ts +93 -0
- package/src/audio/cache.ts +160 -0
- package/src/audio/click.ts +125 -0
- package/src/audio/effects/bus.ts +147 -0
- package/src/audio/effects/chain.ts +99 -0
- package/src/audio/effects/common.ts +251 -0
- package/src/audio/effects/convolution.ts +301 -0
- package/src/audio/effects/drive.ts +142 -0
- package/src/audio/effects/duck.ts +122 -0
- package/src/audio/effects/dynamics.ts +121 -0
- package/src/audio/effects/filter.ts +319 -0
- package/src/audio/effects/modulation.ts +174 -0
- package/src/audio/effects/space.ts +337 -0
- package/src/audio/engine.ts +430 -33
- package/src/audio/kits.ts +200 -0
- package/src/audio/live.ts +152 -0
- package/src/audio/packs.ts +1787 -0
- package/src/audio/player.ts +19 -4
- package/src/audio/preview.ts +470 -0
- package/src/audio/random.ts +15 -0
- package/src/audio/render-worker.ts +68 -0
- package/src/audio/renderer.ts +174 -0
- package/src/audio/sampler.ts +420 -0
- package/src/audio/samples.ts +1025 -0
- package/src/audio/synth/oscillators.ts +268 -0
- package/src/audio/synth/voice.ts +555 -0
- package/src/audio/synth/zzfx.ts +137 -0
- package/src/audio/wav.ts +550 -334
- package/src/audio/wavetable-maker.ts +717 -0
- package/src/audio/wavetable.ts +624 -0
- package/src/auth/cli.ts +146 -27
- package/src/auth/credentials.ts +167 -41
- package/src/auth/discover.ts +481 -0
- package/src/auth/login.ts +885 -128
- package/src/auth/openrouter.ts +206 -0
- package/src/auth/picker.ts +282 -0
- package/src/auth/runner.ts +25 -2
- package/src/auth/tui.ts +60 -43
- package/src/commands/drums.ts +299 -0
- package/src/commands/edit.ts +192 -0
- package/src/commands/fx.ts +360 -0
- package/src/commands/help.ts +535 -0
- package/src/commands/history.ts +32 -19
- package/src/commands/music.ts +34 -15
- package/src/commands/pack.ts +423 -0
- package/src/commands/rhythm.ts +230 -0
- package/src/commands/sample.ts +462 -0
- package/src/commands/synth.ts +229 -0
- package/src/commands/wavetable.ts +370 -0
- package/src/main.ts +2136 -170
- package/src/media/analyze.ts +364 -0
- package/src/media/backend.ts +253 -0
- package/src/media/cli.ts +186 -0
- package/src/media/download.ts +281 -0
- package/src/media/dsp.ts +281 -0
- package/src/media/import.ts +130 -0
- package/src/media/lyrics.ts +201 -0
- package/src/media/notes.ts +363 -0
- package/src/media/paths.ts +168 -0
- package/src/media/process.ts +226 -0
- package/src/media/registry.ts +9 -0
- package/src/media/sidecar.ts +72 -0
- package/src/media/stemdeck.ts +254 -0
- package/src/media/stems.ts +173 -0
- package/src/media/tools.ts +397 -0
- package/src/media/types.ts +92 -0
- package/src/media/vendor/basic-pitch.ts +261 -0
- package/src/media/vendor/drums.ts +817 -0
- package/src/media/vendor/grid.ts +203 -0
- package/src/media/vendor/util.ts +139 -0
- package/src/media/vendor/wav.ts +233 -0
- package/src/media/wavetable.ts +202 -0
- package/src/project/check.ts +80 -0
- package/src/project/init.ts +253 -0
- package/src/project/sync.ts +432 -0
- package/src/project/typecheck.ts +149 -0
- package/src/render.ts +49 -6
- package/src/session/attach.ts +3 -4
- package/src/session/daemon.ts +25 -8
- package/src/session/delta.ts +249 -0
- package/src/session/naming.ts +6 -38
- package/src/session/port.ts +26 -6
- package/src/session/rebase.ts +38 -8
- package/src/session/store.ts +116 -21
- package/src/tui/audition.ts +501 -0
- package/src/tui/euclid.ts +472 -0
- package/src/tui/menu.ts +2125 -0
- package/src/tui/play-chords.ts +538 -0
- package/src/tui/play-mode.ts +442 -0
- package/src/tui/play-session.ts +984 -0
- package/src/tui/sketch.ts +108 -0
- package/src/web/fetch.ts +340 -0
- package/src/web/http.ts +137 -0
- package/src/web/search.ts +684 -0
- package/tui/activity.ts +42 -3
- package/tui/app.ts +398 -33
- package/tui/drums.ts +44 -0
- package/tui/grammar.ts +281 -0
- package/tui/highway.ts +24 -2
- package/tui/layers.ts +14 -2
- package/tui/play-strip.ts +188 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SDK is one vendored file with no imports, so `core/sdk/v1.ts` carries
|
|
3
|
+
* a copy of the chord engine (`core/chords.ts`) between two marker lines.
|
|
4
|
+
* This keeps the copy exact: `bun core/sdk/sync-chords.ts` rewrites it and
|
|
5
|
+
* `sync-chords.test.ts` fails when it is stale.
|
|
6
|
+
*
|
|
7
|
+
* The copy is the module body from its first section rule up to
|
|
8
|
+
* `CHORD_PROCESS` (agent prose the SDK does not need), with `export`
|
|
9
|
+
* dropped so the engine stays private to the SDK.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { format } from "prettier";
|
|
15
|
+
|
|
16
|
+
export const BEGIN_MARKER =
|
|
17
|
+
"// BEGIN chord engine: generated from core/chords.ts by core/sdk/sync-chords.ts";
|
|
18
|
+
export const END_MARKER = "// END chord engine";
|
|
19
|
+
|
|
20
|
+
const ROOT = join(import.meta.dir, "..", "..");
|
|
21
|
+
export const CHORDS_PATH = join(ROOT, "core", "chords.ts");
|
|
22
|
+
export const SDK_PATH = join(ROOT, "core", "sdk", "v1.ts");
|
|
23
|
+
|
|
24
|
+
/** The engine block (markers included) for a `core/chords.ts` source. */
|
|
25
|
+
export function chordBlock(source: string): string {
|
|
26
|
+
const start = source.indexOf("// ----");
|
|
27
|
+
const end = source.indexOf("/** How dawg builds chords");
|
|
28
|
+
if (start < 0 || end < 0) throw new Error("core/chords.ts layout changed");
|
|
29
|
+
const body = source
|
|
30
|
+
.slice(start, end)
|
|
31
|
+
.replace(/^export /gm, "")
|
|
32
|
+
.trimEnd();
|
|
33
|
+
return `${BEGIN_MARKER}\n${body}\n${END_MARKER}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** `sdk` with its engine block replaced, formatted like the repo. */
|
|
37
|
+
export async function syncedSdk(sdk: string, chords: string): Promise<string> {
|
|
38
|
+
const from = sdk.indexOf(BEGIN_MARKER);
|
|
39
|
+
const to = sdk.indexOf(END_MARKER);
|
|
40
|
+
if (from < 0 || to < 0) throw new Error("v1.ts has no chord engine markers");
|
|
41
|
+
const next =
|
|
42
|
+
sdk.slice(0, from) + chordBlock(chords) + sdk.slice(to + END_MARKER.length);
|
|
43
|
+
return format(next, { parser: "typescript", filepath: SDK_PATH });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (import.meta.main) {
|
|
47
|
+
const [sdk, chords] = await Promise.all([
|
|
48
|
+
readFile(SDK_PATH, "utf8"),
|
|
49
|
+
readFile(CHORDS_PATH, "utf8"),
|
|
50
|
+
]);
|
|
51
|
+
const next = await syncedSdk(sdk, chords);
|
|
52
|
+
if (next !== sdk) await writeFile(SDK_PATH, next);
|
|
53
|
+
console.log(next === sdk ? "v1.ts chord engine up to date" : "v1.ts updated");
|
|
54
|
+
}
|