@marmooo/midy 0.2.0 → 0.2.2

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/esm/midy-GM1.js CHANGED
@@ -14,7 +14,7 @@ class Note {
14
14
  writable: true,
15
15
  value: void 0
16
16
  });
17
- Object.defineProperty(this, "volumeNode", {
17
+ Object.defineProperty(this, "volumeEnvelopeNode", {
18
18
  enumerable: true,
19
19
  configurable: true,
20
20
  writable: true,
@@ -593,16 +593,35 @@ export class MidyGM1 {
593
593
  cbToRatio(cb) {
594
594
  return Math.pow(10, cb / 200);
595
595
  }
596
+ rateToCent(rate) {
597
+ return 1200 * Math.log2(rate);
598
+ }
599
+ centToRate(cent) {
600
+ return Math.pow(2, cent / 1200);
601
+ }
596
602
  centToHz(cent) {
597
- return 8.176 * Math.pow(2, cent / 1200);
603
+ return 8.176 * this.centToRate(cent);
598
604
  }
599
- calcSemitoneOffset(channel) {
605
+ calcChannelDetune(channel) {
600
606
  const tuning = channel.coarseTuning + channel.fineTuning;
601
607
  const pitchWheel = channel.state.pitchWheel * 2 - 1;
602
- const pitchWheelSensitivity = channel.state.pitchWheelSensitivity * 128;
608
+ const pitchWheelSensitivity = channel.state.pitchWheelSensitivity * 12800;
603
609
  const pitch = pitchWheel * pitchWheelSensitivity;
604
610
  return tuning + pitch;
605
611
  }
612
+ updateDetune(channel) {
613
+ const now = this.audioContext.currentTime;
614
+ channel.scheduledNotes.forEach((noteList) => {
615
+ for (let i = 0; i < noteList.length; i++) {
616
+ const note = noteList[i];
617
+ if (!note)
618
+ continue;
619
+ note.bufferSource.detune
620
+ .cancelScheduledValues(now)
621
+ .setValueAtTime(channel.detune, now);
622
+ }
623
+ });
624
+ }
606
625
  setVolumeEnvelope(note) {
607
626
  const now = this.audioContext.currentTime;
608
627
  const { voiceParams, startTime } = note;
@@ -612,7 +631,7 @@ export class MidyGM1 {
612
631
  const volAttack = volDelay + voiceParams.volAttack;
613
632
  const volHold = volAttack + voiceParams.volHold;
614
633
  const volDecay = volHold + voiceParams.volDecay;
615
- note.volumeNode.gain
634
+ note.volumeEnvelopeNode.gain
616
635
  .cancelScheduledValues(now)
617
636
  .setValueAtTime(0, startTime)
618
637
  .setValueAtTime(1e-6, volDelay) // exponentialRampToValueAtTime() requires a non-zero value
@@ -620,32 +639,28 @@ export class MidyGM1 {
620
639
  .setValueAtTime(attackVolume, volHold)
621
640
  .linearRampToValueAtTime(sustainVolume, volDecay);
622
641
  }
623
- setPlaybackRate(note) {
642
+ setPitchEnvelope(note) {
624
643
  const now = this.audioContext.currentTime;
644
+ const { voiceParams } = note;
645
+ const baseRate = voiceParams.playbackRate;
625
646
  note.bufferSource.playbackRate
626
647
  .cancelScheduledValues(now)
627
- .setValueAtTime(note.voiceParams.playbackRate, now);
628
- }
629
- setPitch(channel, note) {
630
- const now = this.audioContext.currentTime;
631
- const { startTime } = note;
632
- const basePitch = this.calcSemitoneOffset(channel) * 100;
633
- note.bufferSource.detune
634
- .cancelScheduledValues(now)
635
- .setValueAtTime(basePitch, startTime);
636
- const modEnvToPitch = note.voiceParams.modEnvToPitch;
648
+ .setValueAtTime(baseRate, now);
649
+ const modEnvToPitch = voiceParams.modEnvToPitch;
637
650
  if (modEnvToPitch === 0)
638
651
  return;
652
+ const basePitch = this.rateToCent(baseRate);
639
653
  const peekPitch = basePitch + modEnvToPitch;
654
+ const peekRate = this.centToRate(peekPitch);
640
655
  const modDelay = startTime + voiceParams.modDelay;
641
656
  const modAttack = modDelay + voiceParams.modAttack;
642
657
  const modHold = modAttack + voiceParams.modHold;
643
658
  const modDecay = modHold + voiceParams.modDecay;
644
- note.bufferSource.detune
645
- .setValueAtTime(basePitch, modDelay)
646
- .exponentialRampToValueAtTime(peekPitch, modAttack)
647
- .setValueAtTime(peekPitch, modHold)
648
- .linearRampToValueAtTime(basePitch, modDecay);
659
+ note.bufferSource.playbackRate
660
+ .setValueAtTime(baseRate, modDelay)
661
+ .exponentialRampToValueAtTime(peekRate, modAttack)
662
+ .setValueAtTime(peekRate, modHold)
663
+ .linearRampToValueAtTime(baseRate, modDecay);
649
664
  }
650
665
  clampCutoffFrequency(frequency) {
651
666
  const minFrequency = 20; // min Hz of initialFilterFc
@@ -692,27 +707,26 @@ export class MidyGM1 {
692
707
  note.modulationLFO.connect(note.modulationDepth);
693
708
  note.modulationDepth.connect(note.bufferSource.detune);
694
709
  note.modulationLFO.connect(note.volumeDepth);
695
- note.volumeDepth.connect(note.volumeNode.gain);
710
+ note.volumeDepth.connect(note.volumeEnvelopeNode.gain);
696
711
  }
697
712
  async createNote(channel, voice, noteNumber, velocity, startTime, isSF3) {
698
713
  const state = channel.state;
699
714
  const voiceParams = voice.getAllParams(state.array);
700
715
  const note = new Note(noteNumber, velocity, startTime, voice, voiceParams);
701
716
  note.bufferSource = await this.createNoteBufferNode(voiceParams, isSF3);
702
- note.volumeNode = new GainNode(this.audioContext);
717
+ note.volumeEnvelopeNode = new GainNode(this.audioContext);
703
718
  note.filterNode = new BiquadFilterNode(this.audioContext, {
704
719
  type: "lowpass",
705
720
  Q: voiceParams.initialFilterQ / 10, // dB
706
721
  });
707
722
  this.setVolumeEnvelope(note);
708
723
  this.setFilterEnvelope(note);
709
- this.setPlaybackRate(note);
724
+ this.setPitchEnvelope(note);
710
725
  if (0 < state.modulationDepth) {
711
- this.setPitch(channel, note);
712
726
  this.startModulation(channel, note, startTime);
713
727
  }
714
728
  note.bufferSource.connect(note.filterNode);
715
- note.filterNode.connect(note.volumeNode);
729
+ note.filterNode.connect(note.volumeEnvelopeNode);
716
730
  note.bufferSource.start(startTime);
717
731
  return note;
718
732
  }
@@ -728,8 +742,8 @@ export class MidyGM1 {
728
742
  if (!voice)
729
743
  return;
730
744
  const note = await this.createNote(channel, voice, noteNumber, velocity, startTime, isSF3);
731
- note.volumeNode.connect(channel.gainL);
732
- note.volumeNode.connect(channel.gainR);
745
+ note.volumeEnvelopeNode.connect(channel.gainL);
746
+ note.volumeEnvelopeNode.connect(channel.gainR);
733
747
  const exclusiveClass = note.voiceParams.exclusiveClass;
734
748
  if (exclusiveClass !== 0) {
735
749
  if (this.exclusiveClassMap.has(exclusiveClass)) {
@@ -757,7 +771,7 @@ export class MidyGM1 {
757
771
  }
758
772
  stopNote(endTime, stopTime, scheduledNotes, index) {
759
773
  const note = scheduledNotes[index];
760
- note.volumeNode.gain
774
+ note.volumeEnvelopeNode.gain
761
775
  .cancelScheduledValues(endTime)
762
776
  .linearRampToValueAtTime(0, stopTime);
763
777
  note.ending = true;
@@ -768,8 +782,8 @@ export class MidyGM1 {
768
782
  note.bufferSource.onended = () => {
769
783
  scheduledNotes[index] = null;
770
784
  note.bufferSource.disconnect();
771
- note.volumeNode.disconnect();
772
785
  note.filterNode.disconnect();
786
+ note.volumeEnvelopeNode.disconnect();
773
787
  if (note.modulationDepth) {
774
788
  note.volumeDepth.disconnect();
775
789
  note.modulationDepth.disconnect();
@@ -856,29 +870,22 @@ export class MidyGM1 {
856
870
  setPitchBend(channelNumber, value) {
857
871
  const channel = this.channels[channelNumber];
858
872
  const state = channel.state;
873
+ const prev = state.pitchWheel * 2 - 1;
874
+ const next = (value - 8192) / 8192;
859
875
  state.pitchWheel = value / 16383;
860
- const pitchWheel = (value - 8192) / 8192;
861
- const detuneChange = pitchWheel * state.pitchWheelSensitivity * 12800;
862
- this.updateDetune(channel, detuneChange);
876
+ channel.detune += (next - prev) * state.pitchWheelSensitivity * 12800;
877
+ this.updateDetune(channel);
878
+ this.applyVoiceParams(channel, 14);
863
879
  }
864
880
  setModLfoToPitch(channel, note) {
865
881
  const now = this.audioContext.currentTime;
866
882
  const modLfoToPitch = note.voiceParams.modLfoToPitch;
867
- const modulationDepth = Math.abs(modLfoToPitch) +
883
+ const baseDepth = Math.abs(modLfoToPitch) +
868
884
  channel.state.modulationDepth;
869
- const modulationDepthSign = (0 < modLfoToPitch) ? 1 : -1;
885
+ const modulationDepth = baseDepth * Math.sign(modLfoToPitch);
870
886
  note.modulationDepth.gain
871
887
  .cancelScheduledValues(now)
872
- .setValueAtTime(modulationDepth * modulationDepthSign, now);
873
- }
874
- setModLfoToVolume(note) {
875
- const now = this.audioContext.currentTime;
876
- const modLfoToVolume = note.voiceParams.modLfoToVolume;
877
- const volumeDepth = this.cbToRatio(Math.abs(modLfoToVolume)) - 1;
878
- const volumeDepthSign = (0 < modLfoToVolume) ? 1 : -1;
879
- note.volumeDepth.gain
880
- .cancelScheduledValues(now)
881
- .setValueAtTime(volumeDepth * volumeDepthSign, now);
888
+ .setValueAtTime(modulationDepth, now);
882
889
  }
883
890
  setVibLfoToPitch(channel, note) {
884
891
  const now = this.audioContext.currentTime;
@@ -897,6 +904,15 @@ export class MidyGM1 {
897
904
  .cancelScheduledValues(now)
898
905
  .setValueAtTime(modLfoToFilterFc, now);
899
906
  }
907
+ setModLfoToVolume(note) {
908
+ const now = this.audioContext.currentTime;
909
+ const modLfoToVolume = note.voiceParams.modLfoToVolume;
910
+ const baseDepth = this.cbToRatio(Math.abs(modLfoToVolume)) - 1;
911
+ const volumeDepth = baseDepth * Math.sign(modLfoToVolume);
912
+ note.volumeDepth.gain
913
+ .cancelScheduledValues(now)
914
+ .setValueAtTime(volumeDepth, now);
915
+ }
900
916
  setDelayModLFO(note) {
901
917
  const now = this.audioContext.currentTime;
902
918
  const startTime = note.startTime;
@@ -996,7 +1012,7 @@ export class MidyGM1 {
996
1012
  noteVoiceParams[key] = voiceParams[key];
997
1013
  }
998
1014
  this.setFilterEnvelope(channel, note);
999
- this.setPitch(channel, note);
1015
+ this.setPitchEnvelope(note);
1000
1016
  }
1001
1017
  else if (volumeEnvelopeKeySet.has(key)) {
1002
1018
  if (appliedVolumeEnvelope)
@@ -1050,7 +1066,7 @@ export class MidyGM1 {
1050
1066
  note.modulationDepth.gain.setValueAtTime(channel.state.modulationDepth, now);
1051
1067
  }
1052
1068
  else {
1053
- this.setPitch(channel, note);
1069
+ this.setPitchEnvelope(note);
1054
1070
  this.startModulation(channel, note, now);
1055
1071
  }
1056
1072
  }
@@ -1159,59 +1175,49 @@ export class MidyGM1 {
1159
1175
  this.channels[channelNumber].dataMSB = value;
1160
1176
  this.handleRPN(channelNumber);
1161
1177
  }
1162
- updateDetune(channel, detune) {
1163
- const now = this.audioContext.currentTime;
1164
- channel.scheduledNotes.forEach((noteList) => {
1165
- for (let i = 0; i < noteList.length; i++) {
1166
- const note = noteList[i];
1167
- if (!note)
1168
- continue;
1169
- const { bufferSource } = note;
1170
- bufferSource.detune
1171
- .cancelScheduledValues(now)
1172
- .setValueAtTime(detune, now);
1173
- }
1174
- });
1175
- }
1176
1178
  handlePitchBendRangeRPN(channelNumber) {
1177
1179
  const channel = this.channels[channelNumber];
1178
1180
  this.limitData(channel, 0, 127, 0, 99);
1179
1181
  const pitchBendRange = channel.dataMSB + channel.dataLSB / 100;
1180
1182
  this.setPitchBendRange(channelNumber, pitchBendRange);
1181
1183
  }
1182
- setPitchBendRange(channelNumber, pitchWheelSensitivity) {
1184
+ setPitchBendRange(channelNumber, value) {
1183
1185
  const channel = this.channels[channelNumber];
1184
1186
  const state = channel.state;
1185
- state.pitchWheelSensitivity = pitchWheelSensitivity / 128;
1186
- const detune = (state.pitchWheel * 2 - 1) * pitchWheelSensitivity * 100;
1187
- this.updateDetune(channel, detune);
1187
+ const prev = state.pitchWheelSensitivity;
1188
+ const next = value / 128;
1189
+ state.pitchWheelSensitivity = next;
1190
+ channel.detune += (state.pitchWheel * 2 - 1) * (next - prev) * 12800;
1191
+ this.updateDetune(channel);
1188
1192
  this.applyVoiceParams(channel, 16);
1189
1193
  }
1190
1194
  handleFineTuningRPN(channelNumber) {
1191
1195
  const channel = this.channels[channelNumber];
1192
1196
  this.limitData(channel, 0, 127, 0, 127);
1193
- const fineTuning = (channel.dataMSB * 128 + channel.dataLSB - 8192) / 8192;
1197
+ const fineTuning = channel.dataMSB * 128 + channel.dataLSB;
1194
1198
  this.setFineTuning(channelNumber, fineTuning);
1195
1199
  }
1196
- setFineTuning(channelNumber, fineTuning) {
1200
+ setFineTuning(channelNumber, value) {
1197
1201
  const channel = this.channels[channelNumber];
1198
- const prevFineTuning = channel.fineTuning;
1199
- channel.fineTuning = fineTuning;
1200
- const detuneChange = channel.fineTuning - prevFineTuning;
1201
- this.updateDetune(channel, detuneChange);
1202
+ const prev = channel.fineTuning;
1203
+ const next = (value - 8192) / 8.192; // cent
1204
+ channel.fineTuning = next;
1205
+ channel.detune += next - prev;
1206
+ this.updateDetune(channel);
1202
1207
  }
1203
1208
  handleCoarseTuningRPN(channelNumber) {
1204
1209
  const channel = this.channels[channelNumber];
1205
1210
  this.limitDataMSB(channel, 0, 127);
1206
- const coarseTuning = channel.dataMSB - 64;
1207
- this.setFineTuning(channelNumber, coarseTuning);
1211
+ const coarseTuning = channel.dataMSB;
1212
+ this.setCoarseTuning(channelNumber, coarseTuning);
1208
1213
  }
1209
- setCoarseTuning(channelNumber, coarseTuning) {
1214
+ setCoarseTuning(channelNumber, value) {
1210
1215
  const channel = this.channels[channelNumber];
1211
- const prevCoarseTuning = channel.coarseTuning;
1212
- channel.coarseTuning = coarseTuning;
1213
- const detuneChange = channel.coarseTuning - prevCoarseTuning;
1214
- this.updateDetune(channel, detuneChange);
1216
+ const prev = channel.coarseTuning;
1217
+ const next = (value - 64) * 100; // cent
1218
+ channel.coarseTuning = next;
1219
+ channel.detune += next - prev;
1220
+ this.updateDetune(channel);
1215
1221
  }
1216
1222
  allSoundOff(channelNumber) {
1217
1223
  return this.stopChannelNotes(channelNumber, 0, true);
@@ -1324,6 +1330,7 @@ Object.defineProperty(MidyGM1, "channelSettings", {
1324
1330
  writable: true,
1325
1331
  value: {
1326
1332
  currentBufferSource: null,
1333
+ detune: 0,
1327
1334
  program: 0,
1328
1335
  bank: 0,
1329
1336
  dataMSB: 0,
package/esm/midy-GM2.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  export class MidyGM2 {
2
2
  static channelSettings: {
3
3
  currentBufferSource: null;
4
+ detune: number;
5
+ scaleOctaveTuningTable: any[];
6
+ pressureTable: Uint8Array<ArrayBuffer>;
7
+ keyBasedInstrumentControlTable: Int8Array<ArrayBuffer>;
4
8
  program: number;
5
9
  bank: number;
6
10
  bankMSB: number;
@@ -79,8 +83,8 @@ export class MidyGM2 {
79
83
  vibLfoToPitch: (channel: any, note: any, _prevValue: any) => void;
80
84
  modLfoToFilterFc: (channel: any, note: any, _prevValue: any) => void;
81
85
  modLfoToVolume: (channel: any, note: any) => void;
82
- chorusEffectsSend: (_channel: any, note: any, prevValue: any) => void;
83
- reverbEffectsSend: (_channel: any, note: any, prevValue: any) => void;
86
+ chorusEffectsSend: (channel: any, note: any, prevValue: any) => void;
87
+ reverbEffectsSend: (channel: any, note: any, prevValue: any) => void;
84
88
  delayModLFO: (_channel: any, note: any, _prevValue: any) => void;
85
89
  freqModLFO: (_channel: any, note: any, _prevValue: any) => void;
86
90
  delayVibLFO: (channel: any, note: any, prevValue: any) => void;
@@ -182,12 +186,16 @@ export class MidyGM2 {
182
186
  feedbackGains: any[];
183
187
  };
184
188
  cbToRatio(cb: any): number;
189
+ rateToCent(rate: any): number;
190
+ centToRate(cent: any): number;
185
191
  centToHz(cent: any): number;
186
- calcSemitoneOffset(channel: any): any;
192
+ calcChannelDetune(channel: any): any;
193
+ calcNoteDetune(channel: any, note: any): any;
194
+ updateDetune(channel: any): void;
195
+ getPortamentoTime(channel: any): number;
187
196
  setPortamentoStartVolumeEnvelope(channel: any, note: any): void;
188
- setVolumeEnvelope(note: any): void;
189
- setPlaybackRate(note: any): void;
190
- setPitch(channel: any, note: any): void;
197
+ setVolumeEnvelope(channel: any, note: any): void;
198
+ setPitchEnvelope(note: any): void;
191
199
  clampCutoffFrequency(frequency: any): number;
192
200
  setPortamentoStartFilterEnvelope(channel: any, note: any): void;
193
201
  setFilterEnvelope(channel: any, note: any): void;
@@ -204,15 +212,16 @@ export class MidyGM2 {
204
212
  releaseSostenutoPedal(channelNumber: any, halfVelocity: any): any[];
205
213
  handleMIDIMessage(statusByte: any, data1: any, data2: any): void | Promise<any>;
206
214
  handleProgramChange(channelNumber: any, program: any): void;
207
- handleChannelPressure(channelNumber: any, pressure: any): void;
215
+ handleChannelPressure(channelNumber: any, value: any): void;
216
+ setChannelPressure(channel: any, note: any): void;
208
217
  handlePitchBendMessage(channelNumber: any, lsb: any, msb: any): void;
209
218
  setPitchBend(channelNumber: any, value: any): void;
210
219
  setModLfoToPitch(channel: any, note: any): void;
211
- setModLfoToVolume(note: any): void;
212
- setChorusEffectsSend(note: any, prevValue: any): void;
213
- setReverbEffectsSend(note: any, prevValue: any): void;
214
220
  setVibLfoToPitch(channel: any, note: any): void;
215
- setModLfoToFilterFc(note: any): void;
221
+ setModLfoToFilterFc(channel: any, note: any): void;
222
+ setModLfoToVolume(channel: any, note: any): void;
223
+ setReverbEffectsSend(channel: any, note: any, prevValue: any): void;
224
+ setChorusEffectsSend(channel: any, note: any, prevValue: any): void;
216
225
  setDelayModLFO(note: any): void;
217
226
  setFreqModLFO(note: any): void;
218
227
  createVoiceParamsHandlers(): {
@@ -220,14 +229,14 @@ export class MidyGM2 {
220
229
  vibLfoToPitch: (channel: any, note: any, _prevValue: any) => void;
221
230
  modLfoToFilterFc: (channel: any, note: any, _prevValue: any) => void;
222
231
  modLfoToVolume: (channel: any, note: any) => void;
223
- chorusEffectsSend: (_channel: any, note: any, prevValue: any) => void;
224
- reverbEffectsSend: (_channel: any, note: any, prevValue: any) => void;
232
+ chorusEffectsSend: (channel: any, note: any, prevValue: any) => void;
233
+ reverbEffectsSend: (channel: any, note: any, prevValue: any) => void;
225
234
  delayModLFO: (_channel: any, note: any, _prevValue: any) => void;
226
235
  freqModLFO: (_channel: any, note: any, _prevValue: any) => void;
227
236
  delayVibLFO: (channel: any, note: any, prevValue: any) => void;
228
237
  freqVibLFO: (channel: any, note: any, _prevValue: any) => void;
229
238
  };
230
- getControllerState(channel: any, noteNumber: any, velocity: any): Float32Array;
239
+ getControllerState(channel: any, noteNumber: any, velocity: any): Float32Array<any>;
231
240
  applyVoiceParams(channel: any, controllerType: any): void;
232
241
  createControlChangeHandlers(): {
233
242
  0: (channelNumber: any, msb: any) => void;
@@ -260,11 +269,13 @@ export class MidyGM2 {
260
269
  updateModulation(channel: any): void;
261
270
  setModulationDepth(channelNumber: any, modulation: any): void;
262
271
  setPortamentoTime(channelNumber: any, portamentoTime: any): void;
272
+ setKeyBasedVolume(channel: any): void;
263
273
  setVolume(channelNumber: any, volume: any): void;
264
274
  panToGain(pan: any): {
265
275
  gainLeft: number;
266
276
  gainRight: number;
267
277
  };
278
+ setKeyBasedPan(channel: any): void;
268
279
  setPan(channelNumber: any, pan: any): void;
269
280
  setExpression(channelNumber: any, expression: any): void;
270
281
  setBankLSB(channelNumber: any, lsb: any): void;
@@ -272,23 +283,22 @@ export class MidyGM2 {
272
283
  updateChannelVolume(channel: any): void;
273
284
  setSustainPedal(channelNumber: any, value: any): void;
274
285
  setPortamento(channelNumber: any, value: any): void;
275
- setReverbSendLevel(channelNumber: any, reverbSendLevel: any): void;
276
- setChorusSendLevel(channelNumber: any, chorusSendLevel: any): void;
277
286
  setSostenutoPedal(channelNumber: any, value: any): void;
278
287
  setSoftPedal(channelNumber: any, softPedal: any): void;
288
+ setReverbSendLevel(channelNumber: any, reverbSendLevel: any): void;
289
+ setChorusSendLevel(channelNumber: any, chorusSendLevel: any): void;
279
290
  limitData(channel: any, minMSB: any, maxMSB: any, minLSB: any, maxLSB: any): void;
280
291
  limitDataMSB(channel: any, minMSB: any, maxMSB: any): void;
281
292
  handleRPN(channelNumber: any): void;
282
293
  setRPNMSB(channelNumber: any, value: any): void;
283
294
  setRPNLSB(channelNumber: any, value: any): void;
284
295
  dataEntryMSB(channelNumber: any, value: any): void;
285
- updateDetune(channel: any, detune: any): void;
286
296
  handlePitchBendRangeRPN(channelNumber: any): void;
287
- setPitchBendRange(channelNumber: any, pitchWheelSensitivity: any): void;
297
+ setPitchBendRange(channelNumber: any, value: any): void;
288
298
  handleFineTuningRPN(channelNumber: any): void;
289
- setFineTuning(channelNumber: any, fineTuning: any): void;
299
+ setFineTuning(channelNumber: any, value: any): void;
290
300
  handleCoarseTuningRPN(channelNumber: any): void;
291
- setCoarseTuning(channelNumber: any, coarseTuning: any): void;
301
+ setCoarseTuning(channelNumber: any, value: any): void;
292
302
  handleModulationDepthRangeRPN(channelNumber: any): void;
293
303
  setModulationDepthRange(channelNumber: any, modulationDepthRange: any): void;
294
304
  allSoundOff(channelNumber: any): Promise<void>;
@@ -305,9 +315,9 @@ export class MidyGM2 {
305
315
  handleMasterVolumeSysEx(data: any): void;
306
316
  setMasterVolume(volume: any): void;
307
317
  handleMasterFineTuningSysEx(data: any): void;
308
- setMasterFineTuning(fineTuning: any): void;
318
+ setMasterFineTuning(value: any): void;
309
319
  handleMasterCoarseTuningSysEx(data: any): void;
310
- setMasterCoarseTuning(coarseTuning: any): void;
320
+ setMasterCoarseTuning(value: any): void;
311
321
  handleGlobalParameterControlSysEx(data: any): void;
312
322
  handleReverbParameterSysEx(data: any): void;
313
323
  setReverbType(type: any): void;
@@ -326,6 +336,11 @@ export class MidyGM2 {
326
336
  getChorusFeedback(value: any): number;
327
337
  setChorusSendToReverb(value: any): void;
328
338
  getChorusSendToReverb(value: any): number;
339
+ getChannelBitmap(data: any): any[];
340
+ handleScaleOctaveTuning1ByteFormatSysEx(data: any): void;
341
+ handleChannelPressureSysEx(data: any): void;
342
+ getKeyBasedInstrumentControlValue(channel: any, keyNumber: any, controllerType: any): number;
343
+ handleKeyBasedInstrumentControlSysEx(data: any): void;
329
344
  handleExclusiveMessage(data: any): void;
330
345
  handleSysEx(data: any): void;
331
346
  scheduleTask(callback: any, startTime: any): Promise<any>;
@@ -334,7 +349,10 @@ declare class Note {
334
349
  constructor(noteNumber: any, velocity: any, startTime: any, voice: any, voiceParams: any);
335
350
  bufferSource: any;
336
351
  filterNode: any;
352
+ volumeEnvelopeNode: any;
337
353
  volumeNode: any;
354
+ gainL: any;
355
+ gainR: any;
338
356
  volumeDepth: any;
339
357
  modulationLFO: any;
340
358
  modulationDepth: any;
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"AA8GA;IAmCE;;;;;;;;;;;;;MAaE;IAEF;;;;;;;MAOE;IAgCF;;;;;OAaC;IArGD,qBAAmB;IACnB,kBAAc;IACd,yBAAqB;IACrB,2BAAuB;IACvB;;;MAGE;IACF;;;;;;MAME;IACF,cAAa;IACb,cAAa;IACb,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,iCAA8B;IA0B9B;;;;;MA4BE;IAGA,kBAAgC;IAChC;;;;;MAAqD;IACrD,gBAA4C;IAC5C;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IACjD;;;MAA8D;IAC9D;;;;;;;;MAAyD;IAO3D,4BAMC;IAED,mCAWC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAcC;IAED,6DA2BC;IAED,iEAUC;IAED,2CAcC;IAED,2EAuDC;IAED,mCAOC;IAED,0BAkDC;IAED,uDAEC;IAED,wDAEC;IAED;;;MAoGC;IAED,+EAoBC;IAED,qDAKC;IAED,uBAKC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,uDASC;IAED,6CAQC;IAED,kFAuBC;IAED;;;;MAWC;IAED,gFAUC;IAED,mFAYC;IAED,sGAcC;IAID;;;MA8BC;IAED;;;;;;;;MA0CC;IAED,2BAEC;IAED,4BAEC;IAED,sCAOC;IAED,gEAWC;IAED,mCAgBC;IAED,iCAKC;IAED,wCAmBC;IAED,6CAIC;IAED,gEAsBC;I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AEC;IAED,6BASC;IAED,0DAUC;CACF;AAjwED;IAaE,0FAMC;IAlBD,kBAAa;IACb,gBAAW;IACX,gBAAW;IACX,iBAAY;IACZ,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":"AAiHA;IAmCE;;;;;;;;;;;;;;;;;MAiBE;IAEF;;;;;;;MAOE;IAgCF;;;;;OAaC;IAzGD,qBAAmB;IACnB,kBAAc;IACd,yBAAqB;IACrB,2BAAuB;IACvB;;;MAGE;IACF;;;;;;MAME;IACF,cAAa;IACb,cAAa;IACb,0BAAwB;IACxB,kBAAc;IACd,mBAAiB;IACjB,kBAAc;IACd,mBAAe;IACf,kBAAgB;IAChB,sBAA2C;IAC3C,mBAAkB;IAClB,mBAAkB;IAClB,kBAAiB;IACjB,oBAAmB;IACnB,mBAAkB;IAClB,gBAAc;IACd,mBAAiB;IACjB,oBAAkB;IAClB,iCAA8B;IA8B9B;;;;;MA4BE;IAGA,kBAAgC;IAChC;;;;;MAAqD;IACrD,gBAA4C;IAC5C;;;;;;;;;;;MAA2D;IAC3D;;;;;;;;;;;;;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IACjD;;;MAA8D;IAC9D;;;;;;;;MAAyD;IAO3D,4BAMC;IAED,mCAWC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAcC;IAED,6DA2BC;IAED,iEAUC;IAED,2CAcC;IAED,2EAuDC;IAED,mCAOC;IAED,0BAkDC;IAED,uDAEC;IAED,wDAEC;IAED;;;MAoGC;IAED,+EAoBC;IAED,qDAKC;IAED,uBAKC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wB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