@marmooo/midy 0.1.4 → 0.1.6

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.
Files changed (35) hide show
  1. package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/{soundfont-parser@0.0.4 → soundfont-parser@0.0.6}/+esm.d.ts +16 -20
  2. package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.d.ts.map +1 -0
  3. package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.js +180 -0
  4. package/esm/midy-GM1.d.ts +36 -8
  5. package/esm/midy-GM1.d.ts.map +1 -1
  6. package/esm/midy-GM1.js +87 -89
  7. package/esm/midy-GM2.d.ts +65 -10
  8. package/esm/midy-GM2.d.ts.map +1 -1
  9. package/esm/midy-GM2.js +233 -154
  10. package/esm/midy-GMLite.d.ts +36 -8
  11. package/esm/midy-GMLite.d.ts.map +1 -1
  12. package/esm/midy-GMLite.js +87 -89
  13. package/esm/midy.d.ts +85 -10
  14. package/esm/midy.d.ts.map +1 -1
  15. package/esm/midy.js +254 -174
  16. package/package.json +1 -1
  17. package/script/deps/cdn.jsdelivr.net/npm/@marmooo/{soundfont-parser@0.0.4 → soundfont-parser@0.0.6}/+esm.d.ts +16 -20
  18. package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.d.ts.map +1 -0
  19. package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.js +190 -0
  20. package/script/midy-GM1.d.ts +36 -8
  21. package/script/midy-GM1.d.ts.map +1 -1
  22. package/script/midy-GM1.js +87 -89
  23. package/script/midy-GM2.d.ts +65 -10
  24. package/script/midy-GM2.d.ts.map +1 -1
  25. package/script/midy-GM2.js +233 -154
  26. package/script/midy-GMLite.d.ts +36 -8
  27. package/script/midy-GMLite.d.ts.map +1 -1
  28. package/script/midy-GMLite.js +87 -89
  29. package/script/midy.d.ts +85 -10
  30. package/script/midy.d.ts.map +1 -1
  31. package/script/midy.js +254 -174
  32. package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.d.ts.map +0 -1
  33. package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.js +0 -162
  34. package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.d.ts.map +0 -1
  35. package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.js +0 -169
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MidyGM1 = void 0;
4
4
  const _esm_js_1 = require("./deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.js");
