@marmooo/midy 0.3.5 → 0.3.7

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.
@@ -29,9 +29,10 @@ export class MidyGMLite {
29
29
  isPaused: boolean;
30
30
  isStopping: boolean;
31
31
  isSeeking: boolean;
32
+ playPromise: any;
32
33
  timeline: any[];
33
- instruments: any[];
34
34
  notePromises: any[];
35
+ instruments: Set<any>;
35
36
  exclusiveClassNotes: any[];
36
37
  drumExclusiveClassNotes: any[];
37
38
  audioContext: any;
@@ -39,16 +40,16 @@ export class MidyGMLite {
39
40
  scheduler: any;
40
41
  schedulerBuffer: any;
41
42
  voiceParamsHandlers: {
42
- modLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
43
- vibLfoToPitch: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
44
- modLfoToFilterFc: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
45
- modLfoToVolume: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
46
- chorusEffectsSend: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
47
- reverbEffectsSend: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
48
- delayModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
49
- freqModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
50
- delayVibLFO: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
51
- freqVibLFO: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
43
+ modLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
44
+ vibLfoToPitch: (_channel: any, _note: any, _scheduleTime: any) => void;
45
+ modLfoToFilterFc: (channel: any, note: any, scheduleTime: any) => void;
46
+ modLfoToVolume: (channel: any, note: any, scheduleTime: any) => void;
47
+ chorusEffectsSend: (_channel: any, _note: any, _scheduleTime: any) => void;
48
+ reverbEffectsSend: (_channel: any, _note: any, _scheduleTime: any) => void;
49
+ delayModLFO: (_channel: any, note: any, scheduleTime: any) => void;
50
+ freqModLFO: (_channel: any, note: any, scheduleTime: any) => void;
51
+ delayVibLFO: (_channel: any, _note: any, _scheduleTime: any) => void;
52
+ freqVibLFO: (_channel: any, _note: any, _scheduleTime: any) => void;
52
53
  };
53
54
  controlChangeHandlers: any[];
54
55
  channels: any[];
@@ -58,7 +59,7 @@ export class MidyGMLite {
58
59
  loadSoundFont(input: any): Promise<void>;
59
60
  loadMIDI(input: any): Promise<void>;
60
61
  cacheVoiceIds(): void;
61
- getVoiceId(channel: any, noteNumber: any, velocity: any): string | undefined;
62
+ getVoiceId(channel: any, noteNumber: any, velocity: any): any;
62
63
  createChannelAudioNodes(audioContext: any): {
63
64
  gainL: any;
64
65
  gainR: any;
@@ -69,7 +70,9 @@ export class MidyGMLite {
69
70
  createBufferSource(channel: any, voiceParams: any, audioBuffer: any): any;
70
71
  scheduleTimelineEvents(t: any, resumeTime: any, queueIndex: any): Promise<any>;
71
72
  getQueueIndex(second: any): number;
72
- playNotes(): Promise<any>;
73
+ resetAllStates(): void;
74
+ updateStates(queueIndex: any, nextQueueIndex: any): void;
75
+ playNotes(): Promise<void>;
73
76
  ticksToSecond(ticks: any, secondsPerBeat: any): number;
74
77
  secondToTicks(second: any, secondsPerBeat: any): number;
75
78
  extractMidiData(midi: any): {
@@ -80,8 +83,8 @@ export class MidyGMLite {
80
83
  stopChannelNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
81
84
  stopNotes(velocity: any, force: any, scheduleTime: any): Promise<any[]>;
82
85
  start(): Promise<void>;
83
- stop(): void;
84
- pause(): void;
86
+ stop(): Promise<void>;
87
+ pause(): Promise<void>;
85
88
  resume(): Promise<void>;
86
89
  seekTo(second: any): void;
87
90
  calcTotalTime(): number;
@@ -123,16 +126,16 @@ export class MidyGMLite {
123
126
  setDelayModLFO(note: any, scheduleTime: any): void;
124
127
  setFreqModLFO(note: any, scheduleTime: any): void;
125
128
  createVoiceParamsHandlers(): {
126
- modLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
127
- vibLfoToPitch: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
128
- modLfoToFilterFc: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
129
- modLfoToVolume: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
130
- chorusEffectsSend: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
131
- reverbEffectsSend: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
132
- delayModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
133
- freqModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
134
- delayVibLFO: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
135
- freqVibLFO: (_channel: any, _note: any, _prevValue: any, _scheduleTime: any) => void;
129
+ modLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
130
+ vibLfoToPitch: (_channel: any, _note: any, _scheduleTime: any) => void;
131
+ modLfoToFilterFc: (channel: any, note: any, scheduleTime: any) => void;
132
+ modLfoToVolume: (channel: any, note: any, scheduleTime: any) => void;
133
+ chorusEffectsSend: (_channel: any, _note: any, _scheduleTime: any) => void;
134
+ reverbEffectsSend: (_channel: any, _note: any, _scheduleTime: any) => void;
135
+ delayModLFO: (_channel: any, note: any, scheduleTime: any) => void;
136
+ freqModLFO: (_channel: any, note: any, scheduleTime: any) => void;
137
+ delayVibLFO: (_channel: any, _note: any, _scheduleTime: any) => void;
138
+ freqVibLFO: (_channel: any, _note: any, _scheduleTime: any) => void;
136
139
  };
137
140
  getControllerState(channel: any, noteNumber: any, velocity: any): Float32Array<any>;
138
141
  applyVoiceParams(channel: any, controllerType: any, scheduleTime: any): void;
@@ -158,7 +161,7 @@ export class MidyGMLite {
158
161
  handlePitchBendRangeRPN(channelNumber: any, scheduleTime: any): void;
159
162
  setPitchBendRange(channelNumber: any, value: any, scheduleTime: any): void;
160
163
  allSoundOff(channelNumber: any, _value: any, scheduleTime: any): Promise<any[]>;
161
- resetAllStates(channelNumber: any): void;
164
+ resetChannelStates(channelNumber: any): void;
162
165
  resetAllControllers(channelNumber: any, _value: any, scheduleTime: any): void;
163
166
  allNotesOff(channelNumber: any, _value: any, scheduleTime: any): Promise<any[]>;
164
167
  handleUniversalNonRealTimeExclusiveMessage(data: any, scheduleTime: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GMLite.d.ts","sourceRoot":"","sources":["../src/midy-GMLite.js"],"names":[],"mappings":"AA0GA;IA2BE;;;;;;;;;;MAUE;IAEF,+BAcC;IApDD,aAAa;IACb,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,4BAAyB;IACzB,0BAAuB;IACvB,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IACrC,+BAEE;IAeA,kBAAgC;IAChC,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D,6BAA+D;IAC/D,gBAAiD;IAMnD,4BAMC;IAED,mCASC;IAED,2DAYC;IAED,yCAmBC;IAED,oCASC;IAED,sBAoCC;IAED,6EAcC;IAED;;;;MAeC;IAED,yCAaC;IAED,kDAUC;IAED,0EAUC;IAED,+EAkDC;IAED,mCAOC;IAED,0BAiEC;IAED,uDAEC;IAED,wDAEC;IAED;;;MAgEC;IAED,kGAeC;IAED,mGAeC;IAED,wEAMC;IAED,uBAMC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,yDAQC;IAED,yEASC;IAED,2BAEC;IAED,8BAEC;IAED,8BAEC;IAED,4BAEC;IAED,wCAIC;IAED,2DAIC;IAED,+DAIC;IAED,sDAeC;IAED,qDAoBC;IAED,6CAIC;IAED,sDAsBC;IAED,kEAoBC;IAED,6FAyBC;IAED,oGAuCC;IAED,0EAiBC;IAED,8EAiBC;IAED,kGAoCC;IAED,6FASC;IAED,gCASC;IAED,iEAoBC;IAED,qGAkBC;IAED,6CAUC;IAED,qDAUC;IAED,qFASC;IAED,sFAeC;IAED,oGA2BC;IAED,mFAGC;IAED,wFAGC;IAED,sEAUC;IAED,mEAQC;IAED,wDAKC;IAED,sDAOC;IAED,mDAMC;IAED,kDAKC;IAED;;;;;;;;;;;MA2BC;IAED,oFAMC;IAED,6EAgCC;IAED,qCAeC;IAED,+FAWC;IAED,wDAUC;IAED,iFAKC;IAED,oEAKC;IAED;;;MAMC;IAED,8DAKC;IAED,4EAKC;IAED,sEAGC;IAED,2DAUC;IAED,yEAWC;IAED,kFAeC;IAED,uDAYC;IAED,gDAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAUC;IAED,gFAGC;IAED,yCAqBC;IAGD,8EAgCC;IAED,gFAGC;IAED,+EAgBC;IAED,qCAWC;IAED,4EAaC;IAED,4DAGC;IAED,sDASC;IAED,gDAYC;IAGD,6DAgBC;CACF;AAt/CD;IAWE,0FAMC;IAhBD,cAAW;IACX,gBAAe;IACf,kBAAa;IACb,gBAAW;IACX,iBAAY;IACZ,wBAAmB;IACnB,iBAAY;IACZ,mBAAc;IACd,qBAAgB;IAGd,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
1
+ {"version":3,"file":"midy-GMLite.d.ts","sourceRoot":"","sources":["../src/midy-GMLite.js"],"names":[],"mappings":"AA0GA;IA4BE;;;;;;;;;;MAUE;IAEF,+BAcC;IArDD,aAAa;IACb,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IAC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AED,oEAKC;IAED;;;MAMC;IAED,8DAKC;IAED,4EAKC;IAED,sEAGC;IAED,2DAUC;IAED,yEAWC;IAED,kFAeC;IAED,uDAYC;IAED,gDAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAUC;IAED,gFAGC;IAED,6CAqBC;IAGD,8EAgCC;IAED,gFAGC;IAED,+EAgBC;IAED,qCAWC;IAED,4EAaC;IAED,4DAGC;IAED,sDASC;IAED,gDAYC;IAGD,6DAgBC;CACF;AArhDD;IAWE,0FAMC;IAhBD,cAAW;IACX,gBAAe;IACf,kBAAa;IACb,gBAAW;IACX,iBAAY;IACZ,wBAAmB;IACnB,iBAAY;IACZ,mBAAc;IACd,qBAAgB;IAGd,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
@@ -257,13 +257,13 @@ export class MidyGMLite {
257
257
  writable: true,
258
258
  value: false
259
259
  });
260
- Object.defineProperty(this, "timeline", {
260
+ Object.defineProperty(this, "playPromise", {
261
261
  enumerable: true,
262
262
  configurable: true,
263
263
  writable: true,
264
- value: []
264
+ value: void 0
265
265
  });
266
- Object.defineProperty(this, "instruments", {
266
+ Object.defineProperty(this, "timeline", {
267
267
  enumerable: true,
268
268
  configurable: true,
269
269
  writable: true,
@@ -275,6 +275,12 @@ export class MidyGMLite {
275
275
  writable: true,
276
276
  value: []
277
277
  });
278
+ Object.defineProperty(this, "instruments", {
279
+ enumerable: true,
280
+ configurable: true,
281
+ writable: true,
282
+ value: new Set()
283
+ });
278
284
  Object.defineProperty(this, "exclusiveClassNotes", {
279
285
  enumerable: true,
280
286
  configurable: true,
@@ -401,7 +407,7 @@ export class MidyGMLite {
401
407
  const soundFont = this.soundFonts[soundFontIndex];
402
408
  const voice = soundFont.getVoice(bankNumber, channel.programNumber, noteNumber, velocity);
403
409
  const { instrument, sampleID } = voice.generators;
404
- return `${soundFontIndex}:${instrument}:${sampleID}`;
410
+ return soundFontIndex * (2 ** 32) + (instrument << 16) + sampleID;
405
411
  }
406
412
  createChannelAudioNodes(audioContext) {
407
413
  const { gainLeft, gainRight } = this.panToGain(defaultControllerState.pan.defaultValue);
@@ -491,70 +497,80 @@ export class MidyGMLite {
491
497
  }
492
498
  return 0;
493
499
  }
494
- playNotes() {
495
- return new Promise((resolve) => {
496
- this.isPlaying = true;
497
- this.isPaused = false;
498
- this.startTime = this.audioContext.currentTime;
499
- let queueIndex = this.getQueueIndex(this.resumeTime);
500
- let resumeTime = this.resumeTime - this.startTime;
500
+ resetAllStates() {
501
+ this.exclusiveClassNotes.fill(undefined);
502
+ this.drumExclusiveClassNotes.fill(undefined);
503
+ this.voiceCache.clear();
504
+ for (let i = 0; i < this.channels.length; i++) {
505
+ this.channels[i].scheduledNotes = [];
506
+ this.resetChannelStates(i);
507
+ }
508
+ }
509
+ updateStates(queueIndex, nextQueueIndex) {
510
+ if (nextQueueIndex < queueIndex)
511
+ queueIndex = 0;
512
+ for (let i = queueIndex; i < nextQueueIndex; i++) {
513
+ const event = this.timeline[i];
514
+ switch (event.type) {
515
+ case "controller":
516
+ this.setControlChange(event.channel, event.controllerType, event.value, 0);
517
+ break;
518
+ case "programChange":
519
+ this.setProgramChange(event.channel, event.programNumber, 0);
520
+ break;
521
+ case "pitchBend":
522
+ this.setPitchBend(event.channel, event.value + 8192, 0);
523
+ break;
524
+ case "sysEx":
525
+ this.handleSysEx(event.data, 0);
526
+ }
527
+ }
528
+ }
529
+ async playNotes() {
530
+ if (this.audioContext.state === "suspended") {
531
+ await this.audioContext.resume();
532
+ }
533
+ this.isPlaying = true;
534
+ this.isPaused = false;
535
+ this.startTime = this.audioContext.currentTime;
536
+ let queueIndex = this.getQueueIndex(this.resumeTime);
537
+ let resumeTime = this.resumeTime - this.startTime;
538
+ let finished = false;
539
+ this.notePromises = [];
540
+ while (queueIndex < this.timeline.length) {
541
+ const now = this.audioContext.currentTime;
542
+ const t = now + resumeTime;
543
+ queueIndex = await this.scheduleTimelineEvents(t, resumeTime, queueIndex);
544
+ if (this.isPausing) {
545
+ await this.stopNotes(0, true, now);
546
+ await this.audioContext.suspend();
547
+ this.notePromises = [];
548
+ break;
549
+ }
550
+ else if (this.isStopping) {
551
+ await this.stopNotes(0, true, now);
552
+ await this.audioContext.suspend();
553
+ finished = true;
554
+ break;
555
+ }
556
+ else if (this.isSeeking) {
557
+ await this.stopNotes(0, true, now);
558
+ this.startTime = this.audioContext.currentTime;
559
+ const nextQueueIndex = this.getQueueIndex(this.resumeTime);
560
+ this.updateStates(queueIndex, nextQueueIndex);
561
+ queueIndex = nextQueueIndex;
562
+ resumeTime = this.resumeTime - this.startTime;
563
+ this.isSeeking = false;
564
+ continue;
565
+ }
566
+ const waitTime = now + this.noteCheckInterval;
567
+ await this.scheduleTask(() => { }, waitTime);
568
+ }
569
+ if (finished) {
501
570
  this.notePromises = [];
502
- const schedulePlayback = async () => {
503
- if (queueIndex >= this.timeline.length) {
504
- await Promise.all(this.notePromises);
505
- this.notePromises = [];
506
- this.exclusiveClassNotes.fill(undefined);
507
- this.drumExclusiveClassNotes.fill(undefined);
508
- this.voiceCache.clear();
509
- for (let i = 0; i < this.channels.length; i++) {
510
- this.resetAllStates(i);
511
- }
512
- resolve();
513
- return;
514
- }
515
- const now = this.audioContext.currentTime;
516
- const t = now + resumeTime;
517
- queueIndex = await this.scheduleTimelineEvents(t, resumeTime, queueIndex);
518
- if (this.isPausing) {
519
- await this.stopNotes(0, true, now);
520
- this.notePromises = [];
521
- this.isPausing = false;
522
- this.isPaused = true;
523
- resolve();
524
- return;
525
- }
526
- else if (this.isStopping) {
527
- await this.stopNotes(0, true, now);
528
- this.notePromises = [];
529
- this.exclusiveClassNotes.fill(undefined);
530
- this.drumExclusiveClassNotes.fill(undefined);
531
- this.voiceCache.clear();
532
- for (let i = 0; i < this.channels.length; i++) {
533
- this.resetAllStates(i);
534
- }
535
- this.isStopping = false;
536
- this.isPaused = false;
537
- resolve();
538
- return;
539
- }
540
- else if (this.isSeeking) {
541
- this.stopNotes(0, true, now);
542
- this.exclusiveClassNotes.fill(undefined);
543
- this.drumExclusiveClassNotes.fill(undefined);
544
- this.startTime = this.audioContext.currentTime;
545
- queueIndex = this.getQueueIndex(this.resumeTime);
546
- resumeTime = this.resumeTime - this.startTime;
547
- this.isSeeking = false;
548
- await schedulePlayback();
549
- }
550
- else {
551
- const waitTime = now + this.noteCheckInterval;
552
- await this.scheduleTask(() => { }, waitTime);
553
- await schedulePlayback();
554
- }
555
- };
556
- schedulePlayback();
557
- });
571
+ this.resetAllStates();
572
+ }
573
+ this.isPlaying = false;
558
574
  }
559
575
  ticksToSecond(ticks, secondsPerBeat) {
560
576
  return ticks * secondsPerBeat / this.ticksPerBeat;
@@ -655,26 +671,32 @@ export class MidyGMLite {
655
671
  this.resumeTime = 0;
656
672
  if (this.voiceCounter.size === 0)
657
673
  this.cacheVoiceIds();
658
- await this.playNotes();
659
- this.isPlaying = false;
674
+ this.playPromise = this.playNotes();
675
+ await this.playPromise;
660
676
  }
661
- stop() {
677
+ async stop() {
662
678
  if (!this.isPlaying)
663
679
  return;
664
680
  this.isStopping = true;
681
+ await this.playPromise;
682
+ this.isStopping = false;
665
683
  }
666
- pause() {
684
+ async pause() {
667
685
  if (!this.isPlaying || this.isPaused)
668
686
  return;
669
687
  const now = this.audioContext.currentTime;
670
688
  this.resumeTime += now - this.startTime - this.startDelay;
671
689
  this.isPausing = true;
690
+ await this.playPromise;
691
+ this.isPausing = false;
692
+ this.isPaused = true;
672
693
  }
673
694
  async resume() {
674
695
  if (!this.isPaused)
675
696
  return;
676
- await this.playNotes();
677
- this.isPlaying = false;
697
+ this.playPromise = this.playNotes();
698
+ await this.playPromise;
699
+ this.isPaused = false;
678
700
  }
679
701
  seekTo(second) {
680
702
  this.resumeTime = second;
@@ -1055,13 +1077,17 @@ export class MidyGMLite {
1055
1077
  this.applyVoiceParams(channel, 14, scheduleTime);
1056
1078
  }
1057
1079
  setModLfoToPitch(channel, note, scheduleTime) {
1058
- const modLfoToPitch = note.voiceParams.modLfoToPitch;
1059
- const baseDepth = Math.abs(modLfoToPitch) +
1060
- channel.state.modulationDepth;
1061
- const modulationDepth = baseDepth * Math.sign(modLfoToPitch);
1062
- note.modulationDepth.gain
1063
- .cancelScheduledValues(scheduleTime)
1064
- .setValueAtTime(modulationDepth, scheduleTime);
1080
+ if (note.modulationDepth) {
1081
+ const modLfoToPitch = note.voiceParams.modLfoToPitch;
1082
+ const baseDepth = Math.abs(modLfoToPitch) + channel.state.modulationDepth;
1083
+ const modulationDepth = baseDepth * Math.sign(modLfoToPitch);
1084
+ note.modulationDepth.gain
1085
+ .cancelScheduledValues(scheduleTime)
1086
+ .setValueAtTime(modulationDepth, scheduleTime);
1087
+ }
1088
+ else {
1089
+ this.startModulation(channel, note, scheduleTime);
1090
+ }
1065
1091
  }
1066
1092
  setModLfoToFilterFc(note, scheduleTime) {
1067
1093
  const modLfoToFilterFc = note.voiceParams.modLfoToFilterFc;
@@ -1093,28 +1119,36 @@ export class MidyGMLite {
1093
1119
  }
1094
1120
  createVoiceParamsHandlers() {
1095
1121
  return {
1096
- modLfoToPitch: (channel, note, _prevValue, scheduleTime) => {
1122
+ modLfoToPitch: (channel, note, scheduleTime) => {
1097
1123
  if (0 < channel.state.modulationDepth) {
1098
1124
  this.setModLfoToPitch(channel, note, scheduleTime);
1099
1125
  }
1100
1126
  },
1101
- vibLfoToPitch: (_channel, _note, _prevValue, _scheduleTime) => { },
1102
- modLfoToFilterFc: (channel, note, _prevValue, scheduleTime) => {
1127
+ vibLfoToPitch: (_channel, _note, _scheduleTime) => { },
1128
+ modLfoToFilterFc: (channel, note, scheduleTime) => {
1103
1129
  if (0 < channel.state.modulationDepth) {
1104
1130
  this.setModLfoToFilterFc(note, scheduleTime);
1105
1131
  }
1106
1132
  },
1107
- modLfoToVolume: (channel, note, _prevValue, scheduleTime) => {
1133
+ modLfoToVolume: (channel, note, scheduleTime) => {
1108
1134
  if (0 < channel.state.modulationDepth) {
1109
1135
  this.setModLfoToVolume(note, scheduleTime);
1110
1136
  }
1111
1137
  },
1112
- chorusEffectsSend: (_channel, _note, _prevValue, _scheduleTime) => { },
1113
- reverbEffectsSend: (_channel, _note, _prevValue, _scheduleTime) => { },
1114
- delayModLFO: (_channel, note, _prevValue, scheduleTime) => this.setDelayModLFO(note, scheduleTime),
1115
- freqModLFO: (_channel, note, _prevValue, scheduleTime) => this.setFreqModLFO(note, scheduleTime),
1116
- delayVibLFO: (_channel, _note, _prevValue, _scheduleTime) => { },
1117
- freqVibLFO: (_channel, _note, _prevValue, _scheduleTime) => { },
1138
+ chorusEffectsSend: (_channel, _note, _scheduleTime) => { },
1139
+ reverbEffectsSend: (_channel, _note, _scheduleTime) => { },
1140
+ delayModLFO: (_channel, note, scheduleTime) => {
1141
+ if (0 < channel.state.modulationDepth) {
1142
+ this.setDelayModLFO(note, scheduleTime);
1143
+ }
1144
+ },
1145
+ freqModLFO: (_channel, note, scheduleTime) => {
1146
+ if (0 < channel.state.modulationDepth) {
1147
+ this.setFreqModLFO(note, scheduleTime);
1148
+ }
1149
+ },
1150
+ delayVibLFO: (_channel, _note, _scheduleTime) => { },
1151
+ freqVibLFO: (_channel, _note, _scheduleTime) => { },
1118
1152
  };
1119
1153
  }
1120
1154
  getControllerState(channel, noteNumber, velocity) {
@@ -1137,7 +1171,7 @@ export class MidyGMLite {
1137
1171
  continue;
1138
1172
  note.voiceParams[key] = value;
1139
1173
  if (key in this.voiceParamsHandlers) {
1140
- this.voiceParamsHandlers[key](channel, note, prevValue, scheduleTime);
1174
+ this.voiceParamsHandlers[key](channel, note, scheduleTime);
1141
1175
  }
1142
1176
  else {
1143
1177
  if (volumeEnvelopeKeySet.has(key))
@@ -1190,7 +1224,6 @@ export class MidyGMLite {
1190
1224
  note.modulationDepth.gain.setValueAtTime(depth, scheduleTime);
1191
1225
  }
1192
1226
  else {
1193
- this.setPitchEnvelope(note, scheduleTime);
1194
1227
  this.startModulation(channel, note, scheduleTime);
1195
1228
  }
1196
1229
  });
@@ -1295,8 +1328,8 @@ export class MidyGMLite {
1295
1328
  }
1296
1329
  handlePitchBendRangeRPN(channelNumber, scheduleTime) {
1297
1330
  const channel = this.channels[channelNumber];
1298
- this.limitData(channel, 0, 127, 0, 99);
1299
- const pitchBendRange = channel.dataMSB + channel.dataLSB / 100;
1331
+ this.limitData(channel, 0, 127, 0, 127);
1332
+ const pitchBendRange = (channel.dataMSB + channel.dataLSB / 128) * 100;
1300
1333
  this.setPitchBendRange(channelNumber, pitchBendRange, scheduleTime);
1301
1334
  }
1302
1335
  setPitchBendRange(channelNumber, value, scheduleTime) {
@@ -1304,7 +1337,7 @@ export class MidyGMLite {
1304
1337
  scheduleTime ??= this.audioContext.currentTime;
1305
1338
  const state = channel.state;
1306
1339
  const prev = state.pitchWheelSensitivity;
1307
- const next = value / 128;
1340
+ const next = value / 12800;
1308
1341
  state.pitchWheelSensitivity = next;
1309
1342
  channel.detune += (state.pitchWheel * 2 - 1) * (next - prev) * 12800;
1310
1343
  this.updateChannelDetune(channel, scheduleTime);
@@ -1314,7 +1347,7 @@ export class MidyGMLite {
1314
1347
  scheduleTime ??= this.audioContext.currentTime;
1315
1348
  return this.stopActiveNotes(channelNumber, 0, true, scheduleTime);
1316
1349
  }
1317
- resetAllStates(channelNumber) {
1350
+ resetChannelStates(channelNumber) {
1318
1351
  const scheduleTime = this.audioContext.currentTime;
1319
1352
  const channel = this.channels[channelNumber];
1320
1353
  const state = channel.state;
package/esm/midy.d.ts CHANGED
@@ -48,9 +48,10 @@ export class Midy {
48
48
  isPaused: boolean;
49
49
  isStopping: boolean;
50
50
  isSeeking: boolean;
51
+ playPromise: any;
51
52
  timeline: any[];
52
- instruments: any[];
53
53
  notePromises: any[];
54
+ instruments: Set<any>;
54
55
  exclusiveClassNotes: any[];
55
56
  drumExclusiveClassNotes: any[];
56
57
  audioContext: any;
@@ -58,16 +59,16 @@ export class Midy {
58
59
  scheduler: any;
59
60
  schedulerBuffer: any;
60
61
  voiceParamsHandlers: {
61
- modLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
62
- vibLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
63
- modLfoToFilterFc: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
64
- modLfoToVolume: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
65
- chorusEffectsSend: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
66
- reverbEffectsSend: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
67
- delayModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
68
- freqModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
69
- delayVibLFO: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
70
- freqVibLFO: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
62
+ modLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
63
+ vibLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
64
+ modLfoToFilterFc: (channel: any, note: any, scheduleTime: any) => void;
65
+ modLfoToVolume: (channel: any, note: any, scheduleTime: any) => void;
66
+ chorusEffectsSend: (channel: any, note: any, scheduleTime: any) => void;
67
+ reverbEffectsSend: (channel: any, note: any, scheduleTime: any) => void;
68
+ delayModLFO: (_channel: any, note: any, _scheduleTime: any) => void;
69
+ freqModLFO: (_channel: any, note: any, scheduleTime: any) => void;
70
+ delayVibLFO: (channel: any, note: any, _scheduleTime: any) => void;
71
+ freqVibLFO: (channel: any, note: any, scheduleTime: any) => void;
71
72
  };
72
73
  controlChangeHandlers: any[];
73
74
  channels: any[];
@@ -90,7 +91,7 @@ export class Midy {
90
91
  loadSoundFont(input: any): Promise<void>;
91
92
  loadMIDI(input: any): Promise<void>;
92
93
  cacheVoiceIds(): void;
93
- getVoiceId(channel: any, noteNumber: any, velocity: any): string | undefined;
94
+ getVoiceId(channel: any, noteNumber: any, velocity: any): any;
94
95
  createChannelAudioNodes(audioContext: any): {
95
96
  gainL: any;
96
97
  gainR: any;
@@ -103,7 +104,9 @@ export class Midy {
103
104
  createBufferSource(channel: any, noteNumber: any, voiceParams: any, audioBuffer: any): any;
104
105
  scheduleTimelineEvents(t: any, resumeTime: any, queueIndex: any): Promise<any>;
105
106
  getQueueIndex(second: any): number;
106
- playNotes(): Promise<any>;
107
+ resetAllStates(): void;
108
+ updateStates(queueIndex: any, nextQueueIndex: any): void;
109
+ playNotes(): Promise<void>;
107
110
  ticksToSecond(ticks: any, secondsPerBeat: any): number;
108
111
  secondToTicks(second: any, secondsPerBeat: any): number;
109
112
  extractMidiData(midi: any): {
@@ -114,8 +117,8 @@ export class Midy {
114
117
  stopChannelNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
115
118
  stopNotes(velocity: any, force: any, scheduleTime: any): Promise<any[]>;
116
119
  start(): Promise<void>;
117
- stop(): void;
118
- pause(): void;
120
+ stop(): Promise<void>;
121
+ pause(): Promise<void>;
119
122
  resume(): Promise<void>;
120
123
  seekTo(second: any): void;
121
124
  calcTotalTime(): number;
@@ -192,22 +195,23 @@ export class Midy {
192
195
  setVibLfoToPitch(channel: any, note: any, scheduleTime: any): void;
193
196
  setModLfoToFilterFc(channel: any, note: any, scheduleTime: any): void;
194
197
  setModLfoToVolume(channel: any, note: any, scheduleTime: any): void;
195
- setReverbEffectsSend(channel: any, note: any, prevValue: any, scheduleTime: any): void;
196
- setChorusEffectsSend(channel: any, note: any, prevValue: any, scheduleTime: any): void;
197
- setDelayModLFO(note: any, scheduleTime: any): void;
198
+ setReverbSend(channel: any, note: any, scheduleTime: any): void;
199
+ setChorusSend(channel: any, note: any, scheduleTime: any): void;
200
+ setDelayModLFO(note: any): void;
198
201
  setFreqModLFO(note: any, scheduleTime: any): void;
199
202
  setFreqVibLFO(channel: any, note: any, scheduleTime: any): void;
203
+ setDelayVibLFO(channel: any, note: any): void;
200
204
  createVoiceParamsHandlers(): {
201
- modLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
202
- vibLfoToPitch: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
203
- modLfoToFilterFc: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
204
- modLfoToVolume: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
205
- chorusEffectsSend: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
206
- reverbEffectsSend: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
207
- delayModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
208
- freqModLFO: (_channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
209
- delayVibLFO: (channel: any, note: any, prevValue: any, scheduleTime: any) => void;
210
- freqVibLFO: (channel: any, note: any, _prevValue: any, scheduleTime: any) => void;
205
+ modLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
206
+ vibLfoToPitch: (channel: any, note: any, scheduleTime: any) => void;
207
+ modLfoToFilterFc: (channel: any, note: any, scheduleTime: any) => void;
208
+ modLfoToVolume: (channel: any, note: any, scheduleTime: any) => void;
209
+ chorusEffectsSend: (channel: any, note: any, scheduleTime: any) => void;
210
+ reverbEffectsSend: (channel: any, note: any, scheduleTime: any) => void;
211
+ delayModLFO: (_channel: any, note: any, _scheduleTime: any) => void;
212
+ freqModLFO: (_channel: any, note: any, scheduleTime: any) => void;
213
+ delayVibLFO: (channel: any, note: any, _scheduleTime: any) => void;
214
+ freqVibLFO: (channel: any, note: any, scheduleTime: any) => void;
211
215
  };
212
216
  getControllerState(channel: any, noteNumber: any, velocity: any, polyphonicKeyPressure: any): Float32Array<any>;
213
217
  applyVoiceParams(channel: any, controllerType: any, scheduleTime: any): void;
@@ -228,13 +232,14 @@ export class Midy {
228
232
  setBankLSB(channelNumber: any, lsb: any): void;
229
233
  dataEntryLSB(channelNumber: any, value: any, scheduleTime: any): void;
230
234
  updateChannelVolume(channel: any, scheduleTime: any): void;
231
- updateKeyBasedVolume(channel: any, scheduleTime: any): void;
235
+ updateKeyBasedVolume(channel: any, keyNumber: any, scheduleTime: any): void;
232
236
  setSustainPedal(channelNumber: any, value: any, scheduleTime: any): void;
233
237
  setPortamento(channelNumber: any, value: any, scheduleTime: any): void;
234
238
  setSostenutoPedal(channelNumber: any, value: any, scheduleTime: any): void;
235
239
  getSoftPedalFactor(channel: any, note: any): number;
236
240
  setSoftPedal(channelNumber: any, softPedal: any, scheduleTime: any): void;
237
- setFilterResonance(channelNumber: any, filterResonance: any, scheduleTime: any): void;
241
+ setFilterResonance(channelNumber: any, ccValue: any, scheduleTime: any): void;
242
+ getRelativeKeyBasedValue(channel: any, note: any, controllerType: any): any;
238
243
  setReleaseTime(channelNumber: any, releaseTime: any, scheduleTime: any): void;
239
244
  setAttackTime(channelNumber: any, attackTime: any, scheduleTime: any): void;
240
245
  setBrightness(channelNumber: any, brightness: any, scheduleTime: any): void;
@@ -259,9 +264,9 @@ export class Midy {
259
264
  handleCoarseTuningRPN(channelNumber: any, scheduleTime: any): void;
260
265
  setCoarseTuning(channelNumber: any, value: any, scheduleTime: any): void;
261
266
  handleModulationDepthRangeRPN(channelNumber: any, scheduleTime: any): void;
262
- setModulationDepthRange(channelNumber: any, modulationDepthRange: any, scheduleTime: any): void;
267
+ setModulationDepthRange(channelNumber: any, value: any, scheduleTime: any): void;
263
268
  allSoundOff(channelNumber: any, _value: any, scheduleTime: any): Promise<any[]>;
264
- resetAllStates(channelNumber: any): void;
269
+ resetChannelStates(channelNumber: any): void;
265
270
  resetAllControllers(channelNumber: any, _value: any, scheduleTime: any): void;
266
271
  allNotesOff(channelNumber: any, _value: any, scheduleTime: any): Promise<any[]>;
267
272
  omniOff(channelNumber: any, value: any, scheduleTime: any): void;
@@ -305,11 +310,11 @@ export class Midy {
305
310
  getLFOPitchDepth(channel: any, note: any): number;
306
311
  getLFOFilterDepth(channel: any, note: any): number;
307
312
  getLFOAmplitudeDepth(channel: any, note: any): number;
308
- setControllerParameters(channel: any, note: any, table: any, scheduleTime: any): void;
309
- handlePressureSysEx(data: any, tableName: any): void;
313
+ setEffects(channel: any, note: any, table: any, scheduleTime: any): void;
314
+ handlePressureSysEx(data: any, tableName: any, scheduleTime: any): void;
310
315
  initControlTable(): Int8Array<ArrayBuffer>;
311
- applyControlTable(channel: any, controllerType: any, scheduleTime: any): void;
312
- handleControlChangeSysEx(data: any): void;
316
+ setControlChangeEffects(channel: any, controllerType: any, scheduleTime: any): void;
317
+ handleControlChangeSysEx(data: any, scheduleTime: any): void;
313
318
  getKeyBasedValue(channel: any, keyNumber: any, controllerType: any): any;
314
319
  handleKeyBasedInstrumentControlSysEx(data: any, scheduleTime: any): void;
315
320
  handleSysEx(data: any, scheduleTime: any): void;
@@ -328,8 +333,8 @@ declare class Note {
328
333
  modulationDepth: any;
329
334
  vibratoLFO: any;
330
335
  vibratoDepth: any;
331
- reverbEffectsSend: any;
332
- chorusEffectsSend: any;
336
+ reverbSend: any;
337
+ chorusSend: any;
333
338
  portamentoNoteNumber: number;
334
339
  pressure: number;
335
340
  noteNumber: any;
package/esm/midy.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"midy.d.ts","sourceRoot":"","sources":["../src/midy.js"],"names":[],"mappings":"AA4JA;IAyCE;;;;;;;;;;;;;;;MAeE;IAEF,+BAkBC;IA3ED,aAAa;IACb,yBAAqB;IACrB,2BAAuB;IACvB;;;;MAIE;IACF;;;;;;MAME;IACF,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,4BAAyB;IACzB,0BAAuB;IACvB,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IACrC,+BAEE;IAoBA,kBAAgC;IAChC,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA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AED,qCAqCC;IAED,+FAYC;IAED,+CAEC;IAED,wDAUC;IAED,iFAMC;IAED,wDAkBC;IAED,oFAMC;IAED,oEAMC;IAED;;;MAMC;IAED,8DAMC;IAED,4EAKC;IAED,+CAEC;IAED,sEAGC;IAED,2DAUC;IAED,4DAwBC;IAED,yEAYC;IAED,uEAMC;IAED,2EAcC;IAED,oDAEC;IAED,0EAeC;IAED,sFAUC;IAED,8EAKC;IAED,4EASC;IAED,4EAaC;IAED,0EAQC;IAED,8EASC;IAED,gFAeC;IAED,gFAUC;IAED,sFA4BC;IAED,sFA4BC;IAED,kFAeC;IAED,2DAMC;IAED,mEAyBC;IAGD,2DAGC;IAGD,2DAGC;IAED,gDAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAWC;IAED,iEAKC;IAED,uEASC;IAED,mEAKC;IAED,yEASC;IAED,2EASC;IAED,gGAMC;IAED,gFAGC;IAED,yCAwBC;IAGD,8EAqCC;IAED,gFAGC;IAED,iEAEC;IAED,gEAEC;IAED,gEAIC;IAED,gEAIC;IAED,+EAuCC;IAED,qCAcC;IAED,qCAcC;IAED,4EA6DC;IAED,4DAGC;IAED,sDASC;IAED,gEAGC;IAED,yDAWC;IAED,kEAGC;IAED,2DAWC;IAED,sEAeC;IAED,4CAOC;IAED,+BAIC;IAED,qDAiBC;IAED,gCAGC;IAED,kCAEC;IA6BD,4CAEC;IAED,+DAaC;IAED,kDAiBC;IAED,2GAKC;IAED,sDAIC;IAED,qCAEC;IAED,uDAMC;IAED,sCAEC;IAED,uDASC;IAED,sCAEC;IAED,2DAqBC;IAED,0CAEC;IAED,mCAeC;IAED,2FAgBC;IAED,2FAoBC;IAED,iDAMC;IAED,wDAUC;IAED,qDAUC;IAED,kDAUC;IAED,mDAUC;IAED,sDAUC;IAED,sFAgBC;IAED,qDAUC;IAED,2CAIC;IAED,8EAOC;IAED,0CAWC;IAED,yEAIC;IAED,yEAiBC;IAED,gDAYC;IAGD,6DAgBC;CACF;AAxoGD;IAiBE,0FAMC;IAtBD,cAAW;IACX,gBAAe;IACf,kBAAa;IACb,gBAAW;IACX,iBAAY;IACZ,wBAAmB;IACnB,iBAAY;IACZ,mBAAc;IACd,qBAAgB;IAChB,gBAAW;IACX,kBAAa;IACb,uBAAkB;IAClB,uBAAkB;IAClB,6BAA0B;IAC1B,iBAAa;IAGX,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
1
+ {"version":3,"file":"midy.d.ts","sourceRoot":"","sources":["../src/midy.js"],"names":[],"mappings":"AA4JA;IA0CE;;;;;;;;;;;;;;;MAeE;IAEF,+BAkBC;IA5ED,aAAa;IACb,yBAAqB;IACrB,2BAAuB;IACvB;;;;MAIE;IACF;;;;;;MAME;IACF,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,4BAAyB;IACzB,0BAAuB;IACvB,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,iBAAY;IACZ,gBAAc;IACd,oBAAkB;IAClB,sBAAwB;IACxB,2BAAqC;IACrC,+BAEE;IAoBA,kBAAgC;IAChC,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D,6BAA+D;IAC/D,gBAAiD;IACjD;;;kBAAyD;IACzD;;;;;;;;MAAyD;IAQ3D,4BAMC;IAED,mCASC;IAED,2DAYC;IAED,yCAmBC;IAED,oCASC;IAED,sBAoCC;IAED,8DAcC;IAED;;;;MAeC;IAED,sCAMC;IAED,yCAqBC;IAED,kDAUC;IAED,mDAIC;IAED,2FAWC;IAED,+EA6DC;IAED,mCAOC;IAED,uBAQC;IAED,yDA2BC;IAED,2BA+CC;IAED,uDAEC;IAED,wDAEC;IAED;;;MAoGC;IAED,kGAeC;IAED,mGAeC;IAED,wEAMC;IAED,uBAMC;IAED,sBAKC;IAED,uBAQC;IAED,wBAKC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,yDAQC;IAED,yEASC;IAED,kFAuBC;IAED;;;;MASC;IAED,gFAUC;IAED,mFAYC;IAED,sGAcC;IAID;;;MA8BC;IAED;;;kBA6BC;IAED;;;;;;;;MA0CC;IAED,2BAEC;IAED,8BAEC;IAED,8BAEC;IAED,4BAEC;IAED,qCAkBC;IAED,6CAEC;IAED,2DAIC;IAED,+DAiBC;IAED,mDAIC;IAED,2CAoDC;IAED,8EAYC;IAED,oEAkBC;IAED,+DAKC;IAED,qDAoBC;IAED,6CAIC;IAED,8EAqBC;IAED,oEAyBC;IAED,kEAoBC;IAED,+DAcC;IAED,6FAyBC;IAED,oGAmEC;IAED,4BAYC;IAED,0EAiBC;IAED,8EAoBC;IAED,kGAiDC;IAED,6FASC;IAED,gCAmBC;IAED,iEAqBC;IAED,qGAuBC;IAED,6CAUC;IAED,qDAUC;IAED,qFASC;IAED,sFAeC;IAED,wFAkBC;IAED,oGAoCC;IAED,sGAeC;IAED,mFAeC;IAED,4EAgBC;IAED,wFAGC;IAED,sEAWC;IAED,mEAYC;IAED,mEAaC;IAED,sEAMC;IAED,oEAQC;IAED,gEAyBC;IAED,gEAyBC;IAED,gCAKC;IAED,kDAKC;IAED,gEAMC;IAED,8CAOC;IAED;;;;;;;;;;;MAiDC;IAED,gHAQC;IAED,6EAgCC;IAED,qCAqCC;IAED,+FAYC;IAED,+CAEC;IAED,wDASC;IAED,iFAMC;IAED,wDAkBC;IAED,oFAMC;IAED,oEAWC;IAED;;;MAMC;IAED,8DAWC;IAED,4EAKC;IAED,+CAEC;IAED,sEAGC;IAED,2DAUC;IAED,4EAoBC;IAED,yEAYC;IAED,uEAMC;IAED,2EAcC;IAED,oDAEC;IAED,0EAeC;IAED,8EAWC;IAED,4EAUC;IAED,8EAKC;IAED,4EAUC;IAED,4EAaC;IAED,0E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