@marmooo/midy 0.1.4 → 0.1.5

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 +29 -1
  5. package/esm/midy-GM1.d.ts.map +1 -1
  6. package/esm/midy-GM1.js +27 -32
  7. package/esm/midy-GM2.d.ts +53 -1
  8. package/esm/midy-GM2.d.ts.map +1 -1
  9. package/esm/midy-GM2.js +81 -79
  10. package/esm/midy-GMLite.d.ts +29 -1
  11. package/esm/midy-GMLite.d.ts.map +1 -1
  12. package/esm/midy-GMLite.js +27 -32
  13. package/esm/midy.d.ts +73 -1
  14. package/esm/midy.d.ts.map +1 -1
  15. package/esm/midy.js +104 -97
  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 +29 -1
  21. package/script/midy-GM1.d.ts.map +1 -1
  22. package/script/midy-GM1.js +27 -32
  23. package/script/midy-GM2.d.ts +53 -1
  24. package/script/midy-GM2.d.ts.map +1 -1
  25. package/script/midy-GM2.js +81 -79
  26. package/script/midy-GMLite.d.ts +29 -1
  27. package/script/midy-GMLite.d.ts.map +1 -1
  28. package/script/midy-GMLite.js +27 -32
  29. package/script/midy.d.ts +73 -1
  30. package/script/midy.d.ts.map +1 -1
  31. package/script/midy.js +104 -97
  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
@@ -1,15 +1,16 @@
1
1
  declare const _default: null;
2
2
  export default _default;