5
- const _esm_js_2 = require("./deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.js");
5
+ const _esm_js_2 = require("./deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.js");
6
6
  class Note {
7
7
  constructor(noteNumber, velocity, startTime, instrumentKey) {
8
8
  Object.defineProperty(this, "bufferSource", {
@@ -165,6 +165,7 @@ class MidyGM1 {
165
165
  });
166
166
  this.audioContext = audioContext;
167
167
  this.masterGain = new GainNode(audioContext);
168
+ this.controlChangeHandlers = this.createControlChangeHandlers();
168
169
  this.channels = this.createChannels(audioContext);
169
170
  this.masterGain.connect(audioContext.destination);
170
171
  this.GM1SystemOn();
@@ -179,12 +180,14 @@ class MidyGM1 {
179
180
  addSoundFont(soundFont) {
180
181
  const index = this.soundFonts.length;
181
182
  this.soundFonts.push(soundFont);
182
- soundFont.parsed.presetHeaders.forEach((presetHeader) => {
183
+ const presetHeaders = soundFont.parsed.presetHeaders;
184
+ for (let i = 0; i < presetHeaders.length; i++) {
185
+ const presetHeader = presetHeaders[i];
183
186
  if (!presetHeader.presetName.startsWith("\u0000")) { // TODO: Only SF3 generated by PolyPone?
184
187
  const banks = this.soundFontTable[presetHeader.preset];
185
188
  banks.set(presetHeader.bank, index);
186
189
  }
187
- });
190
+ }
188
191
  }
189
192
  async loadSoundFont(soundFontUrl) {
190
193
  const response = await fetch(soundFontUrl);
@@ -229,27 +232,25 @@ class MidyGM1 {
229
232
  return channels;
230
233
  }
231
234
  async createNoteBuffer(instrumentKey, isSF3) {
235
+ const sampleStart = instrumentKey.start;
232
236
  const sampleEnd = instrumentKey.sample.length + instrumentKey.end;
233
237
  if (isSF3) {
234
- const sample = new Uint8Array(instrumentKey.sample.length);
235
- sample.set(instrumentKey.sample);
238
+ const sample = instrumentKey.sample.slice(sampleStart, sampleEnd);
236
239
  const audioBuffer = await this.audioContext.decodeAudioData(sample.buffer);
237
- for (let channel = 0; channel < audioBuffer.numberOfChannels; channel++) {
238
- const channelData = audioBuffer.getChannelData(channel);
239
- channelData.set(channelData.subarray(0, sampleEnd));
240
- }
241
240
  return audioBuffer;
242
241
  }
243
242
  else {
244
- const sample = instrumentKey.sample.subarray(0, sampleEnd);
245
- const floatSample = this.convertToFloat32Array(sample);
243
+ const sample = instrumentKey.sample.subarray(sampleStart, sampleEnd);
246
244
  const audioBuffer = new AudioBuffer({
247
245
  numberOfChannels: 1,
248
246
  length: sample.length,
249
247
  sampleRate: instrumentKey.sampleRate,
250
248
  });
251
249
  const channelData = audioBuffer.getChannelData(0);
252
- channelData.set(floatSample);
250
+ const int16Array = new Int16Array(sample.buffer);
251
+ for (let i = 0; i < int16Array.length; i++) {
252
+ channelData[i] = int16Array[i] / 32768;
253
+ }
253
254
  return audioBuffer;
254
255
  }
255
256
  }
@@ -265,14 +266,6 @@ class MidyGM1 {
265
266
  }
266
267
  return bufferSource;
267
268
  }
268
- convertToFloat32Array(uint8Array) {
269
- const int16Array = new Int16Array(uint8Array.buffer);
270
- const float32Array = new Float32Array(int16Array.length);
271
- for (let i = 0; i < int16Array.length; i++) {
272
- float32Array[i] = int16Array[i] / 32768;
273
- }
274
- return float32Array;
275
- }
276
269
  async scheduleTimelineEvents(t, offset, queueIndex) {
277
270
  while (queueIndex < this.timeline.length) {
278
271
  const event = this.timeline[queueIndex];
@@ -383,9 +376,11 @@ class MidyGM1 {
383
376
  bank: this.channels[i].bank,
384
377
  };
385
378
  }
386
- midi.tracks.forEach((track) => {
379
+ for (let i = 0; i < midi.tracks.length; i++) {
380
+ const track = midi.tracks[i];
387
381
  let currentTicks = 0;
388
- track.forEach((event) => {
382
+ for (let j = 0; j < track.length; j++) {
383
+ const event = track[j];
389
384
  currentTicks += event.deltaTime;
390
385
  event.ticks = currentTicks;
391
386
  switch (event.type) {
@@ -405,8 +400,8 @@ class MidyGM1 {
405
400
  }
406
401
  delete event.deltaTime;
407
402
  timeline.push(event);
408
- });
409
- });
403
+ }
404
+ }
410
405
  const priority = {
411
406
  controller: 0,
412
407
  sysEx: 1,
@@ -431,7 +426,7 @@ class MidyGM1 {
431
426
  }
432
427
  return { instruments, timeline };
433
428
  }
434
- async stopChannelNotes(channelNumber, velocity, stopPedal) {
429
+ async stopChannelNotes(channelNumber, velocity, force) {
435
430
  const now = this.audioContext.currentTime;
436
431
  const channel = this.channels[channelNumber];
437
432
  channel.scheduledNotes.forEach((noteList) => {
@@ -439,16 +434,16 @@ class MidyGM1 {
439
434
  const note = noteList[i];
440
435
  if (!note)
441
436
  continue;
442
- const promise = this.scheduleNoteRelease(channelNumber, note.noteNumber, velocity, now, stopPedal);
437
+ const promise = this.scheduleNoteRelease(channelNumber, note.noteNumber, velocity, now, force);
443
438
  this.notePromises.push(promise);
444
439
  }
445
440
  });
446
441
  channel.scheduledNotes.clear();
447
442
  await Promise.all(this.notePromises);
448
443
  }
449
- stopNotes(velocity, stopPedal) {
444
+ stopNotes(velocity, force) {
450
445
  for (let i = 0; i < this.channels.length; i++) {
451
- this.stopChannelNotes(i, velocity, stopPedal);
446
+ this.stopChannelNotes(i, velocity, force);
452
447
  }
453
448
  return Promise.all(this.notePromises);
454
449
  }
@@ -625,7 +620,7 @@ class MidyGM1 {
625
620
  note.volumeNode = new GainNode(this.audioContext);
626
621
  note.filterNode = new BiquadFilterNode(this.audioContext, {
627
622
  type: "lowpass",
628
- Q: instrumentKey.initialFilterQ / 10 * channel.filterResonance, // dB
623
+ Q: instrumentKey.initialFilterQ / 10, // dB
629
624
  });
630
625
  this.setVolumeEnvelope(note);
631
626
  this.setFilterEnvelope(note);
@@ -638,7 +633,7 @@ class MidyGM1 {
638
633
  }
639
634
  note.bufferSource.connect(note.filterNode);
640
635
  note.filterNode.connect(note.volumeNode);
641
- note.bufferSource.start(startTime, instrumentKey.start / instrumentKey.sampleRate);
636
+ note.bufferSource.start(startTime);
642
637
  return note;
643
638
  }
644
639
  async scheduleNoteOn(channelNumber, noteNumber, velocity, startTime) {
@@ -649,7 +644,7 @@ class MidyGM1 {
649
644
  return;
650
645
  const soundFont = this.soundFonts[soundFontIndex];
651
646
  const isSF3 = soundFont.parsed.info.version.major === 3;
652
- const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber);
647
+ const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber, velocity);
653
648
  if (!instrumentKey)
654
649
  return;
655
650
  const note = await this.createNote(channel, instrumentKey, noteNumber, velocity, startTime, isSF3);
@@ -667,9 +662,38 @@ class MidyGM1 {
667
662
  const now = this.audioContext.currentTime;
668
663
  return this.scheduleNoteOn(channelNumber, noteNumber, velocity, now);
669
664
  }
670
- scheduleNoteRelease(channelNumber, noteNumber, _velocity, stopTime, stopPedal = false) {
665
+ stopNote(stopTime, endTime, scheduledNotes, index) {
666
+ const note = scheduledNotes[index];
667
+ note.volumeNode.gain
668
+ .cancelScheduledValues(stopTime)
669
+ .linearRampToValueAtTime(0, endTime);
670
+ note.ending = true;
671
+ this.scheduleTask(() => {
672
+ note.bufferSource.loop = false;
673
+ }, endTime);
674
+ return new Promise((resolve) => {
675
+ note.bufferSource.onended = () => {
676
+ scheduledNotes[index] = null;
677
+ note.bufferSource.disconnect();
678
+ note.volumeNode.disconnect();
679
+ note.filterNode.disconnect();
680
+ if (note.modulationDepth) {
681
+ note.volumeDepth.disconnect();
682
+ note.modulationDepth.disconnect();
683
+ note.modulationLFO.stop();
684
+ }
685
+ if (note.vibratoDepth) {
686
+ note.vibratoDepth.disconnect();
687
+ note.vibratoLFO.stop();
688
+ }
689
+ resolve();
690
+ };
691
+ note.bufferSource.stop(endTime);
692
+ });
693
+ }
694
+ scheduleNoteRelease(channelNumber, noteNumber, _velocity, stopTime, force) {
671
695
  const channel = this.channels[channelNumber];
672
- if (stopPedal && channel.sustainPedal)
696
+ if (!force && channel.sustainPedal)
673
697
  return;
674
698
  if (!channel.scheduledNotes.has(noteNumber))
675
699
  return;
@@ -681,33 +705,11 @@ class MidyGM1 {
681
705
  if (note.ending)
682
706
  continue;
683
707
  const volEndTime = stopTime + note.instrumentKey.volRelease;
684
- note.volumeNode.gain
685
- .cancelScheduledValues(stopTime)
686
- .linearRampToValueAtTime(0, volEndTime);
687
708
  const modRelease = stopTime + note.instrumentKey.modRelease;
688
709
  note.filterNode.frequency
689
710
  .cancelScheduledValues(stopTime)
690
711
  .linearRampToValueAtTime(0, modRelease);
691
- note.ending = true;
692
- this.scheduleTask(() => {
693
- note.bufferSource.loop = false;
694
- }, stopTime);
695
- return new Promise((resolve) => {
696
- note.bufferSource.onended = () => {
697
- scheduledNotes[i] = null;
698
- note.bufferSource.disconnect();
699
- note.volumeNode.disconnect();
700
- note.filterNode.disconnect();
701
- if (note.volumeDepth)
702
- note.volumeDepth.disconnect();
703
- if (note.modulationDepth)
704
- note.modulationDepth.disconnect();
705
- if (note.modulationLFO)
706
- note.modulationLFO.stop();
707
- resolve();
708
- };
709
- note.bufferSource.stop(volEndTime);
710
- });
712
+ this.stopNote(stopTime, volEndTime, scheduledNotes, i);
711
713
  }
712
714
  }
713
715
  releaseNote(channelNumber, noteNumber, velocity) {
@@ -765,34 +767,29 @@ class MidyGM1 {
765
767
  channel.pitchBendRange * 100;
766
768
  this.updateDetune(channel, detuneChange);
767
769
  }
770
+ createControlChangeHandlers() {
771
+ return {
772
+ 1: this.setModulationDepth,
773
+ 6: this.dataEntryMSB,
774
+ 7: this.setVolume,
775
+ 10: this.setPan,
776
+ 11: this.setExpression,
777
+ 38: this.dataEntryLSB,
778
+ 64: this.setSustainPedal,
779
+ 100: this.setRPNLSB,
780
+ 101: this.setRPNMSB,
781
+ 120: this.allSoundOff,
782
+ 121: this.resetAllControllers,
783
+ 123: this.allNotesOff,
784
+ };
785
+ }
768
786
  handleControlChange(channelNumber, controller, value) {
769
- switch (controller) {
770
- case 1:
771
- return this.setModulationDepth(channelNumber, value);
772
- case 6:
773
- return this.dataEntryMSB(channelNumber, value);
774
- case 7:
775
- return this.setVolume(channelNumber, value);
776
- case 10:
777
- return this.setPan(channelNumber, value);
778
- case 11:
779
- return this.setExpression(channelNumber, value);
780
- case 38:
781
- return this.dataEntryLSB(channelNumber, value);
782
- case 64:
783
- return this.setSustainPedal(channelNumber, value);
784
- case 100:
785
- return this.setRPNLSB(channelNumber, value);
786
- case 101:
787
- return this.setRPNMSB(channelNumber, value);
788
- case 120:
789
- return this.allSoundOff(channelNumber);
790
- case 121:
791
- return this.resetAllControllers(channelNumber);
792
- case 123:
793
- return this.allNotesOff(channelNumber);
794
- default:
795
- console.warn(`Unsupported Control change: controller=${controller} value=${value}`);
787
+ const handler = this.controlChangeHandlers[controller];
788
+ if (handler) {
789
+ handler.call(this, channelNumber, value);
790
+ }
791
+ else {
792
+ console.warn(`Unsupported Control change: controller=${controller} value=${value}`);
796
793
  }
797
794
  }
798
795
  updateModulation(channel) {
@@ -821,7 +818,7 @@ class MidyGM1 {
821
818
  setVolume(channelNumber, volume) {
822
819
  const channel = this.channels[channelNumber];
823
820
  channel.volume = volume / 127;
824
- this.updateChannelGain(channel);
821
+ this.updateChannelVolume(channel);
825
822
  }
826
823
  panToGain(pan) {
827
824
  const theta = Math.PI / 2 * Math.max(0, pan - 1) / 126;
@@ -833,18 +830,18 @@ class MidyGM1 {
833
830
  setPan(channelNumber, pan) {
834
831
  const channel = this.channels[channelNumber];
835
832
  channel.pan = pan;
836
- this.updateChannelGain(channel);
833
+ this.updateChannelVolume(channel);
837
834
  }
838
835
  setExpression(channelNumber, expression) {
839
836
  const channel = this.channels[channelNumber];
840
837
  channel.expression = expression / 127;
841
- this.updateChannelGain(channel);
838
+ this.updateChannelVolume(channel);
842
839
  }
843
840
  dataEntryLSB(channelNumber, value) {
844
841
  this.channels[channelNumber].dataLSB = value;
845
842
  this.handleRPN(channelNumber, 0);
846
843
  }
847
- updateChannelGain(channel) {
844
+ updateChannelVolume(channel) {
848
845
  const now = this.audioContext.currentTime;
849
846
  const volume = channel.volume * channel.expression;
850
847
  const { gainLeft, gainRight } = this.panToGain(channel.pan);
@@ -997,11 +994,12 @@ class MidyGM1 {
997
994
  }
998
995
  }
999
996
  GM1SystemOn() {
1000
- this.channels.forEach((channel) => {
997
+ for (let i = 0; i < this.channels.length; i++) {
998
+ const channel = this.channels[i];
1001
999
  channel.bankMSB = 0;
1002
1000
  channel.bankLSB = 0;
1003
1001
  channel.bank = 0;
1004
- });
1002
+ }
1005
1003
  this.channels[9].bankMSB = 1;
1006
1004
  this.channels[9].bank = 128;
1007
1005
  }
@@ -92,6 +92,32 @@ export class MidyGM2 {
92
92
  };
93
93
  };
94
94
  masterGain: any;
95
+ controlChangeHandlers: {
96
+ 0: (channelNumber: any, msb: any) => void;
97
+ 1: (channelNumber: any, modulation: any) => void;
98
+ 5: (channelNumber: any, portamentoTime: any) => void;
99
+ 6: (channelNumber: any, value: any) => void;
100
+ 7: (channelNumber: any, volume: any) => void;
101
+ 10: (channelNumber: any, pan: any) => void;
102
+ 11: (channelNumber: any, expression: any) => void;
103
+ 32: (channelNumber: any, lsb: any) => void;
104
+ 38: (channelNumber: any, value: any) => void;
105
+ 64: (channelNumber: any, value: any) => void;
106
+ 65: (channelNumber: any, value: any) => void;
107
+ 66: (channelNumber: any, value: any) => void;
108
+ 67: (channelNumber: any, softPedal: any) => void;
109
+ 91: (channelNumber: any, reverbSendLevel: any) => void;
110
+ 93: (channelNumber: any, chorusSendLevel: any) => void;
111
+ 100: (channelNumber: any, value: any) => void;
112
+ 101: (channelNumber: any, value: any) => void;
113
+ 120: (channelNumber: any) => Promise<void>;
114
+ 121: (channelNumber: any) => void;
115
+ 123: (channelNumber: any) => Promise<void>;
116
+ 124: () => void;
117
+ 125: () => void;
118
+ 126: () => void;
119
+ 127: () => void;
120
+ };
95
121
  channels: any[];
96
122
  reverbEffect: {
97
123
  input: any;
@@ -118,7 +144,7 @@ export class MidyGM2 {
118
144
  createChannels(audioContext: any): any[];
119
145
  createNoteBuffer(instrumentKey: any, isSF3: any): Promise<any>;
120
146
  createNoteBufferNode(instrumentKey: any, isSF3: any): Promise<any>;
121
- convertToFloat32Array(uint8Array: any): Float32Array;
147
+ findPortamentoTarget(queueIndex: any): any;
122
148
  scheduleTimelineEvents(t: any, offset: any, queueIndex: any): Promise<any>;
123
149
  getQueueIndex(second: any): number;
124
150
  playNotes(): Promise<any>;
@@ -128,8 +154,8 @@ export class MidyGM2 {
128
154
  instruments: Set<any>;
129
155
  timeline: any[];
130
156
  };
131
- stopChannelNotes(channelNumber: any, velocity: any, stopPedal: any): Promise<void>;
132
- stopNotes(velocity: any, stopPedal: any): Promise<any[]>;
157
+ stopChannelNotes(channelNumber: any, velocity: any, force: any): Promise<void>;
158
+ stopNotes(velocity: any, force: any): Promise<any[]>;
133
159
  start(): Promise<void>;
134
160
  stop(): void;
135
161
  pause(): void;
@@ -165,18 +191,21 @@ export class MidyGM2 {
165
191
  centToHz(cent: any): number;
166
192
  calcSemitoneOffset(channel: any): any;
167
193
  calcPlaybackRate(instrumentKey: any, noteNumber: any, semitoneOffset: any): number;
194
+ setPortamentoStartVolumeEnvelope(channel: any, note: any): void;
168
195
  setVolumeEnvelope(note: any): void;
169
196
  setPitch(note: any, semitoneOffset: any): void;
170
197
  clampCutoffFrequency(frequency: any): number;
198
+ setPortamentoStartFilterEnvelope(channel: any, note: any): void;
171
199
  setFilterEnvelope(channel: any, note: any): void;
172
200
  startModulation(channel: any, note: any, startTime: any): void;
173
201
  startVibrato(channel: any, note: any, startTime: any): void;
174
- createNote(channel: any, instrumentKey: any, noteNumber: any, velocity: any, startTime: any, isSF3: any): Promise<Note>;
202
+ createNote(channel: any, instrumentKey: any, noteNumber: any, velocity: any, startTime: any, portamento: any, isSF3: any): Promise<Note>;
175
203
  calcBank(channel: any, channelNumber: any): any;
176
- scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any): Promise<void>;
177
- noteOn(channelNumber: any, noteNumber: any, velocity: any): Promise<void>;
178
- scheduleNoteRelease(channelNumber: any, noteNumber: any, _velocity: any, stopTime: any, stopPedal?: boolean): Promise<any> | undefined;
179
- releaseNote(channelNumber: any, noteNumber: any, velocity: any): Promise<any> | undefined;
204
+ scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any, portamento: any): Promise<void>;
205
+ noteOn(channelNumber: any, noteNumber: any, velocity: any, portamento: any): Promise<void>;
206
+ stopNote(stopTime: any, endTime: any, scheduledNotes: any, index: any): Promise<any>;
207
+ scheduleNoteRelease(channelNumber: any, noteNumber: any, _velocity: any, stopTime: any, portamentoNoteNumber: any, force: any): Promise<any> | undefined;
208
+ releaseNote(channelNumber: any, noteNumber: any, velocity: any, portamentoNoteNumber: any): Promise<any> | undefined;
180
209
  releaseSustainPedal(channelNumber: any, halfVelocity: any): any[];
181
210
  releaseSostenutoPedal(channelNumber: any, halfVelocity: any): any[];
182
211
  handleMIDIMessage(statusByte: any, data1: any, data2: any): void | Promise<any>;
@@ -184,7 +213,33 @@ export class MidyGM2 {
184
213
  handleChannelPressure(channelNumber: any, pressure: any): void;
185
214
  handlePitchBendMessage(channelNumber: any, lsb: any, msb: any): void;
186
215
  setPitchBend(channelNumber: any, pitchBend: any): void;
187
- handleControlChange(channelNumber: any, controller: any, value: any): void | Promise<void>;
216
+ createControlChangeHandlers(): {
217
+ 0: (channelNumber: any, msb: any) => void;
218
+ 1: (channelNumber: any, modulation: any) => void;
219
+ 5: (channelNumber: any, portamentoTime: any) => void;
220
+ 6: (channelNumber: any, value: any) => void;
221
+ 7: (channelNumber: any, volume: any) => void;
222
+ 10: (channelNumber: any, pan: any) => void;
223
+ 11: (channelNumber: any, expression: any) => void;
224
+ 32: (channelNumber: any, lsb: any) => void;
225
+ 38: (channelNumber: any, value: any) => void;
226
+ 64: (channelNumber: any, value: any) => void;
227
+ 65: (channelNumber: any, value: any) => void;
228
+ 66: (channelNumber: any, value: any) => void;
229
+ 67: (channelNumber: any, softPedal: any) => void;
230
+ 91: (channelNumber: any, reverbSendLevel: any) => void;
231
+ 93: (channelNumber: any, chorusSendLevel: any) => void;
232
+ 100: (channelNumber: any, value: any) => void;
233
+ 101: (channelNumber: any, value: any) => void;
234
+ 120: (channelNumber: any) => Promise<void>;
235
+ 121: (channelNumber: any) => void;
236
+ 123: (channelNumber: any) => Promise<void>;
237
+ 124: () => void;
238
+ 125: () => void;
239
+ 126: () => void;
240
+ 127: () => void;
241
+ };
242
+ handleControlChange(channelNumber: any, controller: any, value: any): void;
188
243
  setBankMSB(channelNumber: any, msb: any): void;
189
244
  updateModulation(channel: any): void;
190
245
  setModulationDepth(channelNumber: any, modulation: any): void;
@@ -198,7 +253,7 @@ export class MidyGM2 {
198
253
  setExpression(channelNumber: any, expression: any): void;
199
254
  setBankLSB(channelNumber: any, lsb: any): void;
200
255
  dataEntryLSB(channelNumber: any, value: any): void;
201
- updateChannelGain(channel: any): void;
256
+ updateChannelVolume(channel: any): void;
202
257
  setSustainPedal(channelNumber: any, value: any): void;
203
258
  setPortamento(channelNumber: any, value: any): void;
204
259
  setReverbSendLevel(channelNumber: any, reverbSendLevel: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"AAwBA;IAkCE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF;;;;;;;;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DAIC;IAED,iEAEC;IAED,iDAIC;IAED;;;MAMC;IAED,2CAIC;IAED,yDAIC;IAED,+CAEC;IAED,mDAGC;IAED,sCAUC;IAED,sDAMC;IAGD,oDAEC;IAED,mEAWC;IAED,mEAWC;IAED,wDAWC;IAED,uDAGC;IAED,kFAeC;IAED,2DAMC;IAED,oCAqBC;IAED,gDAEC;IAED,gDAEC;IAED,mDAGC;IAED,oDAaC;IAED,kDAKC;IAED,iEAOC;IAED,8CAKC;IAED,yDAMC;IAED,gDAKC;IAED,6DAMC;IAED,wDAKC;IAED,6EAKC;IAED,+CAEC;IAED,8CAEC;IAED,+CAEC;IAED,gBAEC;IAED,eAEC;IAED,eAEC;IAED,eAEC;IAED,4DAmBC;IAED,oBAQC;IAED,oBAQC;IAED,yDAiDC;IAED,yCAGC;IAED,mCAQC;IAED,6CAGC;IAED,2CAMC;IAED,+CAGC;IAED,+CAMC;IAED,mDAeC;IAED,4CAOC;IAED,+BAKC;IAED,qDAiBC;IAED,gCAMC;IAED,kCAEC;IA6BD,4CAEC;IAED,4CAaC;IAED,+BAiBC;IAED,wFAKC;IAED,mCAQC;IAED,qCAEC;IAED,oCAUC;IAED,sCAEC;IAED,oCAaC;IAED,sCAEC;IAED,wCAWC;IAED,0CAEC;IAED,wCAEC;IAED,6BASC;IAED,0DAUC;CACF;AAhyDD;IAUE,gFAKC;IAdD,kBAAa;IACb,gBAAW;IACX,gBAAW;IACX,iBAAY;IACZ,mBAAc;IACd,qBAAgB;IAChB,gBAAW;IACX,kBAAa;IAGX,gBAA4B;IAC5B,cAAwB;IACxB,eAA0B;IAC1B,mBAAkC;CAErC"}
1
+ {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"AAwBA;IAkCE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF;;;;;;;;;;;MAWE;IAEF;;;;;;;MAOE;IAgCF;;;;;OAYC;IAvHD,qBAAmB;IACnB,kBAAc;IACd,yBAA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