@marmooo/midy 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -9,7 +9,8 @@ This library provides several files depending on the implementation level.
9
9
  [en](https://amei.or.jp/midistandardcommittee/Recommended_Practice/e/gml-v1.pdf),
10
10
  [ja](https://amei.or.jp/midistandardcommittee/Recommended_Practice/General_MIDI_Lite_v1.0_japanese.pdf))
11
11
  - midy-GM1.js: support minimal GM1 (ref:
12
- [en](https://archive.org/details/complete_midi_96-1-3/page/n1/mode/2up),
12
+ [en](https://midi.org/midi-1-0-detailed-specification),
13
+ [en full](https://archive.org/details/complete_midi_96-1-3/page/n1/mode/2up),
13
14
  [ja](https://amei.or.jp/midistandardcommittee/MIDI1.0.pdf))
14
15
  - midy-GM2.js: support minimal GM2 (ref:
15
16
  [en v1.2a](https://amei.or.jp/midistandardcommittee/Recommended_Practice/e/GM2-v12a.pdf),
package/esm/midy-GM1.d.ts CHANGED
@@ -87,6 +87,7 @@ export class MidyGM1 {
87
87
  instruments: Set<any>;
88
88
  timeline: any[];
89
89
  };
90
+ stopActiveNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
90
91
  stopChannelNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
91
92
  stopNotes(velocity: any, force: any, scheduleTime: any): Promise<any[]>;
92
93
  start(): Promise<void>;
@@ -116,8 +117,9 @@ export class MidyGM1 {
116
117
  handleExclusiveClass(note: any, channelNumber: any, startTime: any): void;
117
118
  scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any): Promise<void>;
118
119
  noteOn(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<void>;
119
- disconnectNote(note: any, scheduledNotes: any, index: any): void;
120
- stopNote(endTime: any, stopTime: any, scheduledNotes: any, index: any): Promise<any>;
120
+ disconnectNote(note: any): void;
121
+ stopNote(endTime: any, stopTime: any, noteList: any, index: any): Promise<any>;
122
+ findNoteOffTarget(noteList: any): any[] | undefined;
121
123
  scheduleNoteOff(channelNumber: any, noteNumber: any, _velocity: any, endTime: any, force: any): Promise<any> | undefined;
122
124
  noteOff(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<any> | undefined;
123
125
  releaseSustainPedal(channelNumber: any, halfVelocity: any, scheduleTime: any): (Promise<any> | undefined)[];
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM1.d.ts","sourceRoot":"","sources":["../src/midy-GM1.js"],"names":[],"mappings":"AAiJA;IAwBE;;;;;;;;;;;MAWE;IAEF,+BAcC;IAlDD,aAAa;IACb,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,kCAA+B;IAC/B,gCAA6B;IAC7B,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IAgBnC,kBAAgC;IAChC,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IAMnD,4BAMC;IAED,mCAWC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAaC;IAED,6DA2BC;IAED,4DASC;IAED,2EAsDC;IAED,mCAOC;IAED,0BAoDC;IAED,uDAEC;IAED,wDAEC;IAED,6EAEC;IAED;;;MA4EC;IAED,mGAgBC;IAED,wEAMC;IAED,uBAKC;IAED,aAMC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,yDAQC;IAED,2DASC;IAED,qDAQC;IAED,2BAEC;IAED,8BAEC;IAED,8BAEC;IAED,4BAEC;IAED,qCAMC;IAED,2DAIC;IAED,+DAIC;IAED,sDAeC;IAED,qDAoBC;IAED,6CAIC;IAED,sDAsBC;IAED,kEAoBC;IAED,+GA0BC;IAED,gHAwCC;IAED,0EAiBC;IAED,kGAqCC;IAED,6FAQC;IAED,iEAUC;IAED,qFAgBC;IAED,yHAuBC;IAED,yGASC;IAED,4GAeC;IAED,mGA2BC;IAED,sFAGC;IAED,wFAGC;IAED,sEAUC;IAED,mEAQC;IAED,wDAKC;IAED,sDAOC;IAED,mDAMC;IAED,kDAKC;IAED;;;;;;;;;;;MA2BC;IAED,oFAMC;IAED,6EA2CC;IAED;;;;;;;;;;;;;MAeC;IAED,kGAWC;IAED,wDAUC;IAED,iFAKC;IAED,oEAKC;IAED;;;MAMC;IAED,8DAKC;IAED,4EAKC;IAED,sEAGC;IAED,2DAUC;IAED,yEAWC;IAED,kFAeC;IAED,2DAMC;IAED,uDAkBC;IAED,gDAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAUC;IAED,iEAKC;IAED,uEAQC;IAED,mEAKC;IAED,yEAQC;IAED,gFAGC;IAED,yCAUC;IAGD,8CAqBC;IAED,gFAGC;IAED,+EAgBC;IAED,qCAWC;IAED,4EAaC;IAED,4DAGC;IAED,sDASC;IAED,gDAYC;IAGD,6DAgBC;CACF;AA99CD;IACE,uBAGC;IAFC,YAA2B;IAC3B,qBAAuB;IAGzB,gCAKC;IAED,mBAEC;IAED,0BAUC;IAED,uBAEC;IAED,mBAEC;IAED,cAMC;IASD,6BAKC;IAZD,qDAKC;CAQF;AAED;IASE,0FAMC;IAdD,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-GM1.d.ts","sourceRoot":"","sources":["../src/midy-GM1.js"],"names":[],"mappings":"AAiJA;IAwBE;;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FAMC;IAED,6EA2CC;IAED;;;;;;;;;;;;;MAeC;IAED,kGAWC;IAED,wDAUC;IAED,iFAKC;IAED,oEAKC;IAED;;;MAMC;IAED,8DAKC;IAED,4EAKC;IAED,sEAGC;IAED,2DAUC;IAED,yEAWC;IAED,kFAeC;IAED,2DAMC;IAED,uDAkBC;IAED,gDAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAUC;IAED,iEAKC;IAED,uEAQC;IAED,mEAKC;IAED,yEAQC;IAED,gFAGC;IAED,yCAUC;IAGD,8CAqBC;IAED,gFAGC;IAED,+EAgBC;IAED,qCAWC;IAED,4EAaC;IAED,4DAGC;IAED,sDASC;IAED,gDAYC;IAGD,6DAgBC;CACF;AA3/CD;IACE,uBAGC;IAFC,YAA2B;IAC3B,qBAAuB;IAGzB,gCAKC;IAED,mBAEC;IAED,0BAUC;IAED,uBAEC;IAED,mBAEC;IAED,cAMC;IASD,6BAKC;IAZD,qDAKC;CAQF;AAED;IASE,0FAMC;IAdD,kBAAa;IACb,gBAAW;IACX,iBAAY;IACZ,wBAAmB;IACnB,iBAAY;IACZ,mBAAc;IACd,qBAAgB;IAGd,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
package/esm/midy-GM1.js CHANGED
@@ -427,7 +427,7 @@ export class MidyGM1 {
427
427
  const startTime = event.startTime + this.startDelay - offset;
428
428
  switch (event.type) {
429
429
  case "noteOn":
430
- if (event.velocity !== 0) {
430
+ if (0 < event.velocity) {
431
431
  await this.scheduleNoteOn(event.channel, event.noteNumber, event.velocity, startTime);
432
432
  break;
433
433
  }
@@ -475,7 +475,7 @@ export class MidyGM1 {
475
475
  if (queueIndex >= this.timeline.length) {
476
476
  await Promise.all(this.notePromises);
477
477
  this.notePromises = [];
478
- this.exclusiveClassNotes.flll(undefined);
478
+ this.exclusiveClassNotes.fill(undefined);
479
479
  this.audioBufferCache.clear();
480
480
  resolve();
481
481
  return;
@@ -594,6 +594,17 @@ export class MidyGM1 {
594
594
  }
595
595
  return { instruments, timeline };
596
596
  }
597
+ stopActiveNotes(channelNumber, velocity, force, scheduleTime) {
598
+ const channel = this.channels[channelNumber];
599
+ const promises = [];
600
+ const activeNotes = this.getActiveNotes(channel, scheduleTime);
601
+ activeNotes.forEach((note) => {
602
+ const promise = this.scheduleNoteOff(channelNumber, note.noteNumber, velocity, scheduleTime, force, undefined);
603
+ this.notePromises.push(promise);
604
+ promises.push(promise);
605
+ });
606
+ return Promise.all(promises);
607
+ }
597
608
  stopChannelNotes(channelNumber, velocity, force, scheduleTime) {
598
609
  const channel = this.channels[channelNumber];
599
610
  const promises = [];
@@ -665,6 +676,8 @@ export class MidyGM1 {
665
676
  const note = noteList[i];
666
677
  if (!note)
667
678
  continue;
679
+ if (note.ending)
680
+ continue;
668
681
  callback(note);
669
682
  }
670
683
  });
@@ -877,21 +890,21 @@ export class MidyGM1 {
877
890
  channel.sustainNotes.push(note);
878
891
  }
879
892
  this.handleExclusiveClass(note, channelNumber, startTime);
880
- let notes = scheduledNotes.get(noteNumber);
881
- if (notes) {
882
- notes.push(note);
893
+ const scheduledNotes = channel.scheduledNotes;
894
+ let noteList = scheduledNotes.get(noteNumber);
895
+ if (noteList) {
896
+ noteList.push(note);
883
897
  }
884
898
  else {
885
- notes = [note];
886
- scheduledNotes.set(noteNumber, notes);
899
+ noteList = [note];
900
+ scheduledNotes.set(noteNumber, noteList);
887
901
  }
888
902
  }
889
903
  noteOn(channelNumber, noteNumber, velocity, scheduleTime) {
890
904
  scheduleTime ??= this.audioContext.currentTime;
891
905
  return this.scheduleNoteOn(channelNumber, noteNumber, velocity, scheduleTime);
892
906
  }
893
- disconnectNote(note, scheduledNotes, index) {
894
- scheduledNotes[index] = null;
907
+ disconnectNote(note) {
895
908
  note.bufferSource.disconnect();
896
909
  note.filterNode.disconnect();
897
910
  note.volumeEnvelopeNode.disconnect();
@@ -901,8 +914,8 @@ export class MidyGM1 {
901
914
  note.modulationLFO.stop();
902
915
  }
903
916
  }
904
- stopNote(endTime, stopTime, scheduledNotes, index) {
905
- const note = scheduledNotes[index];
917
+ stopNote(endTime, stopTime, noteList, index) {
918
+ const note = noteList[index];
906
919
  note.volumeEnvelopeNode.gain
907
920
  .cancelScheduledValues(endTime)
908
921
  .linearRampToValueAtTime(0, stopTime);
@@ -912,33 +925,43 @@ export class MidyGM1 {
912
925
  }, stopTime);
913
926
  return new Promise((resolve) => {
914
927
  note.bufferSource.onended = () => {
915
- this.disconnectNote(note, scheduledNotes, index);
928
+ noteList[index] = undefined;
929
+ this.disconnectNote(note);
916
930
  resolve();
917
931
  };
918
932
  note.bufferSource.stop(stopTime);
919
933
  });
920
934
  }
935
+ findNoteOffTarget(noteList) {
936
+ for (let i = 0; i < noteList.length; i++) {
937
+ const note = noteList[i];
938
+ if (!note)
939
+ continue;
940
+ if (note.ending)
941
+ continue;
942
+ return [note, i];
943
+ }
944
+ }
921
945
  scheduleNoteOff(channelNumber, noteNumber, _velocity, endTime, force) {
922
946
  const channel = this.channels[channelNumber];
923
947
  if (!force && 0.5 <= channel.state.sustainPedal)
924
948
  return;
925
949
  if (!channel.scheduledNotes.has(noteNumber))
926
950
  return;
927
- const scheduledNotes = channel.scheduledNotes.get(noteNumber);
928
- for (let i = 0; i < scheduledNotes.length; i++) {
929
- const note = scheduledNotes[i];
930
- if (!note)
931
- continue;
932
- if (note.ending)
933
- continue;
934
- const volRelease = endTime + note.voiceParams.volRelease;
935
- const modRelease = endTime + note.voiceParams.modRelease;
936
- note.filterNode.frequency
937
- .cancelScheduledValues(endTime)
938
- .linearRampToValueAtTime(0, modRelease);
939
- const stopTime = Math.min(volRelease, modRelease);
940
- return this.stopNote(endTime, stopTime, scheduledNotes, i);
941
- }
951
+ const noteList = channel.scheduledNotes.get(noteNumber);
952
+ if (!noteList)
953
+ return; // be careful with drum channel
954
+ const noteOffTarget = this.findNoteOffTarget(noteList, endTime);
955
+ if (!noteOffTarget)
956
+ return;
957
+ const [note, i] = noteOffTarget;
958
+ const volRelease = endTime + note.voiceParams.volRelease;
959
+ const modRelease = endTime + note.voiceParams.modRelease;
960
+ note.filterNode.frequency
961
+ .cancelScheduledValues(endTime)
962
+ .linearRampToValueAtTime(0, modRelease);
963
+ const stopTime = Math.min(volRelease, modRelease);
964
+ return this.stopNote(endTime, stopTime, noteList, i);
942
965
  }
943
966
  noteOff(channelNumber, noteNumber, velocity, scheduleTime) {
944
967
  scheduleTime ??= this.audioContext.currentTime;
@@ -1304,7 +1327,7 @@ export class MidyGM1 {
1304
1327
  }
1305
1328
  allSoundOff(channelNumber, _value, scheduleTime) {
1306
1329
  scheduleTime ??= this.audioContext.currentTime;
1307
- return this.stopChannelNotes(channelNumber, 0, true, scheduleTime);
1330
+ return this.stopActiveNotes(channelNumber, 0, true, scheduleTime);
1308
1331
  }
1309
1332
  resetAllStates(channelNumber) {
1310
1333
  const channel = this.channels[channelNumber];
@@ -1342,7 +1365,7 @@ export class MidyGM1 {
1342
1365
  }
1343
1366
  allNotesOff(channelNumber, _value, scheduleTime) {
1344
1367
  scheduleTime ??= this.audioContext.currentTime;
1345
- return this.stopChannelNotes(channelNumber, 0, false, scheduleTime);
1368
+ return this.stopActiveNotes(channelNumber, 0, false, scheduleTime);
1346
1369
  }
1347
1370
  handleUniversalNonRealTimeExclusiveMessage(data, scheduleTime) {
1348
1371
  switch (data[2]) {
package/esm/midy-GM2.d.ts CHANGED
@@ -147,6 +147,7 @@ export class MidyGM2 {
147
147
  instruments: Set<any>;
148
148
  timeline: any[];
149
149
  };
150
+ stopActiveNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
150
151
  stopChannelNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
151
152
  stopNotes(velocity: any, force: any, scheduleTime: any): Promise<any[]>;
152
153
  start(): Promise<void>;
@@ -206,8 +207,9 @@ export class MidyGM2 {
206
207
  isDrumNoteOffException(channel: any, noteNumber: any): boolean;
207
208
  scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any, portamento: any): Promise<void>;
208
209
  noteOn(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<void>;
209
- disconnectNote(note: any, scheduledNotes: any, index: any): void;
210
- stopNote(endTime: any, stopTime: any, scheduledNotes: any, index: any): Promise<any>;
210
+ disconnectNote(note: any): void;
211
+ stopNote(endTime: any, stopTime: any, noteList: any, index: any): Promise<any>;
212
+ findNoteOffTarget(noteList: any): any[] | undefined;
211
213
  scheduleNoteOff(channelNumber: any, noteNumber: any, _velocity: any, endTime: any, force: any, portamentoNoteNumber: any): Promise<any> | undefined;
212
214
  noteOff(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<any> | undefined;
213
215
  releaseSustainPedal(channelNumber: any, halfVelocity: any, scheduleTime: any): (Promise<any> | undefined)[];
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"AAgNA;IAwCE;;;;;;;;;;;;;;MAcE;IAgCF;;;;;OAmBC;IAxGD,aAAa;IACb,yBAAqB;IACrB,2BAAuB;IACvB;;;MAGE;IACF;;;;;;MAME;IACF,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,kCAA+B;IAC/B,gCAA6B;IAC7B,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IACrC,+BAEE;IAkBF;;;;;MA4BE;IAGA,kBAAgC;IAChC;;;;;MAAqD;IACrD,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD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mBAAc;IACd,qBAAgB;IAChB,gBAAW;IACX,kBAAa;IACb,uBAAkB;IAClB,uBAAkB;IAClB,gBAAW;IAGT,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
1
+ {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"AAgNA;IAwCE;;;;;;;;;;;;;;MAcE;IAgCF;;;;;OAmBC;IAxGD,aAAa;IACb,yBAAqB;IACrB,2BAAuB;IACvB;;;MAGE;IACF;;;;;;MAME;IACF,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,kCAA+B;IAC/B,gCAA6B;IAC7B,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IACrC,+BAEE;IAkBF;;;;;MA4BE;IAGA,kBAAgC;IAChC;;;;;MAAqD;IACrD,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IACjD;;;MAA8D;IAC9D;;;;;;;;MAAyD;IAQ3D,4BAMC;IAED,mCAWC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAkBC;IAED,6DA2BC;IAED,4DASC;IAED,2CAcC;IAED,2EA6DC;IAED,mCAOC;IAED,0BAuDC;IAED,uDAEC;IAED,wDAEC;IAED,6EAEC;IAED;;;MAgHC;IAED,kGAiBC;IAED,mGAiBC;IAED,wEAMC;IAED,uBAKC;IAED,aAMC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,yDASC;IAED,2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,gFAGC;IAED,iEAEC;IAED,gEAEC;IAED,gEAIC;IAED,gEAIC;IAED,+EAgCC;IAED,qCAcC;IAED,qCAcC;IAED,4EAwCC;IAED,4DAGC;IAED,sDASC;IAED,gEAGC;IAED,yDAWC;IAED,kEAGC;IAED,2DAWC;IAED,sEAeC;IAED,4CAOC;IAED,+BAKC;IAED,qDAiBC;IAED,gCAIC;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,2FAeC;IAED,6CAIC;IAED,0CAIC;IAED,uCAIC;IAED,wCAIC;IAED,2CAIC;IAED,mEASC;IAED,qDAQC;IAED,4CAUC;IAED,2DAOC;IAED,0CASC;IAED,6FAIC;IAED,yEAeC;IAED,gDAYC;IAGD,6DAgBC;CACF;AA1zFD;IACE,uBAGC;IAFC,YAA2B;IAC3B,qBAAuB;IAGzB,gCAKC;IAED,mBAEC;IAED,0BAUC;IAED,uBAEC;IAED,mBAEC;IAED,cAMC;IASD,6BAKC;IAZD,qDAKC;CAQF;AAED;IAiBE,0FAMC;IAtBD,kBAAa;IACb,gBAAW;IACX,iBAAY;IACZ,wBAAmB;IACnB,iBAAY;IACZ,gBAAW;IACX,WAAM;IACN,WAAM;IACN,mBAAc;IACd,qBAAgB;IAChB,gBAAW;IACX,kBAAa;IACb,uBAAkB;IAClB,uBAAkB;IAClB,gBAAW;IAGT,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,WAAkB;IAClB,iBAA8B;CAEjC"}
package/esm/midy-GM2.js CHANGED
@@ -618,7 +618,7 @@ export class MidyGM2 {
618
618
  const startTime = event.startTime + this.startDelay - offset;
619
619
  switch (event.type) {
620
620
  case "noteOn":
621
- if (event.velocity !== 0) {
621
+ if (0 < event.velocity) {
622
622
  await this.scheduleNoteOn(event.channel, event.noteNumber, event.velocity, startTime, event.portamento);
623
623
  break;
624
624
  }
@@ -831,6 +831,17 @@ export class MidyGM2 {
831
831
  }
832
832
  return { instruments, timeline };
833
833
  }
834
+ stopActiveNotes(channelNumber, velocity, force, scheduleTime) {
835
+ const channel = this.channels[channelNumber];
836
+ const promises = [];
837
+ const activeNotes = this.getActiveNotes(channel, scheduleTime);
838
+ activeNotes.forEach((note) => {
839
+ const promise = this.scheduleNoteOff(channelNumber, note.noteNumber, velocity, scheduleTime, force, undefined);
840
+ this.notePromises.push(promise);
841
+ promises.push(promise);
842
+ });
843
+ return Promise.all(promises);
844
+ }
834
845
  stopChannelNotes(channelNumber, velocity, force, scheduleTime) {
835
846
  const channel = this.channels[channelNumber];
836
847
  const promises = [];
@@ -902,6 +913,8 @@ export class MidyGM2 {
902
913
  const note = noteList[i];
903
914
  if (!note)
904
915
  continue;
916
+ if (note.ending)
917
+ continue;
905
918
  callback(note);
906
919
  }
907
920
  });
@@ -1267,7 +1280,7 @@ export class MidyGM2 {
1267
1280
  type: "lowpass",
1268
1281
  Q: voiceParams.initialFilterQ / 10, // dB
1269
1282
  });
1270
- if (portamento) {
1283
+ if (0.5 <= state.portamento && portamento) {
1271
1284
  note.portamento = true;
1272
1285
  this.setPortamentoStartVolumeEnvelope(channel, note, now);
1273
1286
  this.setPortamentoStartFilterEnvelope(channel, note, now);
@@ -1357,8 +1370,8 @@ export class MidyGM2 {
1357
1370
  if (!channel.isDrum)
1358
1371
  return false;
1359
1372
  const programNumber = channel.programNumber;
1360
- return (programNumber === 48 && noteNumber === 88) ||
1361
- (programNumber === 56 && 47 <= noteNumber && noteNumber <= 84);
1373
+ return !((programNumber === 48 && noteNumber === 88) ||
1374
+ (programNumber === 56 && 47 <= noteNumber && noteNumber <= 84));
1362
1375
  }
1363
1376
  async scheduleNoteOn(channelNumber, noteNumber, velocity, startTime, portamento) {
1364
1377
  const channel = this.channels[channelNumber];
@@ -1380,20 +1393,21 @@ export class MidyGM2 {
1380
1393
  this.handleExclusiveClass(note, channelNumber, startTime);
1381
1394
  this.handleDrumExclusiveClass(note, channelNumber, startTime);
1382
1395
  const scheduledNotes = channel.scheduledNotes;
1383
- let notes = scheduledNotes.get(noteNumber);
1384
- if (notes) {
1385
- notes.push(note);
1396
+ let noteList = scheduledNotes.get(noteNumber);
1397
+ if (noteList) {
1398
+ noteList.push(note);
1386
1399
  }
1387
1400
  else {
1388
- notes = [note];
1389
- scheduledNotes.set(noteNumber, notes);
1401
+ noteList = [note];
1402
+ scheduledNotes.set(noteNumber, noteList);
1390
1403
  }
1391
1404
  if (this.isDrumNoteOffException(channel, noteNumber)) {
1392
1405
  const stopTime = startTime + note.bufferSource.buffer.duration;
1393
- const index = notes.length - 1;
1406
+ const index = noteList.length - 1;
1394
1407
  const promise = new Promise((resolve) => {
1395
1408
  note.bufferSource.onended = () => {
1396
- this.disconnectNote(note, scheduledNotes, index);
1409
+ noteList[index] = undefined;
1410
+ this.disconnectNote(note);
1397
1411
  resolve();
1398
1412
  };
1399
1413
  note.bufferSource.stop(stopTime);
@@ -1405,8 +1419,7 @@ export class MidyGM2 {
1405
1419
  scheduleTime ??= this.audioContext.currentTime;
1406
1420
  return this.scheduleNoteOn(channelNumber, noteNumber, velocity, scheduleTime, false);
1407
1421
  }
1408
- disconnectNote(note, scheduledNotes, index) {
1409
- scheduledNotes[index] = null;
1422
+ disconnectNote(note) {
1410
1423
  note.bufferSource.disconnect();
1411
1424
  note.filterNode.disconnect();
1412
1425
  note.volumeEnvelopeNode.disconnect();
@@ -1429,8 +1442,8 @@ export class MidyGM2 {
1429
1442
  note.chorusEffectsSend.disconnect();
1430
1443
  }
1431
1444
  }
1432
- stopNote(endTime, stopTime, scheduledNotes, index) {
1433
- const note = scheduledNotes[index];
1445
+ stopNote(endTime, stopTime, noteList, index) {
1446
+ const note = noteList[index];
1434
1447
  note.volumeEnvelopeNode.gain
1435
1448
  .cancelScheduledValues(endTime)
1436
1449
  .linearRampToValueAtTime(0, stopTime);
@@ -1440,12 +1453,23 @@ export class MidyGM2 {
1440
1453
  }, stopTime);
1441
1454
  return new Promise((resolve) => {
1442
1455
  note.bufferSource.onended = () => {
1443
- this.disconnectNote(note, scheduledNotes, index);
1456
+ noteList[index] = undefined;
1457
+ this.disconnectNote(note);
1444
1458
  resolve();
1445
1459
  };
1446
1460
  note.bufferSource.stop(stopTime);
1447
1461
  });
1448
1462
  }
1463
+ findNoteOffTarget(noteList) {
1464
+ for (let i = 0; i < noteList.length; i++) {
1465
+ const note = noteList[i];
1466
+ if (!note)
1467
+ continue;
1468
+ if (note.ending)
1469
+ continue;
1470
+ return [note, i];
1471
+ }
1472
+ }
1449
1473
  scheduleNoteOff(channelNumber, noteNumber, _velocity, endTime, force, portamentoNoteNumber) {
1450
1474
  const channel = this.channels[channelNumber];
1451
1475
  if (this.isDrumNoteOffException(channel, noteNumber))
@@ -1457,34 +1481,32 @@ export class MidyGM2 {
1457
1481
  if (channel.sostenutoNotes.has(noteNumber))
1458
1482
  return;
1459
1483
  }
1460
- if (!channel.scheduledNotes.has(noteNumber))
1484
+ const noteList = channel.scheduledNotes.get(noteNumber);
1485
+ if (!noteList)
1486
+ return; // be careful with drum channel
1487
+ const noteOffTarget = this.findNoteOffTarget(noteList, endTime);
1488
+ if (!noteOffTarget)
1461
1489
  return;
1462
- const scheduledNotes = channel.scheduledNotes.get(noteNumber);
1463
- for (let i = 0; i < scheduledNotes.length; i++) {
1464
- const note = scheduledNotes[i];
1465
- if (!note)
1466
- continue;
1467
- if (note.ending)
1468
- continue;
1469
- if (portamentoNoteNumber === undefined) {
1470
- const volRelease = endTime + note.voiceParams.volRelease;
1471
- const modRelease = endTime + note.voiceParams.modRelease;
1472
- note.filterNode.frequency
1473
- .cancelScheduledValues(endTime)
1474
- .linearRampToValueAtTime(0, modRelease);
1475
- const stopTime = Math.min(volRelease, modRelease);
1476
- return this.stopNote(endTime, stopTime, scheduledNotes, i);
1477
- }
1478
- else {
1479
- const portamentoTime = endTime + this.getPortamentoTime(channel);
1480
- const deltaNote = portamentoNoteNumber - noteNumber;
1481
- const baseRate = note.voiceParams.playbackRate;
1482
- const targetRate = baseRate * Math.pow(2, deltaNote / 12);
1483
- note.bufferSource.playbackRate
1484
- .cancelScheduledValues(endTime)
1485
- .linearRampToValueAtTime(targetRate, portamentoTime);
1486
- return this.stopNote(endTime, portamentoTime, scheduledNotes, i);
1487
- }
1490
+ const [note, i] = noteOffTarget;
1491
+ if (0.5 <= state.portamento && portamentoNoteNumber !== undefined) {
1492
+ const portamentoTime = endTime + this.getPortamentoTime(channel);
1493
+ const deltaNote = portamentoNoteNumber - noteNumber;
1494
+ const baseRate = note.voiceParams.playbackRate;
1495
+ const targetRate = baseRate * Math.pow(2, deltaNote / 12);
1496
+ note.bufferSource.playbackRate
1497
+ .cancelScheduledValues(endTime)
1498
+ .linearRampToValueAtTime(targetRate, portamentoTime);
1499
+ return this.stopNote(endTime, portamentoTime, noteList, i);
1500
+ }
1501
+ else {
1502
+ const volRelease = endTime +
1503
+ note.voiceParams.volRelease * state.releaseTime * 2;
1504
+ const modRelease = endTime + note.voiceParams.modRelease;
1505
+ note.filterNode.frequency
1506
+ .cancelScheduledValues(endTime)
1507
+ .linearRampToValueAtTime(0, modRelease);
1508
+ const stopTime = Math.min(volRelease, modRelease);
1509
+ return this.stopNote(endTime, stopTime, noteList, i);
1488
1510
  }
1489
1511
  }
1490
1512
  noteOff(channelNumber, noteNumber, velocity, scheduleTime) {
@@ -1565,7 +1587,7 @@ export class MidyGM2 {
1565
1587
  this.getActiveNotes(channel, scheduleTime).forEach((note) => {
1566
1588
  this.setControllerParameters(channel, note, table);
1567
1589
  });
1568
- // this.applyVoiceParams(channel, 13);
1590
+ this.applyVoiceParams(channel, 13);
1569
1591
  }
1570
1592
  handlePitchBendMessage(channelNumber, lsb, msb, scheduleTime) {
1571
1593
  const pitchBend = msb * 128 + lsb;
@@ -1742,6 +1764,7 @@ export class MidyGM2 {
1742
1764
  state.set(channel.state.array);
1743
1765
  state[2] = velocity / 127;
1744
1766
  state[3] = noteNumber / 127;
1767
+ state[13] = state.channelPressure / 127;
1745
1768
  return state;
1746
1769
  }
1747
1770
  applyVoiceParams(channel, controllerType, scheduleTime) {
@@ -1768,7 +1791,7 @@ export class MidyGM2 {
1768
1791
  if (key in voiceParams)
1769
1792
  noteVoiceParams[key] = voiceParams[key];
1770
1793
  }
1771
- if (note.portamento) {
1794
+ if (0.5 <= channel.state.portamento && note.portamento) {
1772
1795
  this.setPortamentoStartFilterEnvelope(channel, note, scheduleTime);
1773
1796
  }
1774
1797
  else {
@@ -1965,10 +1988,11 @@ export class MidyGM2 {
1965
1988
  const channel = this.channels[channelNumber];
1966
1989
  if (channel.isDrum)
1967
1990
  return;
1991
+ const state = channel.state;
1968
1992
  scheduleTime ??= this.audioContext.currentTime;
1969
- channel.state.softPedal = softPedal / 127;
1993
+ state.softPedal = softPedal / 127;
1970
1994
  this.processScheduledNotes(channel, (note) => {
1971
- if (note.portamento) {
1995
+ if (0.5 <= state.portamento && note.portamento) {
1972
1996
  this.setPortamentoStartVolumeEnvelope(channel, note, scheduleTime);
1973
1997
  this.setPortamentoStartFilterEnvelope(channel, note, scheduleTime);
1974
1998
  }
@@ -2167,7 +2191,7 @@ export class MidyGM2 {
2167
2191
  }
2168
2192
  allSoundOff(channelNumber, _value, scheduleTime) {
2169
2193
  scheduleTime ??= this.audioContext.currentTime;
2170
- return this.stopChannelNotes(channelNumber, 0, true, scheduleTime);
2194
+ return this.stopActiveNotes(channelNumber, 0, true, scheduleTime);
2171
2195
  }
2172
2196
  resetAllStates(channelNumber) {
2173
2197
  const channel = this.channels[channelNumber];
@@ -2211,7 +2235,7 @@ export class MidyGM2 {
2211
2235
  }
2212
2236
  allNotesOff(channelNumber, _value, scheduleTime) {
2213
2237
  scheduleTime ??= this.audioContext.currentTime;
2214
- return this.stopChannelNotes(channelNumber, 0, false, scheduleTime);
2238
+ return this.stopActiveNotes(channelNumber, 0, false, scheduleTime);
2215
2239
  }
2216
2240
  omniOff(channelNumber, value, scheduleTime) {
2217
2241
  this.allNotesOff(channelNumber, value, scheduleTime);
@@ -86,6 +86,7 @@ export class MidyGMLite {
86
86
  instruments: Set<any>;
87
87
  timeline: any[];
88
88
  };
89
+ stopActiveNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
89
90
  stopChannelNotes(channelNumber: any, velocity: any, force: any, scheduleTime: any): Promise<any[]>;
90
91
  stopNotes(velocity: any, force: any, scheduleTime: any): Promise<any[]>;
91
92
  start(): Promise<void>;
@@ -116,8 +117,9 @@ export class MidyGMLite {
116
117
  handleDrumExclusiveClass(note: any, channelNumber: any, startTime: any): void;
117
118
  scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any): Promise<void>;
118
119
  noteOn(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<void>;
119
- disconnectNote(note: any, scheduledNotes: any, index: any): void;
120
- stopNote(endTime: any, stopTime: any, scheduledNotes: any, index: any): Promise<any>;
120
+ disconnectNote(note: any): void;
121
+ stopNote(endTime: any, stopTime: any, noteList: any, index: any): Promise<any>;
122
+ findNoteOffTarget(noteList: any): any[] | undefined;
121
123
  scheduleNoteOff(channelNumber: any, noteNumber: any, _velocity: any, endTime: any, force: any): Promise<any> | undefined;
122
124
  noteOff(channelNumber: any, noteNumber: any, velocity: any, scheduleTime: any): Promise<any> | undefined;
123
125
  releaseSustainPedal(channelNumber: any, halfVelocity: any, scheduleTime: any): (Promise<any> | undefined)[];
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GMLite.d.ts","sourceRoot":"","sources":["../src/midy-GMLite.js"],"names":[],"mappings":"AA+JA;IA2BE;;;;;;;;;MASE;IAEF,+BAcC;IAnDD,aAAa;IACb,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,kCAA+B;IAC/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DAEC;IAED,gDAEC;IAED,sEAGC;IAED,qEAKC;IAED,2EAUC;IAED,gFAGC;IAED,yCAUC;IAGD,8CAqBC;IAED,gFAGC;IAED,+EAgBC;IAED,qCAWC;IAED,4EAaC;IAED,4DAGC;IAED,sDASC;IAED,gDAYC;IAGD,6DAgBC;CACF;AA79CD;IACE,uBAGC;IAFC,YAA2B;IAC3B,qBAAuB;IAGzB,gCAKC;IAED,mBAEC;IAED,0BAUC;IAED,uBAEC;IAED,mBAEC;IAED,cAMC;IASD,6BAKC;IAZD,qDAKC;CAQF;AAED;IASE,0FAMC;IAdD,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":"AA+JA;IA2BE;;;;;;;;;MASE;IAEF,+BAcC;IAnDD,aAAa;IACb,oBAAiB;IACjB,qBAAmB;IACnB,kBAAc;IACd,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,kCAA+B;IAC/B,gCAA6B;IAC7B,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,2BAAqC;IACrC,+BAEE;IAcA,kBAAgC;IAChC,kBAA8C;IAC9C,eAAwD;IACxD,qBAGE;IACF;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IAMnD,4BAMC;IAED,mCAWC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAaC;IAED,6DA2BC;IAED,4DASC;IAED,2EAsDC;IAED,mCAOC;IAED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