@kidlib/web-audio 0.1.3 → 0.1.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/dist/index.d.ts CHANGED
@@ -667,7 +667,7 @@ declare class MacroParam {
667
667
  protected sendMessage(type: string, data: any): void;
668
668
  dispose(): void;
669
669
  connect(target: AudioParam, nodeType: NodeType, scaleFactor?: number): this;
670
- disconnect(target?: AudioParam | TODO): void;
670
+ disconnect(target?: AudioParam): void;
671
671
  }
672
672
 
673
673
  declare interface Message {
@@ -815,7 +815,7 @@ declare const ROOT_NOTES: {
815
815
  };
816
816
 
817
817
  export declare interface SampleLoader {
818
- loadSample(...args: TODO[]): Promise<TODO>;
818
+ loadSample(buffer: AudioBuffer | ArrayBuffer): Promise<AudioBuffer | null>;
819
819
  }
820
820
 
821
821
  export declare class SamplePlayer implements ILibInstrumentNode {
@@ -916,7 +916,7 @@ export declare class SamplePlayer implements ILibInstrumentNode {
916
916
  setLoopPoint(loopPoint: "start" | "end", loopStartSeconds: number, loopEndSeconds: number, rampDuration?: number): this;
917
917
  scrollLoopPoints(loopStart: number, loopEnd: number): this;
918
918
  setParam(name: string, value: number): this;
919
- applyParams(params: SamplerParamPatch): this;
919
+ applyParams(params: SamplerParams): this;
920
920
  /** PARAM GETTERS */
921
921
  getAudioParam(name: string): AudioParam | null;
922
922
  getStartPoint(): number;
@@ -988,7 +988,10 @@ export declare interface SamplerParamDescriptor {
988
988
 
989
989
  export declare type SamplerParamKey = keyof typeof samplerParams;
990
990
 
991
- export declare type SamplerParamPatch = Partial<SamplerParamValues>;
991
+ /** @deprecated Renamed to {@link SamplerParams}. Removed in the next minor. */
992
+ export declare type SamplerParamPatch = SamplerParams;
993
+
994
+ export declare type SamplerParams = Partial<SamplerParamValues>;
992
995
 
993
996
  export declare const samplerParams: Record<"distortion" | "delayTime" | "feedback" | "feedbackDecay" | "drive" | "loopEnd" | "loopStart" | "volume" | "dryWet" | "glide" | "tempo" | "lowpassFilter" | "highpassFilter" | "feedbackPitch" | "feedbackLpf" | "clipping" | "amMod" | "reverbSend" | "reverbSize" | "delaySend" | "delayFeedback" | "gainLFORate" | "gainLFODepth" | "pitchLFORate" | "pitchLFODepth" | "trimStart" | "trimEnd" | "loopDuration" | "loopRampDuration" | "loopDurationDrift" | "keytrackLoop", SamplerParamDescriptor>;
994
997
 
package/dist/index.js CHANGED
@@ -1035,15 +1035,12 @@ async function Je(e, t, n = {}) {
1035
1035
  }
1036
1036
  }
1037
1037
  if (o?.enabled && (f = c(e, f, o.maxAmplitudePeak)), s?.enabled) {
1038
- let t = Ke(f);
1039
- if (t.shouldCompress) {
1040
- let n = s.threshold !== void 0 || s.ratio !== void 0 || s.makeupGain !== void 0, r;
1041
- r = n && s.threshold !== void 0 ? {
1042
- threshold: s.threshold ?? .5,
1043
- ratio: s.ratio ?? 2,
1044
- makeupGain: s.makeupGain ?? 1
1045
- } : t.suggestedSettings, f = Ge(e, f, r.threshold, r.ratio, r.makeupGain);
1046
- }
1038
+ let t = s.threshold !== void 0 || s.ratio !== void 0 || s.makeupGain !== void 0 ? {
1039
+ threshold: s.threshold ?? .5,
1040
+ ratio: s.ratio ?? 2,
1041
+ makeupGain: s.makeupGain ?? 1
1042
+ } : Ke(f).suggestedSettings;
1043
+ t && (f = Ge(e, f, t.threshold, t.ratio, t.makeupGain));
1047
1044
  }
1048
1045
  if (d?.detectPitch || d?.autotune || i && "auto" in i && i.auto) {
1049
1046
  let e = await Xe(f), t = d?.targetMidiNote || 60, n = Ze(e.midiFloat, t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kidlib/web-audio",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "High-level Web Audio primitives for musical instruments and tools.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,38 +29,38 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "scripts": {
33
- "build:worklets": "vp node build-processors.js",
34
- "build": "vp run clean && vp build",
35
- "prepack": "vp run build",
36
- "watch:processors": "vp node watch-processors.js",
37
- "watch": "concurrently \"vp test watch\" \"vp build --watch\" \"vp run watch:processors\"",
38
- "clean": "rimraf dist",
39
- "test": "vp test run",
40
- "test:browser": "vp test run --config vitest.browser.config.ts",
41
- "test:coverage": "vp test run --coverage",
42
- "test:watch": "vp test",
43
- "test:all": "vp run test && vp run test:browser",
44
- "prepare": "vp config"
45
- },
46
32
  "dependencies": {
47
- "webmidi": "^3.1.13"
33
+ "webmidi": "^3.1.16"
48
34
  },
49
35
  "devDependencies": {
36
+ "@changesets/cli": "3.0.1",
50
37
  "@types/audioworklet": "^0.0.72",
51
38
  "@types/node": "^24.13.3",
52
- "@types/webmidi": "^2.1.0",
53
- "@vitest/browser-playwright": "catalog:",
54
- "@vitest/coverage-v8": "catalog:",
39
+ "@vitest/browser-playwright": "4.1.10",
40
+ "@vitest/coverage-v8": "4.1.10",
55
41
  "concurrently": "^9.1.2",
56
42
  "jsdom": "^26.0.0",
57
43
  "playwright": "^1.53.2",
58
44
  "rimraf": "^5.0.1",
59
45
  "typescript": "5.8.3",
60
- "vite": "catalog:",
46
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.2.9",
61
47
  "vite-plugin-dts": "^4.5.3",
62
- "vite-plus": "catalog:",
63
- "vitest": "catalog:"
48
+ "vite-plus": "0.2.9",
49
+ "vitest": "4.1.10"
64
50
  },
65
- "packageManager": "pnpm@11.5.2"
66
- }
51
+ "scripts": {
52
+ "changeset": "vp exec changeset",
53
+ "bump": "vp exec changeset version",
54
+ "release": "vp check && vp run test:all && vp exec changeset publish",
55
+ "build:worklets": "vp node build-processors.js",
56
+ "build": "vp run clean && vp build",
57
+ "watch:processors": "vp node watch-processors.js",
58
+ "watch": "concurrently \"vp test watch\" \"vp build --watch\" \"vp run watch:processors\"",
59
+ "clean": "rimraf dist",
60
+ "test": "vp test run",
61
+ "test:browser": "vp test run --config vitest.browser.config.ts",
62
+ "test:coverage": "vp test run --coverage",
63
+ "test:watch": "vp test",
64
+ "test:all": "vp run test && vp run test:browser"
65
+ }
66
+ }