@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
package/esm/midy-GM1.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseMidi } from "./deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.js";
2
- import { parse, SoundFont, } from "./deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.4/+esm.js";
2
+ import { parse, SoundFont, } from "./deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.js";
3
3
  class Note {
4
4
  constructor(noteNumber, velocity, startTime, instrumentKey) {
5
5
  Object.defineProperty(this, "bufferSource", {
@@ -162,6 +162,7 @@ export class MidyGM1 {
162
162
  });
163
163
  this.audioContext = audioContext;
164
164
  this.masterGain = new GainNode(audioContext);
165
+ this.controlChangeHandlers = this.createControlChangeHandlers();
165
166
  this.channels = this.createChannels(audioContext);
166
167
  this.masterGain.connect(audioContext.destination);
167
168
  this.GM1SystemOn();
@@ -176,12 +177,14 @@ export class MidyGM1 {
176
177
  addSoundFont(soundFont) {
177
178
  const index = this.soundFonts.length;
178
179
  this.soundFonts.push(soundFont);
179
- soundFont.parsed.presetHeaders.forEach((presetHeader) => {
180
+ const presetHeaders = soundFont.parsed.presetHeaders;
181
+ for (let i = 0; i < presetHeaders.length; i++) {
182
+ const presetHeader = presetHeaders[i];
180
183
  if (!presetHeader.presetName.startsWith("\u0000")) { // TODO: Only SF3 generated by PolyPone?
181
184
  const banks = this.soundFontTable[presetHeader.preset];
182
185
  banks.set(presetHeader.bank, index);
183
186
  }
184
- });
187
+ }
185
188
  }
186
189
  async loadSoundFont(soundFontUrl) {
187
190
  const response = await fetch(soundFontUrl);
@@ -226,27 +229,25 @@ export class MidyGM1 {
226
229
  return channels;
227
230
  }
228
231
  async createNoteBuffer(instrumentKey, isSF3) {
232
+ const sampleStart = instrumentKey.start;
229
233
  const sampleEnd = instrumentKey.sample.length + instrumentKey.end;
230
234
  if (isSF3) {
231
- const sample = new Uint8Array(instrumentKey.sample.length);
232
- sample.set(instrumentKey.sample);
235
+ const sample = instrumentKey.sample.slice(sampleStart, sampleEnd);
233
236
  const audioBuffer = await this.audioContext.decodeAudioData(sample.buffer);
234
- for (let channel = 0; channel < audioBuffer.numberOfChannels; channel++) {
235
- const channelData = audioBuffer.getChannelData(channel);
236
- channelData.set(channelData.subarray(0, sampleEnd));
237
- }
238
237
  return audioBuffer;
239
238
  }
240
239
  else {
241
- const sample = instrumentKey.sample.subarray(0, sampleEnd);
242
- const floatSample = this.convertToFloat32Array(sample);
240
+ const sample = instrumentKey.sample.subarray(sampleStart, sampleEnd);
243
241
  const audioBuffer = new AudioBuffer({
244
242
  numberOfChannels: 1,
245
243
  length: sample.length,
246
244
  sampleRate: instrumentKey.sampleRate,
247
245
  });
248
246
  const channelData = audioBuffer.getChannelData(0);
249
- channelData.set(floatSample);
247
+ const int16Array = new Int16Array(sample.buffer);
248
+ for (let i = 0; i < int16Array.length; i++) {
249
+ channelData[i] = int16Array[i] / 32768;
250
+ }
250
251
  return audioBuffer;
251
252
  }
252
253
  }
@@ -262,14 +263,6 @@ export class MidyGM1 {
262
263
  }
263
264
  return bufferSource;
264
265
  }
265
- convertToFloat32Array(uint8Array) {
266
- const int16Array = new Int16Array(uint8Array.buffer);
267
- const float32Array = new Float32Array(int16Array.length);
268
- for (let i = 0; i < int16Array.length; i++) {
269
- float32Array[i] = int16Array[i] / 32768;
270
- }
271
- return float32Array;
272
- }
273
266
  async scheduleTimelineEvents(t, offset, queueIndex) {
274
267
  while (queueIndex < this.timeline.length) {
275
268
  const event = this.timeline[queueIndex];
@@ -380,9 +373,11 @@ export class MidyGM1 {
380
373
  bank: this.channels[i].bank,
381
374
  };
382
375
  }
383
- midi.tracks.forEach((track) => {
376
+ for (let i = 0; i < midi.tracks.length; i++) {
377
+ const track = midi.tracks[i];
384
378
  let currentTicks = 0;
385
- track.forEach((event) => {
379
+ for (let j = 0; j < track.length; j++) {
380
+ const event = track[j];
386
381
  currentTicks += event.deltaTime;
387
382
  event.ticks = currentTicks;
388
383
  switch (event.type) {
@@ -402,8 +397,8 @@ export class MidyGM1 {
402
397
  }
403
398
  delete event.deltaTime;
404
399
  timeline.push(event);
405
- });
406
- });
400
+ }
401
+ }
407
402
  const priority = {
408
403
  controller: 0,
409
404
  sysEx: 1,
@@ -428,7 +423,7 @@ export class MidyGM1 {
428
423
  }
429
424
  return { instruments, timeline };
430
425
  }
431
- async stopChannelNotes(channelNumber, velocity, stopPedal) {
426
+ async stopChannelNotes(channelNumber, velocity, force) {
432
427
  const now = this.audioContext.currentTime;
433
428
  const channel = this.channels[channelNumber];
434
429
  channel.scheduledNotes.forEach((noteList) => {
@@ -436,16 +431,16 @@ export class MidyGM1 {
436
431
  const note = noteList[i];
437
432
  if (!note)
438
433
  continue;
439
- const promise = this.scheduleNoteRelease(channelNumber, note.noteNumber, velocity, now, stopPedal);
434
+ const promise = this.scheduleNoteRelease(channelNumber, note.noteNumber, velocity, now, force);
440
435
  this.notePromises.push(promise);
441
436
  }
442
437
  });
443
438
  channel.scheduledNotes.clear();
444
439
  await Promise.all(this.notePromises);
445
440
  }
446
- stopNotes(velocity, stopPedal) {
441
+ stopNotes(velocity, force) {
447
442
  for (let i = 0; i < this.channels.length; i++) {
448
- this.stopChannelNotes(i, velocity, stopPedal);
443
+ this.stopChannelNotes(i, velocity, force);
449
444
  }
450
445
  return Promise.all(this.notePromises);
451
446
  }
@@ -622,7 +617,7 @@ export class MidyGM1 {
622
617
  note.volumeNode = new GainNode(this.audioContext);
623
618
  note.filterNode = new BiquadFilterNode(this.audioContext, {
624
619
  type: "lowpass",
625
- Q: instrumentKey.initialFilterQ / 10 * channel.filterResonance, // dB
620
+ Q: instrumentKey.initialFilterQ / 10, // dB
626
621
  });
627
622
  this.setVolumeEnvelope(note);
628
623
  this.setFilterEnvelope(note);
@@ -635,7 +630,7 @@ export class MidyGM1 {
635
630
  }
636
631
  note.bufferSource.connect(note.filterNode);
637
632
  note.filterNode.connect(note.volumeNode);
638
- note.bufferSource.start(startTime, instrumentKey.start / instrumentKey.sampleRate);
633
+ note.bufferSource.start(startTime);
639
634
  return note;
640
635
  }
641
636
  async scheduleNoteOn(channelNumber, noteNumber, velocity, startTime) {
@@ -646,7 +641,7 @@ export class MidyGM1 {
646
641
  return;
647
642
  const soundFont = this.soundFonts[soundFontIndex];
648
643
  const isSF3 = soundFont.parsed.info.version.major === 3;
649
- const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber);
644
+ const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber, velocity);
650
645
  if (!instrumentKey)
651
646
  return;
652
647
  const note = await this.createNote(channel, instrumentKey, noteNumber, velocity, startTime, isSF3);
@@ -664,9 +659,38 @@ export class MidyGM1 {
664
659
  const now = this.audioContext.currentTime;
665
660
  return this.scheduleNoteOn(channelNumber, noteNumber, velocity, now);
666
661
  }
667
- scheduleNoteRelease(channelNumber, noteNumber, _velocity, stopTime, stopPedal = false) {
662
+ stopNote(stopTime, endTime, scheduledNotes, index) {
663
+ const note = scheduledNotes[index];
664
+ note.volumeNode.gain
665
+ .cancelScheduledValues(stopTime)
666
+ .linearRampToValueAtTime(0, endTime);
667
+ note.ending = true;
668
+ this.scheduleTask(() => {
669
+ note.bufferSource.loop = false;
670
+ }, endTime);
671
+ return new Promise((resolve) => {
672
+ note.bufferSource.onended = () => {
673
+ scheduledNotes[index] = null;
674
+ note.bufferSource.disconnect();
675
+ note.volumeNode.disconnect();
676
+ note.filterNode.disconnect();
677
+ if (note.modulationDepth) {
678
+ note.volumeDepth.disconnect();
679
+ note.modulationDepth.disconnect();
680
+ note.modulationLFO.stop();
681
+ }
682
+ if (note.vibratoDepth) {
683
+ note.vibratoDepth.disconnect();
684
+ note.vibratoLFO.stop();
685
+ }
686
+ resolve();
687
+ };
688
+ note.bufferSource.stop(endTime);
689
+ });
690
+ }
691
+ scheduleNoteRelease(channelNumber, noteNumber, _velocity, stopTime, force) {
668
692
  const channel = this.channels[channelNumber];
669
- if (stopPedal && channel.sustainPedal)
693
+ if (!force && channel.sustainPedal)
670
694
  return;
671
695
  if (!channel.scheduledNotes.has(noteNumber))
672
696
  return;
@@ -678,33 +702,11 @@ export class MidyGM1 {
678
702
  if (note.ending)
679
703
  continue;
680
704
  const volEndTime = stopTime + note.instrumentKey.volRelease;
681
- note.volumeNode.gain
682
- .cancelScheduledValues(stopTime)
683
- .linearRampToValueAtTime(0, volEndTime);
684
705
  const modRelease = stopTime + note.instrumentKey.modRelease;
685
706
  note.filterNode.frequency
686
707
  .cancelScheduledValues(stopTime)
687
708
  .linearRampToValueAtTime(0, modRelease);
688
- note.ending = true;
689
- this.scheduleTask(() => {
690
- note.bufferSource.loop = false;
691
- }, stopTime);
692
- return new Promise((resolve) => {
693
- note.bufferSource.onended = () => {
694
- scheduledNotes[i] = null;
695
- note.bufferSource.disconnect();
696
- note.volumeNode.disconnect();
697
- note.filterNode.disconnect();
698
- if (note.volumeDepth)
699
- note.volumeDepth.disconnect();
700
- if (note.modulationDepth)
701
- note.modulationDepth.disconnect();
702
- if (note.modulationLFO)
703
- note.modulationLFO.stop();
704
- resolve();
705
- };
706
- note.bufferSource.stop(volEndTime);
707
- });
709
+ this.stopNote(stopTime, volEndTime, scheduledNotes, i);
708
710
  }
709
711
  }
710
712
  releaseNote(channelNumber, noteNumber, velocity) {
@@ -762,34 +764,29 @@ export class MidyGM1 {
762
764
  channel.pitchBendRange * 100;
763
765
  this.updateDetune(channel, detuneChange);
764
766
  }
767
+ createControlChangeHandlers() {
768
+ return {
769
+ 1: this.setModulationDepth,
770
+ 6: this.dataEntryMSB,
771
+ 7: this.setVolume,
772
+ 10: this.setPan,
773
+ 11: this.setExpression,
774
+ 38: this.dataEntryLSB,
775
+ 64: this.setSustainPedal,
776
+ 100: this.setRPNLSB,
777
+ 101: this.setRPNMSB,
778
+ 120: this.allSoundOff,
779
+ 121: this.resetAllControllers,
780
+ 123: this.allNotesOff,
781
+ };
782
+ }
765
783
  handleControlChange(channelNumber, controller, value) {
766
- switch (controller) {
767
- case 1:
768
- return this.setModulationDepth(channelNumber, value);
769
- case 6:
770
- return this.dataEntryMSB(channelNumber, value);
771
- case 7:
772
- return this.setVolume(channelNumber, value);
773
- case 10:
774
- return this.setPan(channelNumber, value);
775
- case 11:
776
- return this.setExpression(channelNumber, value);
777
- case 38:
778
- return this.dataEntryLSB(channelNumber, value);
779
- case 64:
780
- return this.setSustainPedal(channelNumber, value);
781
- case 100:
782
- return this.setRPNLSB(channelNumber, value);
783
- case 101:
784
- return this.setRPNMSB(channelNumber, value);
785
- case 120:
786
- return this.allSoundOff(channelNumber);
787
- case 121:
788
- return this.resetAllControllers(channelNumber);
789
- case 123:
790
- return this.allNotesOff(channelNumber);
791
- default:
792
- console.warn(`Unsupported Control change: controller=${controller} value=${value}`);
784
+ const handler = this.controlChangeHandlers[controller];
785
+ if (handler) {
786
+ handler.call(this, channelNumber, value);
787
+ }
788
+ else {
789
+ console.warn(`Unsupported Control change: controller=${controller} value=${value}`);
793
790
  }
794
791
  }
795
792
  updateModulation(channel) {
@@ -818,7 +815,7 @@ export class MidyGM1 {
818
815
  setVolume(channelNumber, volume) {
819
816
  const channel = this.channels[channelNumber];
820
817
  channel.volume = volume / 127;
821
- this.updateChannelGain(channel);
818
+ this.updateChannelVolume(channel);
822
819
  }
823
820
  panToGain(pan) {
824
821
  const theta = Math.PI / 2 * Math.max(0, pan - 1) / 126;
@@ -830,18 +827,18 @@ export class MidyGM1 {
830
827
  setPan(channelNumber, pan) {
831
828
  const channel = this.channels[channelNumber];
832
829
  channel.pan = pan;
833
- this.updateChannelGain(channel);
830
+ this.updateChannelVolume(channel);
834
831
  }
835
832
  setExpression(channelNumber, expression) {
836
833
  const channel = this.channels[channelNumber];
837
834
  channel.expression = expression / 127;
838
- this.updateChannelGain(channel);
835
+ this.updateChannelVolume(channel);
839
836
  }
840
837
  dataEntryLSB(channelNumber, value) {
841
838
  this.channels[channelNumber].dataLSB = value;
842
839
  this.handleRPN(channelNumber, 0);
843
840
  }
844
- updateChannelGain(channel) {
841
+ updateChannelVolume(channel) {
845
842
  const now = this.audioContext.currentTime;
846
843
  const volume = channel.volume * channel.expression;
847
844
  const { gainLeft, gainRight } = this.panToGain(channel.pan);
@@ -994,11 +991,12 @@ export class MidyGM1 {
994
991
  }
995
992
  }
996
993
  GM1SystemOn() {
997
- this.channels.forEach((channel) => {
994
+ for (let i = 0; i < this.channels.length; i++) {
995
+ const channel = this.channels[i];
998
996
  channel.bankMSB = 0;
999
997
  channel.bankLSB = 0;
1000
998
  channel.bank = 0;
1001
- });
999
+ }
1002
1000
  this.channels[9].bankMSB = 1;
1003
1001
  this.channels[9].bank = 128;
1004
1002
  }
package/esm/midy-GM2.d.ts CHANGED
@@ -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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AED,8DAIC;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,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