@effetune/dsp 0.1.0 → 0.5.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/dist/index.d.ts CHANGED
@@ -16,10 +16,15 @@ export type {
16
16
  DelayOptions,
17
17
  TimeAlignmentOptions,
18
18
  AMRadioSimulatorOptions,
19
+ AutoFilterOptions,
19
20
  AutoLevelerOptions,
21
+ AutoPanOptions,
20
22
  BandPassFilterOptions,
21
23
  BitCrusherOptions,
24
+ BluetoothSBCSimulatorOptions,
22
25
  BrickwallLimiterOptions,
26
+ CassetteArtifactsOptions,
27
+ ChorusOptions,
23
28
  CombFilterOptions,
24
29
  CommonEffectOptions,
25
30
  CompressorOptions,
@@ -38,11 +43,14 @@ export type {
38
43
  ExpanderOptions,
39
44
  FDNReverbOptions,
40
45
  FMRadioSimulatorOptions,
46
+ FrequencyShifterOptions,
41
47
  FifteenBandGEQOptions,
42
48
  FifteenBandPEQOptions,
43
49
  FiveBandDynamicEQOptions,
44
50
  FiveBandFIRPEQOptions,
45
51
  FiveBandPEQOptions,
52
+ G726ADPCMSimulatorOptions,
53
+ GSMFullRateSimulatorOptions,
46
54
  GateOptions,
47
55
  GroupDelayEQOptions,
48
56
  HardClippingOptions,
@@ -55,6 +63,7 @@ export type {
55
63
  IRReverbOptions,
56
64
  LoPassFilterOptions,
57
65
  LoudnessEqualizerOptions,
66
+ MP3CodecSimulatorOptions,
58
67
  MSMatrixOptions,
59
68
  ModalResonatorOptions,
60
69
  MultibandBalanceOptions,
@@ -65,8 +74,11 @@ export type {
65
74
  NarrowRangeOptions,
66
75
  NoiseBlenderOptions,
67
76
  OscillatorOptions,
77
+ PhaserOptions,
78
+ PhaseSelectEQOptions,
68
79
  PitchShifterOptions,
69
80
  PowerAmpSagOptions,
81
+ RotarySpeakerOptions,
70
82
  RSReverbOptions,
71
83
  RoomEQOptions,
72
84
  SaturationOptions,
@@ -74,10 +86,12 @@ export type {
74
86
  StereoBlendOptions,
75
87
  SubSynthOptions,
76
88
  SWRadioSimulatorOptions,
89
+ TapeArtifactsOptions,
77
90
  TiltEQOptions,
78
91
  ToneControlOptions,
79
92
  TransientShaperOptions,
80
93
  TremoloOptions,
94
+ TubeSimulatorOptions,
81
95
  VinylArtifactsOptions,
82
96
  VinylSimulatorOptions,
83
97
  WowFlutterOptions
@@ -100,10 +114,15 @@ export {
100
114
  Delay,
101
115
  TimeAlignment,
102
116
  AMRadioSimulator,
117
+ AutoFilter,
103
118
  AutoLeveler,
119
+ AutoPan,
104
120
  BandPassFilter,
105
121
  BitCrusher,
122
+ BluetoothSBCSimulator,
106
123
  BrickwallLimiter,
124
+ CassetteArtifacts,
125
+ Chorus,
107
126
  CombFilter,
108
127
  Compressor,
109
128
  CrossfeedFilter,
@@ -120,11 +139,14 @@ export {
120
139
  Expander,
121
140
  FDNReverb,
122
141
  FMRadioSimulator,
142
+ FrequencyShifter,
123
143
  FifteenBandGEQ,
124
144
  FifteenBandPEQ,
125
145
  FiveBandDynamicEQ,
126
146
  FiveBandFIRPEQ,
127
147
  FiveBandPEQ,
148
+ G726ADPCMSimulator,
149
+ GSMFullRateSimulator,
128
150
  Gate,
129
151
  GroupDelayEQ,
130
152
  HardClipping,
@@ -136,6 +158,7 @@ export {
136
158
  IRReverb,
137
159
  LoPassFilter,
138
160
  LoudnessEqualizer,
161
+ MP3CodecSimulator,
139
162
  MSMatrix,
140
163
  ModalResonator,
141
164
  MultibandBalance,
@@ -146,8 +169,11 @@ export {
146
169
  NarrowRange,
147
170
  NoiseBlender,
148
171
  Oscillator,
172
+ Phaser,
173
+ PhaseSelectEQ,
149
174
  PitchShifter,
150
175
  PowerAmpSag,
176
+ RotarySpeaker,
151
177
  RSReverb,
152
178
  RoomEQ,
153
179
  Saturation,
@@ -155,10 +181,12 @@ export {
155
181
  StereoBlend,
156
182
  SubSynth,
157
183
  SWRadioSimulator,
184
+ TapeArtifacts,
158
185
  TiltEQ,
159
186
  ToneControl,
160
187
  TransientShaper,
161
188
  Tremolo,
189
+ TubeSimulator,
162
190
  VinylArtifacts,
163
191
  VinylSimulator,
164
192
  WowFlutter,
@@ -179,10 +207,15 @@ export {
179
207
  createDelay,
180
208
  createTimeAlignment,
181
209
  createAMRadioSimulator,
210
+ createAutoFilter,
182
211
  createAutoLeveler,
212
+ createAutoPan,
183
213
  createBandPassFilter,
184
214
  createBitCrusher,
215
+ createBluetoothSBCSimulator,
185
216
  createBrickwallLimiter,
217
+ createCassetteArtifacts,
218
+ createChorus,
186
219
  createCombFilter,
187
220
  createCompressor,
188
221
  createCrossfeedFilter,
@@ -197,11 +230,14 @@ export {
197
230
  createExpander,
198
231
  createFDNReverb,
199
232
  createFMRadioSimulator,
233
+ createFrequencyShifter,
200
234
  createFifteenBandGEQ,
201
235
  createFifteenBandPEQ,
202
236
  createFiveBandDynamicEQ,
203
237
  createFiveBandFIRPEQ,
204
238
  createFiveBandPEQ,
239
+ createG726ADPCMSimulator,
240
+ createGSMFullRateSimulator,
205
241
  createGate,
206
242
  createGroupDelayEQ,
207
243
  createHardClipping,
@@ -213,6 +249,7 @@ export {
213
249
  createIRReverb,
214
250
  createLoPassFilter,
215
251
  createLoudnessEqualizer,
252
+ createMP3CodecSimulator,
216
253
  createMSMatrix,
217
254
  createModalResonator,
218
255
  createMultibandBalance,
@@ -223,8 +260,11 @@ export {
223
260
  createNarrowRange,
224
261
  createNoiseBlender,
225
262
  createOscillator,
263
+ createPhaser,
264
+ createPhaseSelectEQ,
226
265
  createPitchShifter,
227
266
  createPowerAmpSag,
267
+ createRotarySpeaker,
228
268
  createRSReverb,
229
269
  createRoomEQ,
230
270
  createSaturation,
@@ -232,10 +272,12 @@ export {
232
272
  createStereoBlend,
233
273
  createSubSynth,
234
274
  createSWRadioSimulator,
275
+ createTapeArtifacts,
235
276
  createTiltEQ,
236
277
  createToneControl,
237
278
  createTransientShaper,
238
279
  createTremolo,
280
+ createTubeSimulator,
239
281
  createVinylArtifacts,
240
282
  createVinylSimulator,
241
283
  createWowFlutter
@@ -246,7 +288,12 @@ export type { EffectDefinition } from './effect.js';
246
288
  import type { Effect } from './effect.js';
247
289
  import type { EffectChannel, EffectType } from './generated-effects.js';
248
290
 
249
- export declare class EffeTuneError extends Error {}
291
+ export declare class EffeTuneError extends Error {
292
+ readonly code?: string;
293
+ readonly path?: string;
294
+ readonly nodeId?: string;
295
+ readonly edgeId?: string;
296
+ }
250
297
  export declare class ValidationError extends EffeTuneError {}
251
298
  export declare class EffectError extends EffeTuneError {}
252
299
  export declare class AssetError extends EffeTuneError {}
@@ -498,6 +545,226 @@ export declare function createChain(
498
545
  options?: CreateChainOptions
499
546
  ): Promise<Chain>;
500
547
 
548
+ export interface GraphEndpoint {
549
+ readonly id: string;
550
+ }
551
+
552
+ export interface GraphNode extends ChainEffect {}
553
+
554
+ export interface GraphNodeInput extends ChainEffectInput {
555
+ readonly id: string;
556
+ }
557
+
558
+ export interface GraphEdge {
559
+ readonly id: string;
560
+ readonly source: string;
561
+ readonly destination: string;
562
+ readonly gain: number;
563
+ readonly mute: boolean;
564
+ readonly pan?: number;
565
+ readonly mixGroup: string;
566
+ readonly solo: boolean;
567
+ }
568
+
569
+ export interface GraphEdgeInput {
570
+ readonly id: string;
571
+ readonly source: string;
572
+ readonly destination: string;
573
+ readonly gain?: number;
574
+ readonly mute?: boolean;
575
+ readonly pan?: number;
576
+ readonly mixGroup?: string;
577
+ readonly solo?: boolean;
578
+ }
579
+
580
+ export interface GraphDocument {
581
+ readonly version: 1;
582
+ readonly input: GraphEndpoint;
583
+ readonly output: GraphEndpoint;
584
+ readonly nodes: readonly GraphNode[];
585
+ readonly edges: readonly GraphEdge[];
586
+ }
587
+
588
+ export interface GraphDocumentInput {
589
+ readonly version: 1;
590
+ readonly input: GraphEndpoint;
591
+ readonly output: GraphEndpoint;
592
+ readonly nodes: readonly GraphNodeInput[];
593
+ readonly edges: readonly GraphEdgeInput[];
594
+ }
595
+
596
+ export interface GraphCompileSnapshot {
597
+ readonly version: 1;
598
+ readonly identity: boolean;
599
+ readonly silence: boolean;
600
+ readonly effectiveSchedule: readonly string[];
601
+ readonly nodes: readonly GraphCompileNodeSnapshot[];
602
+ readonly edges: readonly GraphCompileEdgeSnapshot[];
603
+ readonly outputLatency: readonly number[];
604
+ readonly outputCompensation: readonly number[];
605
+ readonly latencySamples: number;
606
+ readonly capacity: Readonly<{ bufferSlots: number; workspaceBytes: number }>;
607
+ }
608
+
609
+ export interface GraphCompileNodeSnapshot {
610
+ readonly id: string;
611
+ readonly effective: boolean;
612
+ readonly dormant: boolean;
613
+ readonly enabled: boolean;
614
+ readonly disabledBypass: boolean;
615
+ readonly scheduleIndex: number | null;
616
+ readonly bufferSlot: number | null;
617
+ readonly processingGroup: Readonly<{ firstChannel: number; channelCount: number }>;
618
+ readonly kernelLatency: number;
619
+ readonly inputLatency: readonly number[];
620
+ readonly outputLatency: readonly number[];
621
+ readonly preNodeCompensation: readonly number[];
622
+ }
623
+
624
+ export interface GraphCompileEdgeSnapshot {
625
+ readonly id: string;
626
+ readonly active: boolean;
627
+ readonly suppressed: boolean;
628
+ readonly dormant: boolean;
629
+ readonly fanInCompensation: readonly number[];
630
+ }
631
+
632
+ export type GraphVisualizationState =
633
+ | 'structural'
634
+ | 'effective'
635
+ | 'dormant'
636
+ | 'disabled-bypass'
637
+ | 'suppressed';
638
+
639
+ export interface GraphVisualizationEndpoint {
640
+ readonly id: string;
641
+ readonly kind: 'input' | 'output';
642
+ }
643
+
644
+ export interface GraphVisualizationEffectNode {
645
+ readonly id: string;
646
+ readonly kind: 'effect';
647
+ readonly effectType: EffectType;
648
+ readonly enabled: boolean;
649
+ readonly effective?: boolean;
650
+ readonly dormant?: boolean;
651
+ readonly disabledBypass?: boolean;
652
+ readonly state: GraphVisualizationState;
653
+ }
654
+
655
+ export interface GraphVisualizationEdge {
656
+ readonly id: string;
657
+ readonly source: string;
658
+ readonly destination: string;
659
+ readonly active?: boolean;
660
+ readonly suppressed?: boolean;
661
+ readonly dormant?: boolean;
662
+ readonly state: GraphVisualizationState;
663
+ }
664
+
665
+ export interface GraphVisualizationSnapshot {
666
+ readonly version: 1;
667
+ readonly nodes: readonly (GraphVisualizationEndpoint | GraphVisualizationEffectNode)[];
668
+ readonly edges: readonly GraphVisualizationEdge[];
669
+ }
670
+
671
+ export interface GraphStructuralSnapshot {
672
+ readonly document: GraphDocument;
673
+ readonly topologicalOrder: readonly string[];
674
+ readonly incoming: Readonly<Record<string, readonly string[]>>;
675
+ readonly outgoing: Readonly<Record<string, readonly string[]>>;
676
+ }
677
+
678
+ export interface CreateGraphOptions extends ArtifactOptions {
679
+ readonly assetResolver?: AssetResolver | { resolve: AssetResolver };
680
+ }
681
+
682
+ export interface GraphProcessOptions {
683
+ readonly sampleRate: number;
684
+ readonly seed?: number;
685
+ readonly blockSize?: number;
686
+ }
687
+
688
+ export interface GraphStreamOptions extends GraphProcessOptions {
689
+ readonly channels?: number;
690
+ }
691
+
692
+ export interface GraphRecipeOptions {
693
+ readonly nodeId?: string;
694
+ readonly inputId?: string;
695
+ readonly outputId?: string;
696
+ }
697
+
698
+ export interface WetDryGraphOptions extends GraphRecipeOptions {
699
+ readonly wet?: number;
700
+ readonly dry?: number;
701
+ }
702
+
703
+ export interface SendReturnGraphOptions extends GraphRecipeOptions {
704
+ readonly send?: number;
705
+ readonly returnGain?: number;
706
+ }
707
+
708
+ export declare class Graph {
709
+ private constructor();
710
+ static load(input: string | GraphDocumentInput, options?: CreateGraphOptions): Promise<Graph>;
711
+ static fromChain(
712
+ chain: Chain | ChainDocumentInput | readonly (Effect | ChainEffectInput)[],
713
+ options?: CreateGraphOptions
714
+ ): Promise<Graph>;
715
+ static wetDry(effect: Effect | ChainEffectInput, options?: WetDryGraphOptions): GraphDocument;
716
+ static sendReturn(effect: Effect | ChainEffectInput, options?: SendReturnGraphOptions): GraphDocument;
717
+ readonly nodes: readonly GraphNode[];
718
+ readonly edges: readonly GraphEdge[];
719
+ toJSON(): GraphDocument;
720
+ toChain(): ChainDocument;
721
+ serialize(space?: number): string;
722
+ getNode(id: string): GraphNode | null;
723
+ getEdge(id: string): GraphEdge | null;
724
+ incoming(id: string): readonly GraphEdge[];
725
+ outgoing(id: string): readonly GraphEdge[];
726
+ structuralSnapshot(): GraphStructuralSnapshot;
727
+ visualizationSnapshot(): GraphVisualizationSnapshot;
728
+ stream(options: GraphStreamOptions): Promise<GraphStream>;
729
+ latencySamples(options: LatencyOptions): Promise<number>;
730
+ process(audio: readonly Float32Array[], options: GraphProcessOptions): Promise<Float32Array[]>;
731
+ close(): void;
732
+ }
733
+
734
+ export declare class GraphStream {
735
+ readonly graph: GraphDocument;
736
+ readonly latencySamples: number;
737
+ readonly compileSnapshot: GraphCompileSnapshot;
738
+ visualizationSnapshot(): GraphVisualizationSnapshot;
739
+ setParam(nodeId: string, parameterName: string, value: unknown): this;
740
+ reset(): this;
741
+ process(audio: readonly Float32Array[]): Promise<Float32Array[]>;
742
+ close(): void;
743
+ }
744
+
745
+ export declare function createGraph(
746
+ input: string | GraphDocumentInput,
747
+ options?: CreateGraphOptions
748
+ ): Promise<Graph>;
749
+
750
+ export declare function normalizeGraphDocument(
751
+ input: string | GraphDocumentInput
752
+ ): GraphDocument;
753
+ export declare function graphDocumentFromChain(
754
+ input: ChainDocumentInput | readonly (Effect | ChainEffectInput)[]
755
+ ): GraphDocument;
756
+ export declare function chainDocumentFromGraph(
757
+ input: GraphDocumentInput
758
+ ): ChainDocument;
759
+ export declare function createWetDryGraphDocument(
760
+ effect: Effect | ChainEffectInput,
761
+ options?: WetDryGraphOptions
762
+ ): GraphDocument;
763
+ export declare function createSendReturnGraphDocument(
764
+ effect: Effect | ChainEffectInput,
765
+ options?: SendReturnGraphOptions
766
+ ): GraphDocument;
767
+
501
768
  export declare function parsePreset(
502
769
  input: string | ChainDocumentInput | readonly (Effect | ChainEffectInput)[]
503
770
  ): ChainDocument;
package/dist/index.js CHANGED
@@ -25,10 +25,15 @@ export {
25
25
  Delay,
26
26
  TimeAlignment,
27
27
  AMRadioSimulator,
28
+ AutoFilter,
28
29
  AutoLeveler,
30
+ AutoPan,
29
31
  BitCrusher,
32
+ BluetoothSBCSimulator,
30
33
  BrickwallLimiter,
31
34
  BandPassFilter,
35
+ CassetteArtifacts,
36
+ Chorus,
32
37
  CombFilter,
33
38
  Compressor,
34
39
  CrossfeedFilter,
@@ -45,11 +50,14 @@ export {
45
50
  Expander,
46
51
  FDNReverb,
47
52
  FMRadioSimulator,
53
+ FrequencyShifter,
48
54
  FifteenBandGEQ,
49
55
  FifteenBandPEQ,
50
56
  FiveBandDynamicEQ,
51
57
  FiveBandFIRPEQ,
52
58
  FiveBandPEQ,
59
+ G726ADPCMSimulator,
60
+ GSMFullRateSimulator,
53
61
  Gate,
54
62
  GroupDelayEQ,
55
63
  HardClipping,
@@ -61,6 +69,7 @@ export {
61
69
  IRReverb,
62
70
  LoPassFilter,
63
71
  LoudnessEqualizer,
72
+ MP3CodecSimulator,
64
73
  MSMatrix,
65
74
  ModalResonator,
66
75
  MultibandBalance,
@@ -71,8 +80,11 @@ export {
71
80
  NarrowRange,
72
81
  NoiseBlender,
73
82
  Oscillator,
83
+ Phaser,
84
+ PhaseSelectEQ,
74
85
  PitchShifter,
75
86
  PowerAmpSag,
87
+ RotarySpeaker,
76
88
  RSReverb,
77
89
  RoomEQ,
78
90
  Saturation,
@@ -80,10 +92,12 @@ export {
80
92
  StereoBlend,
81
93
  SubSynth,
82
94
  SWRadioSimulator,
95
+ TapeArtifacts,
83
96
  TiltEQ,
84
97
  ToneControl,
85
98
  TransientShaper,
86
99
  Tremolo,
100
+ TubeSimulator,
87
101
  VinylArtifacts,
88
102
  VinylSimulator,
89
103
  WowFlutter,
@@ -104,10 +118,15 @@ export {
104
118
  createDelay,
105
119
  createTimeAlignment,
106
120
  createAMRadioSimulator,
121
+ createAutoFilter,
107
122
  createAutoLeveler,
123
+ createAutoPan,
108
124
  createBandPassFilter,
109
125
  createBitCrusher,
126
+ createBluetoothSBCSimulator,
110
127
  createBrickwallLimiter,
128
+ createCassetteArtifacts,
129
+ createChorus,
111
130
  createCombFilter,
112
131
  createCompressor,
113
132
  createCrossfeedFilter,
@@ -122,11 +141,14 @@ export {
122
141
  createExpander,
123
142
  createFDNReverb,
124
143
  createFMRadioSimulator,
144
+ createFrequencyShifter,
125
145
  createFifteenBandGEQ,
126
146
  createFifteenBandPEQ,
127
147
  createFiveBandDynamicEQ,
128
148
  createFiveBandFIRPEQ,
129
149
  createFiveBandPEQ,
150
+ createG726ADPCMSimulator,
151
+ createGSMFullRateSimulator,
130
152
  createGate,
131
153
  createGroupDelayEQ,
132
154
  createHardClipping,
@@ -138,6 +160,7 @@ export {
138
160
  createIRReverb,
139
161
  createLoPassFilter,
140
162
  createLoudnessEqualizer,
163
+ createMP3CodecSimulator,
141
164
  createMSMatrix,
142
165
  createModalResonator,
143
166
  createMultibandBalance,
@@ -148,8 +171,11 @@ export {
148
171
  createNarrowRange,
149
172
  createNoiseBlender,
150
173
  createOscillator,
174
+ createPhaser,
175
+ createPhaseSelectEQ,
151
176
  createPitchShifter,
152
177
  createPowerAmpSag,
178
+ createRotarySpeaker,
153
179
  createRSReverb,
154
180
  createRoomEQ,
155
181
  createSaturation,
@@ -157,10 +183,12 @@ export {
157
183
  createStereoBlend,
158
184
  createSubSynth,
159
185
  createSWRadioSimulator,
186
+ createTapeArtifacts,
160
187
  createTiltEQ,
161
188
  createToneControl,
162
189
  createTransientShaper,
163
190
  createTremolo,
191
+ createTubeSimulator,
164
192
  createVinylArtifacts,
165
193
  createVinylSimulator,
166
194
  createWowFlutter
@@ -168,6 +196,14 @@ export {
168
196
  export { getEffectCatalog } from './catalog.js';
169
197
  export { encodeEta1 } from './assets.js';
170
198
  export { Chain, createChain, isBundleDocument } from './runtime.js';
199
+ export { Graph, GraphStream, createGraph } from './graph.js';
200
+ export {
201
+ chainDocumentFromGraph,
202
+ createSendReturnGraphDocument,
203
+ createWetDryGraphDocument,
204
+ graphDocumentFromChain,
205
+ normalizeGraphDocument
206
+ } from './graph-document.js';
171
207
  export { importLegacyPreset, parsePreset } from './preset.js';
172
208
 
173
209
  import { getEffectCatalog } from './catalog.js';