3
- declare class V {
3
+ declare const M: string[];
4
+ declare class B {
4
5
  constructor(e: any);
5
6
  parsed: any;
6
7
  getGenerators(e: any, t: any, n: any, r: any): any[];
7
8
  getPresetGenerators(e: any): any[];
8
9
  getInstrumentGenerators(e: any): any[];
9
- findInstrumentZone(e: any, t: any, n?: number): {} | undefined;
10
- findInstrument(e: any, t: any, n?: number): any;
10
+ findInstrumentZone(e: any, t: any, n: any): {} | undefined;
11
+ findInstrument(e: any, t: any, n: any): any;
11
12
  getInstrument(e: any, t: any): any;
12
- getInstrumentKey(e: any, t: any, n: any, r?: number): {
13
+ getInstrumentKey(e: any, t: any, n: any, r: any): {
13
14
  start: any;
14
15
  end: any;
15
16
  loopStart: any;
@@ -35,20 +36,12 @@ declare class V {
35
36
  modDecay: number;
36
37
  modSustain: number;
37
38
  modRelease: number;
38
- keynumToModEnvHold: any;
39
- keynumToModEnvDecay: any;
40
39
  volDelay: number;
41
40
  volAttack: number;
42
41
  volHold: number;
43
42
  volDecay: number;
44
43
  volSustain: number;
45
44
  volRelease: number;
46
- keynumToVolEnvHold: any;
47
- keynumToVolEnvDecay: any;
48
- keyRange: any;
49
- velRange: any;
50
- keynum: any;
51
- velocity: any;
52
45
  initialAttenuation: any;
53
46
  playbackRate: (e: any) => number;
54
47
  sample: any;
@@ -59,8 +52,9 @@ declare class V {
59
52
  } | null;
60
53
  getPresetNames(): {};
61
54
  }
62
- declare function I(e: any): {};
63
- declare namespace L {
55
+ declare function S(e: any): {};
56
+ declare function V(e: any): {};
57
+ declare namespace W {
64
58
  let startAddrsOffset: m;
65
59
  let endAddrsOffset: m;
66
60
  let startloopAddrsOffset: m;
@@ -114,7 +108,8 @@ declare namespace L {
114
108
  let exclusiveClass: m;
115
109
  let overridingRootKey: m;
116
110
  }
117
- declare function b(e: any, r?: {}): {
111
+ declare function L(e: any): boolean;
112
+ declare function p(e: any, r?: {}): {
118
113
  samples: any;
119
114
  presetHeaders: any[];
120
115
  presetZone: any[];
@@ -125,13 +120,13 @@ declare function b(e: any, r?: {}): {
125
120
  instrumentModulators: any[];
126
121
  instrumentGenerators: any[];
127
122
  sampleHeaders: any[];
128
- info: o;
123
+ info: s;
129
124
  samplingData: {
130
125
  offsetMSB: any;
131
126
  offsetLSB: any;
132
127
  };
133
128
  };
134
- declare function S(e: any): number;
129
+ declare function H(e: any): number;
135
130
  declare class m {
136
131
  constructor(e: any, t: any, n: any);
137
132
  min: any;
@@ -146,8 +141,9 @@ declare class d {
146
141
  hi: any;
147
142
  in(e: any): boolean;
148
143
  }
149
- declare class o {
150
- static parse(t: any, n: any): o;
144
+ declare class s {
145
+ static parse(t: any, n: any): s;
146
+ constructor(e: any, t: any, n: any, r: any, a: any, o: any, s: any, i: any, l: any, d: any, u: any);
151
147
  }
152
- export { V as SoundFont, I as createGeneratorObject, L as defaultInstrumentZone, b as parse, S as timecentToSecond };
148
+ export { M as RangeGeneratorNames, B as SoundFont, S as createInstrumentGeneratorObject, V as createPresetGeneratorObject, W as defaultInstrumentZone, L as isRangeGenerator, p as parse, H as timecentToSecond };
153
149
  //# sourceMappingURL=+esm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"+esm.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.6/+esm.js"],"names":[],"mappings":";;AAM0lV,0BAAyB;AAAugF;IAAQ,oBAA2H;IAAd,YAAa;IAAC,qDAAoJ;IAAA,mCAAoP;IAAA,uCAAwQ;IAAA,2DAAiP;IAAA,4CAAmX;IAAA,mCAAuL;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAA49D;IAAA,qBAAqK;CAAC;AAApoL,+BAA2R;AAAzd,+BAA8L;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAjO,oCAAmC;AAA7yE;;;;;;;;;;;;;;;;EAA27B;AAAorO,mCAAwC;AAAziR;IAAQ,oCAAyU;IAAnC,SAAU;IAAC,WAAY;IAAC,SAAU;IAAC,gBAAgE;CAAC;AAA19G;IAAqQ,wBAAsE;IAAnU,4BAAyN;IAApB,QAAS;IAAC,QAAS;IAAC,oBAAoC;CAAuE;AAAv5F;IAAshC,gCAAqa;IAAn7C,oGAA8gC;CAAsa"}
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
3
+ * Original file: /npm/@marmooo/soundfont-parser@0.0.6/esm/mod.js
4
+ *
5
+ * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6
+ */
7
+ class e {
8
+ constructor(e, t) { Object.defineProperty(this, "data", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "offset", { enumerable: !0, configurable: !0, writable: !0, value: t }); }
9
+ readString(e) { const t = this.data.subarray(this.offset, this.offset += e), n = String.fromCharCode(...Array.from(t)), r = n.indexOf("\0"); return r > 0 ? n.substring(0, r) : n; }
10
+ readWORD() { return this.data[this.offset++] | this.data[this.offset++] << 8; }
11
+ readDWORD(e = !1) { return e ? (this.data[this.offset++] << 24 | this.data[this.offset++] << 16 | this.data[this.offset++] << 8 | this.data[this.offset++]) >>> 0 : (this.data[this.offset++] | this.data[this.offset++] << 8 | this.data[this.offset++] << 16 | this.data[this.offset++] << 24) >>> 0; }
12
+ readByte() { return this.data[this.offset++]; }
13
+ readAt(e) { return this.data[this.offset + e]; }
14
+ readUInt8() { return this.readByte(); }
15
+ readInt8() { return this.readByte() << 24 >> 24; }
16
+ readUInt16() { return this.readWORD(); }
17
+ readInt16() { return this.readWORD() << 16 >> 16; }
18
+ readUInt32() { return this.readDWORD(); }
19
+ }
20
+ function t(t, n, a) { const o = new e(t, n), s = o.readString(4), i = o.readDWORD(a); return new r(s, i, o.offset); }
21
+ function n(e, n = 0, r, { padding: a = !0, bigEndian: o = !1 } = {}) { const s = [], i = r + n; let l = n; for (; l < i;) {
22
+ const r = t(e, l, o);
23
+ l = r.offset + r.size, a && 1 == (l - n & 1) && l++, s.push(r);
24
+ } return s; }
25
+ class r {
26
+ constructor(e, t, n) { Object.defineProperty(this, "type", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "size", { enumerable: !0, configurable: !0, writable: !0, value: t }), Object.defineProperty(this, "offset", { enumerable: !0, configurable: !0, writable: !0, value: n }); }
27
+ }
28
+ const a = ["startAddrsOffset", "endAddrsOffset", "startloopAddrsOffset", "endloopAddrsOffset", "startAddrsCoarseOffset", "modLfoToPitch", "vibLfoToPitch", "modEnvToPitch", "initialFilterFc", "initialFilterQ", "modLfoToFilterFc", "modEnvToFilterFc", "endAddrsCoarseOffset", "modLfoToVolume", void 0, "chorusEffectsSend", "reverbEffectsSend", "pan", void 0, void 0, void 0, "delayModLFO", "freqModLFO", "delayVibLFO", "freqVibLFO", "delayModEnv", "attackModEnv", "holdModEnv", "decayModEnv", "sustainModEnv", "releaseModEnv", "keynumToModEnvHold", "keynumToModEnvDecay", "delayVolEnv", "attackVolEnv", "holdVolEnv", "decayVolEnv", "sustainVolEnv", "releaseVolEnv", "keynumToVolEnvHold", "keynumToVolEnvDecay", "instrument", void 0, "keyRange", "velRange", "startloopAddrsCoarseOffset", "keynum", "velocity", "initialAttenuation", void 0, "endloopAddrsCoarseOffset", "coarseTune", "fineTune", "sampleID", "sampleModes", void 0, "scaleTuning", "exclusiveClass", "overridingRootKey"];
29
+ class o {
30
+ constructor(e, t) { Object.defineProperty(this, "major", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "minor", { enumerable: !0, configurable: !0, writable: !0, value: t }); }
31
+ static parse(e) { const t = e.readInt8(), n = e.readInt8(); return new o(t, n); }
32
+ }
33
+ class s {
34
+ constructor(e, t, n, r, a, o, s, i, l, d, u) { Object.defineProperty(this, "comment", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "copyright", { enumerable: !0, configurable: !0, writable: !0, value: t }), Object.defineProperty(this, "creationDate", { enumerable: !0, configurable: !0, writable: !0, value: n }), Object.defineProperty(this, "engineer", { enumerable: !0, configurable: !0, writable: !0, value: r }), Object.defineProperty(this, "name", { enumerable: !0, configurable: !0, writable: !0, value: a }), Object.defineProperty(this, "product", { enumerable: !0, configurable: !0, writable: !0, value: o }), Object.defineProperty(this, "software", { enumerable: !0, configurable: !0, writable: !0, value: s }), Object.defineProperty(this, "version", { enumerable: !0, configurable: !0, writable: !0, value: i }), Object.defineProperty(this, "soundEngine", { enumerable: !0, configurable: !0, writable: !0, value: l }), Object.defineProperty(this, "romName", { enumerable: !0, configurable: !0, writable: !0, value: d }), Object.defineProperty(this, "romVersion", { enumerable: !0, configurable: !0, writable: !0, value: u }); }
35
+ static parse(t, n) { function r(e) { for (let t = 0; t < n.length; t++)
36
+ if (n[t].type === e)
37
+ return n[t]; } function a(n) { return new e(t, n.offset); } function i(e) { const t = r(e); return t ? a(t).readString(t.size) : null; } function l(e) { const t = r(e); return t ? o.parse(a(t)) : null; } const d = i("ICMT"), u = i("ICOP"), f = i("ICRD"), c = i("IENG"), b = i("INAM"), m = i("IPRD"), p = i("ISFT"), h = l("ifil"), v = i("isng"), g = i("irom"), w = l("iver"); return new s(d, u, f, c, b, m, p, h, v, g, w); }
38
+ }
39
+ class i {
40
+ constructor(e, t) { Object.defineProperty(this, "generatorIndex", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "modulatorIndex", { enumerable: !0, configurable: !0, writable: !0, value: t }); }
41
+ static parse(e) { const t = e.readWORD(), n = e.readWORD(); return new i(t, n); }
42
+ }
43
+ class l {
44
+ constructor(e, t, n, r, a, o, s) { Object.defineProperty(this, "presetName", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "preset", { enumerable: !0, configurable: !0, writable: !0, value: t }), Object.defineProperty(this, "bank", { enumerable: !0, configurable: !0, writable: !0, value: n }), Object.defineProperty(this, "presetBagIndex", { enumerable: !0, configurable: !0, writable: !0, value: r }), Object.defineProperty(this, "library", { enumerable: !0, configurable: !0, writable: !0, value: a }), Object.defineProperty(this, "genre", { enumerable: !0, configurable: !0, writable: !0, value: o }), Object.defineProperty(this, "morphology", { enumerable: !0, configurable: !0, writable: !0, value: s }); }
45
+ get isEnd() { return "EOP" === this.presetName; }
46
+ static parse(e) { const t = e.readString(20), n = e.readWORD(), r = e.readWORD(), a = e.readWORD(), o = e.readDWORD(), s = e.readDWORD(), i = e.readDWORD(); return new l(t, n, r, a, o, s, i); }
47
+ }
48
+ class d {
49
+ constructor(e, t) { Object.defineProperty(this, "lo", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "hi", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.lo = e, this.hi = t; }
50
+ in(e) { return this.lo <= e && e <= this.hi; }
51
+ static parse(e) { const t = e.readByte(), n = e.readByte(); return new d(t, n); }
52
+ }
53
+ class u {
54
+ constructor(e, t, n, r, a) { Object.defineProperty(this, "sourceOper", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "destinationOper", { enumerable: !0, configurable: !0, writable: !0, value: t }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, writable: !0, value: n }), Object.defineProperty(this, "amountSourceOper", { enumerable: !0, configurable: !0, writable: !0, value: r }), Object.defineProperty(this, "transOper", { enumerable: !0, configurable: !0, writable: !0, value: a }); }
55
+ get isEnd() { return 0 === this.sourceOper && 0 === this.destinationOper && 0 === this.value && 0 === this.amountSourceOper && 0 === this.transOper; }
56
+ static parse(e) { const t = e.readWORD(), n = e.readWORD(), r = e.readInt16(), a = e.readWORD(), o = e.readWORD(); return new u(t, n, r, a, o); }
57
+ }
58
+ class f {
59
+ constructor(e, t) { Object.defineProperty(this, "code", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, writable: !0, value: t }); }
60
+ get type() { return a[this.code]; }
61
+ get isEnd() { return 0 === this.code && 0 === this.value; }
62
+ static parse(e) { const t = e.readWORD(); let n; switch (a[t]) {
63
+ case "keyRange":
64
+ case "velRange":
65
+ n = d.parse(e);
66
+ break;
67
+ default: n = e.readInt16();
68
+ } return new f(t, n); }
69
+ }
70
+ class c {
71
+ constructor() { Object.defineProperty(this, "instrumentName", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "instrumentBagIndex", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }); }
72
+ get isEnd() { return "EOI" === this.instrumentName; }
73
+ static parse(e) { const t = new c; return t.instrumentName = e.readString(20), t.instrumentBagIndex = e.readWORD(), t; }
74
+ }
75
+ class b {
76
+ constructor(e, t, n, r, a, o, s, i, l, d) { Object.defineProperty(this, "sampleName", { enumerable: !0, configurable: !0, writable: !0, value: e }), Object.defineProperty(this, "start", { enumerable: !0, configurable: !0, writable: !0, value: t }), Object.defineProperty(this, "end", { enumerable: !0, configurable: !0, writable: !0, value: n }), Object.defineProperty(this, "loopStart", { enumerable: !0, configurable: !0, writable: !0, value: r }), Object.defineProperty(this, "loopEnd", { enumerable: !0, configurable: !0, writable: !0, value: a }), Object.defineProperty(this, "sampleRate", { enumerable: !0, configurable: !0, writable: !0, value: o }), Object.defineProperty(this, "originalPitch", { enumerable: !0, configurable: !0, writable: !0, value: s }), Object.defineProperty(this, "pitchCorrection", { enumerable: !0, configurable: !0, writable: !0, value: i }), Object.defineProperty(this, "sampleLink", { enumerable: !0, configurable: !0, writable: !0, value: l }), Object.defineProperty(this, "sampleType", { enumerable: !0, configurable: !0, writable: !0, value: d }); }
77
+ get isEnd() { return "EOS" === this.sampleName; }
78
+ static parse(e, t) { const n = e.readString(20), r = e.readDWORD(), a = e.readDWORD(); let o = e.readDWORD(), s = e.readDWORD(); const i = e.readDWORD(), l = e.readByte(), d = e.readInt8(), u = e.readWORD(), f = e.readWORD(); return t || (o -= r, s -= r), new b(n, r, a, o, s, i, l, d, u, f); }
79
+ }
80
+ class m {
81
+ constructor(e, t, n) { Object.defineProperty(this, "min", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "max", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.min = e, this.value = t, this.max = n; }
82
+ clamp() { return Math.max(this.min, Math.min(this.value, this.max)); }
83
+ }
84
+ function p(e, r = {}) { const a = n(e, 0, e.length, r); if (1 !== a.length)
85
+ throw new Error("wrong chunk length"); const o = a[0]; if (null === o)
86
+ throw new Error("chunk not found"); function i(e, t, n) { const r = h(e, t, "LIST", "pdta"); if (9 !== r.length)
87
+ throw new Error("invalid pdta chunk"); return { presetHeaders: w(r[0], t), presetZone: y(r[1], t), presetModulators: P(r[2], t), presetGenerators: R(r[3], t), instruments: O(r[4], t), instrumentZone: E(r[5], t), instrumentModulators: D(r[6], t), instrumentGenerators: j(r[7], t), sampleHeaders: k(r[8], t, n) }; } const l = function (e, n, r = {}) { const a = h(e, n, "RIFF", "sfbk", r); if (3 !== a.length)
88
+ throw new Error("invalid sfbk structure"); const o = function (e, t) { const n = h(e, t, "LIST", "INFO"); return s.parse(t, n); }(a[0], n), l = 3 === o.version.major; return l && "LIST" !== a[2].type && (a[2] = t(n, a[2].offset - 9, !1)), { info: o, samplingData: v(a[1], n), ...i(a[2], n, l) }; }(o, e, r), d = 3 === l.info.version.major; return { ...l, samples: T(l.sampleHeaders, l.samplingData.offsetMSB, l.samplingData.offsetLSB, e, d) }; }
89
+ function h(t, r, a, o, s = {}) { if (t.type !== a)
90
+ throw new Error("invalid chunk type:" + t.type); const i = new e(r, t.offset), l = i.readString(4); if (l !== o)
91
+ throw new Error("invalid signature:" + l); return n(r, i.offset, t.size - 4, s); }
92
+ function v(e, t) { const n = h(e, t, "LIST", "sdta"); return { offsetMSB: n[0].offset, offsetLSB: n[1]?.offset }; }
93
+ function g(t, n, r, a, o, s) { const i = []; if (t.type !== r)
94
+ throw new Error("invalid chunk type:" + t.type); const l = new e(n, t.offset), d = t.offset + t.size; for (; l.offset < d;) {
95
+ const e = a.parse(l, s);
96
+ if (o && o(e))
97
+ break;
98
+ i.push(e);
99
+ } return i; }
100
+ const w = (e, t) => g(e, t, "phdr", l, (e => e.isEnd)), y = (e, t) => g(e, t, "pbag", i), O = (e, t) => g(e, t, "inst", c, (e => e.isEnd)), E = (e, t) => g(e, t, "ibag", i), P = (e, t) => g(e, t, "pmod", u, (e => e.isEnd)), D = (e, t) => g(e, t, "imod", u, (e => e.isEnd)), R = (e, t) => g(e, t, "pgen", f, (e => e.isEnd)), j = (e, t) => g(e, t, "igen", f), k = (e, t, n) => g(e, t, "shdr", b, (e => e.isEnd), n);
101
+ function T(e, t, n, r, a) { return e.map((e => { let { start: n, end: o } = e; return a || (n *= 2, o *= 2), new Uint8Array(r.subarray(t + n, t + o)); })); }
102
+ const I = new Map(a.map(((e, t) => [e, t]))), M = ["keyRange", "velRange"], F = new Set(["startAddrsOffset", "endAddrsOffset", "startloopAddrsOffset", "endloopAddrsOffset", "startAddrsCoarseOffset", "endAddrsCoarseOffset", "startloopAddrsCoarseOffset", "endloopAddrsCoarseOffset", "sampleModes", "exclusiveClass", "overridingRootKey", "keynum", "velocity"].map((e => I.get(e)))), A = [["keynum", "keyRange"], ["velocity", "velRange"]];
103
+ function L(e) { return M.includes(e); }
104
+ function V(e) { const t = {}; for (let n = 0; n < e.length; n++) {
105
+ const r = e[n], a = r.type;
106
+ if (void 0 !== a && !F.has(r.code))
107
+ if (L(a))
108
+ t[a] = r.value;
109
+ else {
110
+ const e = a, n = W[e];
111
+ t[e] = new m(n.min, r.value, n.max);
112
+ }
113
+ } return t; }
114
+ function S(e) { const t = {}; for (let n = 0; n < e.length; n++) {
115
+ const r = e[n], a = r.type;
116
+ if (void 0 !== a)
117
+ if (L(a))
118
+ t[a] = r.value;
119
+ else {
120
+ const e = a, n = W[e];
121
+ t[e] = new m(n.min, r.value, n.max);
122
+ }
123
+ } for (let e = 0; e < A.length; e++) {
124
+ const [n, r] = A[e], a = t[n];
125
+ a instanceof m && 0 <= a.value && (t[r] = new d(a.value, a.value));
126
+ } return t; }
127
+ const C = -32768, x = 32767, W = { startAddrsOffset: new m(0, 0, x), endAddrsOffset: new m(C, 0, 0), startloopAddrsOffset: new m(C, 0, x), endloopAddrsOffset: new m(C, 0, x), startAddrsCoarseOffset: new m(0, 0, x), modLfoToPitch: new m(-12e3, 0, 12e3), vibLfoToPitch: new m(-12e3, 0, 12e3), modEnvToPitch: new m(-12e3, 0, 12e3), initialFilterFc: new m(1500, 13500, 13500), initialFilterQ: new m(0, 0, 960), modLfoToFilterFc: new m(-12e3, 0, 12e3), modEnvToFilterFc: new m(-12e3, 0, 12e3), endAddrsCoarseOffset: new m(C, 0, 0), modLfoToVolume: new m(-960, 0, 960), chorusEffectsSend: new m(0, 0, 1e3), reverbEffectsSend: new m(0, 0, 1e3), pan: new m(-500, 0, 500), delayModLFO: new m(-12e3, -12e3, 5e3), freqModLFO: new m(-16e3, 0, 4500), delayVibLFO: new m(-12e3, -12e3, 5e3), freqVibLFO: new m(-16e3, 0, 4500), delayModEnv: new m(-12e3, -12e3, 5e3), attackModEnv: new m(-12e3, -12e3, 8e3), holdModEnv: new m(-12e3, -12e3, 5e3), decayModEnv: new m(-12e3, -12e3, 8e3), sustainModEnv: new m(0, 0, 1e3), releaseModEnv: new m(-12e3, -12e3, 8e3), keynumToModEnvHold: new m(-1200, 0, 1200), keynumToModEnvDecay: new m(-1200, 0, 1200), delayVolEnv: new m(-12e3, -12e3, 5e3), attackVolEnv: new m(-12e3, -12e3, 8e3), holdVolEnv: new m(-12e3, -12e3, 5e3), decayVolEnv: new m(-12e3, -12e3, 8e3), sustainVolEnv: new m(0, 0, 1440), releaseVolEnv: new m(-12e3, -12e3, 8e3), keynumToVolEnvHold: new m(-1200, 0, 1200), keynumToVolEnvDecay: new m(-1200, 0, 1200), instrument: new m(-1, -1, x), keyRange: new d(0, 127), velRange: new d(0, 127), startloopAddrsCoarseOffset: new m(C, 0, x), keynum: new m(-1, -1, 127), velocity: new m(-1, -1, 127), initialAttenuation: new m(0, 0, 1440), endloopAddrsCoarseOffset: new m(C, 0, x), coarseTune: new m(-120, 0, 120), fineTune: new m(-99, 0, 99), sampleID: new m(-1, -1, x), sampleModes: new m(0, 0, 3), scaleTuning: new m(0, 100, 100), exclusiveClass: new m(0, 0, 127), overridingRootKey: new m(-1, -1, 127) };
128
+ class B {
129
+ constructor(e) { Object.defineProperty(this, "parsed", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.parsed = e; }
130
+ getGenerators(e, t, n, r) { const a = new Array(r - n); for (let o = n; o < r; o++) {
131
+ const r = t[o].generatorIndex, s = t[o + 1].generatorIndex;
132
+ a[o - n] = e.slice(r, s);
133
+ } return a; }
134
+ getPresetGenerators(e) { const t = this.parsed.presetHeaders[e], n = this.parsed.presetHeaders[e + 1], r = n ? n.presetBagIndex : this.parsed.presetZone.length - 1; return this.getGenerators(this.parsed.presetGenerators, this.parsed.presetZone, t.presetBagIndex, r); }
135
+ getInstrumentGenerators(e) { const t = this.parsed.instruments[e], n = this.parsed.instruments[e + 1], r = n ? n.instrumentBagIndex : this.parsed.instrumentZone.length - 1; return this.getGenerators(this.parsed.instrumentGenerators, this.parsed.instrumentZone, t.instrumentBagIndex, r); }
136
+ findInstrumentZone(e, t, n) { const r = this.getInstrumentGenerators(e); let a; for (let e = 0; e < r.length; e++) {
137
+ const o = S(r[e]);
138
+ if (void 0 !== o.sampleID) {
139
+ if ((!o.keyRange || o.keyRange.in(t)) && (!o.velRange || o.velRange.in(n)))
140
+ return a ? { ...a, ...o } : o;
141
+ }
142
+ else
143
+ a = o;
144
+ } }
145
+ findInstrument(e, t, n) { const r = this.getPresetGenerators(e); let a; for (let e = 0; e < r.length; e++) {
146
+ const o = V(r[e]);
147
+ if (void 0 === o.instrument) {
148
+ a = o;
149
+ continue;
150
+ }
151
+ if (o.keyRange && !o.keyRange.in(t))
152
+ continue;
153
+ if (o.velRange && !o.velRange.in(n))
154
+ continue;
155
+ const s = this.findInstrumentZone(o.instrument.value, t, n);
156
+ if (s)
157
+ return a ? this.getInstrument({ ...a, ...o }, s) : this.getInstrument(o, s);
158
+ } return null; }
159
+ getInstrument(e, t) { const n = { ...W, ...t }, r = Object.keys(e); for (let t = 0; t < r.length; t++) {
160
+ const a = r[t];
161
+ if (L(a))
162
+ continue;
163
+ const o = n[a], s = e[a];
164
+ n[a] = new m(o.min, o.value + s.value, o.max);
165
+ } return n; }
166
+ getInstrumentKey(e, t, n, r) { const a = this.parsed.presetHeaders.findIndex((n => n.preset === t && n.bank === e)); if (a < 0)
167
+ return console.warn("preset not found: bank=%s instrument=%s", e, t), null; const o = this.findInstrument(a, n, r); if (!o)
168
+ return console.warn("instrument not found: bank=%s instrument=%s", e, t), null; const s = {}, i = Object.keys(o); for (let e = 0; e < i.length; e++) {
169
+ const t = i[e];
170
+ L(t) ? s[t] = o[t] : s[t] = o[t].clamp();
171
+ } const l = H(s.holdModEnv + (n - 60) * s.keynumToModEnvHold), d = H(s.decayModEnv + (n - 60) * s.keynumToModEnvDecay), u = H(s.holdVolEnv + (n - 60) * s.keynumToVolEnvHold), f = H(s.decayVolEnv + (n - 60) * s.keynumToVolEnvDecay), c = this.parsed.samples[s.sampleID], b = this.parsed.sampleHeaders[s.sampleID], m = s.coarseTune + s.fineTune / 100, p = -1 === s.overridingRootKey ? b.originalPitch : s.overridingRootKey, h = m + b.pitchCorrection / 100 - p, v = s.scaleTuning / 100; return { start: 32768 * s.startAddrsCoarseOffset + s.startAddrsOffset, end: 32768 * s.endAddrsCoarseOffset + s.endAddrsOffset, loopStart: b.loopStart + 32768 * s.startloopAddrsCoarseOffset + s.startloopAddrsOffset, loopEnd: b.loopEnd + 32768 * s.endloopAddrsCoarseOffset + s.endloopAddrsOffset, modLfoToPitch: s.modLfoToPitch, vibLfoToPitch: s.vibLfoToPitch, modEnvToPitch: s.modEnvToPitch, initialFilterFc: s.initialFilterFc, initialFilterQ: s.initialFilterQ, modLfoToFilterFc: s.modLfoToFilterFc, modEnvToFilterFc: s.modEnvToFilterFc, modLfoToVolume: s.modLfoToVolume, chorusEffectsSend: s.chorusEffectsSend / 1e3, reverbEffectsSend: s.reverbEffectsSend / 1e3, pan: s.pan, delayModLFO: H(s.delayModLFO), freqModLFO: s.freqModLFO, delayVibLFO: H(s.delayVibLFO), freqVibLFO: s.freqVibLFO, modDelay: H(s.delayModEnv), modAttack: H(s.attackModEnv), modHold: l, modDecay: d, modSustain: s.sustainModEnv / 1e3, modRelease: H(s.releaseModEnv), volDelay: H(s.delayVolEnv), volAttack: H(s.attackVolEnv), volHold: u, volDecay: f, volSustain: s.sustainVolEnv / 1e3, volRelease: H(s.releaseVolEnv), initialAttenuation: s.initialAttenuation, playbackRate: e => Math.pow(Math.pow(2, 1 / 12), (e + h) * v), sample: c, sampleRate: b.sampleRate, sampleName: b.sampleName, sampleModes: s.sampleModes, exclusiveClass: s.exclusiveClass }; }
172
+ getPresetNames() { const e = {}, t = this.parsed.presetHeaders; for (let n = 0; n < t.length; n++) {
173
+ const r = t[n];
174
+ e[r.bank] || (e[r.bank] = {}), e[r.bank][r.preset] = r.presetName;
175
+ } return e; }
176
+ }
177
+ function H(e) { return Math.pow(2, e / 1200); }
178
+ export { M as RangeGeneratorNames, B as SoundFont, S as createInstrumentGeneratorObject, V as createPresetGeneratorObject, W as defaultInstrumentZone, L as isRangeGenerator, p as parse, H as timecentToSecond };
179
+ export default null;
180
+ //# sourceMappingURL=/sm/2fff1026e5ca926c33bde270b79b6c4b0445a8dd5401fdf4af3e7cae85b156e4.map
package/esm/midy-GM1.d.ts CHANGED
@@ -39,6 +39,20 @@ export class MidyGM1 {
39
39
  notePromises: any[];
40
40
  audioContext: any;
41
41
  masterGain: any;
42
+ controlChangeHandlers: {
43
+ 1: (channelNumber: any, modulation: any) => void;
44
+ 6: (channelNumber: any, value: any) => void;
45
+ 7: (channelNumber: any, volume: any) => void;
46
+ 10: (channelNumber: any, pan: any) => void;
47
+ 11: (channelNumber: any, expression: any) => void;
48
+ 38: (channelNumber: any, value: any) => void;
49
+ 64: (channelNumber: any, value: any) => void;
50
+ 100: (channelNumber: any, value: any) => void;
51
+ 101: (channelNumber: any, value: any) => void;
52
+ 120: (channelNumber: any) => Promise<void>;
53
+ 121: (channelNumber: any) => void;
54
+ 123: (channelNumber: any) => Promise<void>;
55
+ };
42
56
  channels: any[];
43
57
  initSoundFontTable(): any[];
44
58
  addSoundFont(soundFont: any): void;
@@ -92,7 +106,21 @@ export class MidyGM1 {
92
106
  handleProgramChange(channelNumber: any, program: any): void;
93
107
  handlePitchBendMessage(channelNumber: any, lsb: any, msb: any): void;
94
108
  setPitchBend(channelNumber: any, pitchBend: any): void;
95
- handleControlChange(channelNumber: any, controller: any, value: any): void | Promise<void>;
109
+ createControlChangeHandlers(): {
110
+ 1: (channelNumber: any, modulation: any) => void;
111
+ 6: (channelNumber: any, value: any) => void;
112
+ 7: (channelNumber: any, volume: any) => void;
113
+ 10: (channelNumber: any, pan: any) => void;
114
+ 11: (channelNumber: any, expression: any) => void;
115
+ 38: (channelNumber: any, value: any) => void;
116
+ 64: (channelNumber: any, value: any) => void;
117
+ 100: (channelNumber: any, value: any) => void;
118
+ 101: (channelNumber: any, value: any) => void;
119
+ 120: (channelNumber: any) => Promise<void>;
120
+ 121: (channelNumber: any) => void;
121
+ 123: (channelNumber: any) => Promise<void>;
122
+ };
123
+ handleControlChange(channelNumber: any, controller: any, value: any): void;
96
124
  updateModulation(channel: any): void;
97
125
  setModulationDepth(channelNumber: any, modulation: any): void;
98
126
  setVolume(channelNumber: any, volume: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM1.d.ts","sourceRoot":"","sources":["../src/midy-GM1.js"],"names":[],"mappings":"AAwBA;IAmBE;;;;;;;;;;;MAWE;IAEF;;;;;;;MAOE;IAEF,+BAMC;IA9CD,qBAAmB;IACnB,kBAAc;IACd,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;IAyBhB,kBAAgC;IAChC,gBAA4C;IAC5C,gBAAiD;IAKnD,4BAMC;IAED,mCASC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAUC;IAED,+DAyBC;IAED,mEAWC;IAED,qDAOC;IAED,2EA+CC;IAED,mCAOC;IAED,0BA+CC;IAED,uDAEC;IAED,wDAEC;IAED;;;MA8DC;IAED,mFAmBC;IAED,yDAKC;IAED,uBAKC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,uDASC;IAED,6CAQC;IAED,2BAEC;IAED,4BAEC;IAED,sCAGC;IAED,mFAGC;IAED,mCAeC;IAED,+CAwBC;IAED,6CAIC;IAED,mCAsBC;IAED,+DA0BC;IAED,wHAmCC;IAED,kGA6BC;IAED,0EAGC;IAED,uIAyCC;IAED,0FAGC;IAED,kEAeC;IAED,gFAiBC;IAED,4DAGC;IAED,qEAGC;IAED,uDAOC;IAED,2FA+BC;IAED,qCAkBC;IAED,8DAIC;IACD,iDAIC;IAED;;;MAMC;IAED,2CAIC;IAED,yDAIC;IAED,mDAGC;IAED,sCAUC;IAED,sDAMC;IAED,kFAeC;IAED,2DAMC;IAED,oCAkBC;IAED,gDAEC;IAED,gDAEC;IAED,mDAGC;IAED,oDAaC;IAED,kDAKC;IAED,iEAOC;IAED,8CAKC;IAED,yDAMC;IAED,gDAKC;IAED,6DAMC;IAED,+CAEC;IAED,8CAEC;IAED,+CAEC;IAED,4DAgBC;IAED,oBAQC;IAED,yDAaC;IAED,yCAGC;IAED,mCAQC;IAED,wCAEC;IAED,6BASC;IAED,0DAUC;CACF;AApjCD;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-GM1.d.ts","sourceRoot":"","sources":["../src/midy-GM1.js"],"names":[],"mappings":"AAwBA;IAmBE;;;;;;;;;;;MAWE;IAEF;;;;;;;MAOE;IAEF,+BAOC;IA/CD,qBAAmB;IACnB,kBAAc;IACd,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;IAyBhB,kBAAgC;IAChC,gBAA4C;IAC5C;;;;;;;;;;;;;MAA+D;IAC/D,gBAAiD;IAKnD,4BAMC;IAED,mCASC;IAED,gDAMC;IAED,sCASC;IAED;;;;MAeC;IAED,yCAUC;IAED,+DAyBC;IAED,mEAWC;IAED,qDAOC;IAED,2EA+CC;IAED,mCAOC;IAED,0BA+CC;IAED,uDAEC;IAED,wDAEC;IAED;;;MA8DC;IAED,mFAmBC;IAED,yDAKC;IAED,uBAKC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBAOC;IAED,sBAGC;IAED,uDASC;IAED,6CAQC;IAED,2BAEC;IAED,4BAEC;IAED,sCAGC;IAED,mFAGC;IAED,mCAeC;IAED,+CAwBC;IAED,6CAIC;IAED,mCAsBC;IAED,+DA0BC;IAED,wHAmCC;IAED,kGA8BC;IAED,0EAGC;IAED,uIA2CC;IAED,0FAGC;IAED,kEAeC;IAED,gFAiBC;IAED,4DAGC;IAED,qEAGC;IAED,uDAOC;IAED;;;;;;;;;;;;;MAeC;IAED,2EASC;IAED,qCAkBC;IAED,8DAIC;IACD,iDAIC;IAED;;;MAMC;IAED,2CAIC;IAED,yDAIC;IAED,mDAGC;IAED,sCAUC;IAED,sDAMC;IAED,kFAeC;IAED,2DAMC;IAED,oCAkBC;IAED,gDAEC;IAED,gDAEC;IAED,mDAGC;IAED,oDAaC;IAED,kDAKC;IAED,iEAOC;IAED,8CAKC;IAED,yDAMC;IAED,gDAKC;IAED,6DAMC;IAED,+CAEC;IAED,8CAEC;IAED,+CAEC;IAED,4DAgBC;IAED,oBAQC;IAED,yDAaC;IAED,yCAGC;IAED,mCAQC;IAED,wCAEC;IAED,6BASC;IAED,0DAUC;CACF;AAnjCD;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"}
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();
@@ -646,7 +647,7 @@ export class MidyGM1 {
646
647
  return;
647
648
  const soundFont = this.soundFonts[soundFontIndex];
648
649
  const isSF3 = soundFont.parsed.info.version.major === 3;
649
- const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber);
650
+ const instrumentKey = soundFont.getInstrumentKey(bankNumber, channel.program, noteNumber, velocity);
650
651
  if (!instrumentKey)
651
652
  return;
652
653
  const note = await this.createNote(channel, instrumentKey, noteNumber, velocity, startTime, isSF3);
@@ -695,12 +696,11 @@ export class MidyGM1 {
695
696
  note.bufferSource.disconnect();
696
697
  note.volumeNode.disconnect();
697
698
  note.filterNode.disconnect();
698
- if (note.volumeDepth)
699
+ if (note.modulationDepth) {
699
700
  note.volumeDepth.disconnect();
700
- if (note.modulationDepth)
701
701
  note.modulationDepth.disconnect();
702
- if (note.modulationLFO)
703
702
  note.modulationLFO.stop();
703
+ }
704
704
  resolve();
705
705
  };
706
706
  note.bufferSource.stop(volEndTime);
@@ -762,34 +762,29 @@ export class MidyGM1 {
762
762
  channel.pitchBendRange * 100;
763
763
  this.updateDetune(channel, detuneChange);
764
764
  }
765
+ createControlChangeHandlers() {
766
+ return {
767
+ 1: this.setModulationDepth,
768
+ 6: this.dataEntryMSB,
769
+ 7: this.setVolume,
770
+ 10: this.setPan,
771
+ 11: this.setExpression,
772
+ 38: this.dataEntryLSB,
773
+ 64: this.setSustainPedal,
774
+ 100: this.setRPNLSB,
775
+ 101: this.setRPNMSB,
776
+ 120: this.allSoundOff,
777
+ 121: this.resetAllControllers,
778
+ 123: this.allNotesOff,
779
+ };
780
+ }
765
781
  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}`);
782
+ const handler = this.controlChangeHandlers[controller];
783
+ if (handler) {
784
+ handler.call(this, channelNumber, value);
785
+ }
786
+ else {
787
+ console.warn(`Unsupported Control change: controller=${controller} value=${value}`);
793
788
  }
794
789
  }
795
790
  updateModulation(channel) {
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;
@@ -184,7 +210,33 @@ export class MidyGM2 {
184
210
  handleChannelPressure(channelNumber: any, pressure: any): void;
185
211
  handlePitchBendMessage(channelNumber: any, lsb: any, msb: any): void;
186
212
  setPitchBend(channelNumber: any, pitchBend: any): void;
187
- handleControlChange(channelNumber: any, controller: any, value: any): void | Promise<void>;
213
+ createControlChangeHandlers(): {
214
+ 0: (channelNumber: any, msb: any) => void;
215
+ 1: (channelNumber: any, modulation: any) => void;
216
+ 5: (channelNumber: any, portamentoTime: any) => void;
217
+ 6: (channelNumber: any, value: any) => void;
218
+ 7: (channelNumber: any, volume: any) => void;
219
+ 10: (channelNumber: any, pan: any) => void;
220
+ 11: (channelNumber: any, expression: any) => void;
221
+ 32: (channelNumber: any, lsb: any) => void;
222
+ 38: (channelNumber: any, value: any) => void;
223
+ 64: (channelNumber: any, value: any) => void;
224
+ 65: (channelNumber: any, value: any) => void;
225
+ 66: (channelNumber: any, value: any) => void;
226
+ 67: (channelNumber: any, softPedal: any) => void;
227
+ 91: (channelNumber: any, reverbSendLevel: any) => void;
228
+ 93: (channelNumber: any, chorusSendLevel: any) => void;
229
+ 100: (channelNumber: any, value: any) => void;
230
+ 101: (channelNumber: any, value: any) => void;
231
+ 120: (channelNumber: any) => Promise<void>;
232
+ 121: (channelNumber: any) => void;
233
+ 123: (channelNumber: any) => Promise<void>;
234
+ 124: () => void;
235
+ 125: () => void;
236
+ 126: () => void;
237
+ 127: () => void;
238
+ };
239
+ handleControlChange(channelNumber: any, controller: any, value: any): void;
188
240
  setBankMSB(channelNumber: any, msb: any): void;
189
241
  updateModulation(channel: any): void;
190
242
  setModulationDepth(channelNumber: any, modulation: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"midy-GM2.d.ts","sourceRoot":"","sources":["../src/midy-GM2.js"],"names":[],"mappings":"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"}