@marmooo/midy 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.d.ts +128 -0
- package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.d.ts.map +1 -0
- package/esm/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.js +155 -0
- package/esm/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.d.ts +84 -0
- package/esm/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.d.ts.map +1 -0
- package/esm/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.js +216 -0
- package/esm/midy-GM1.d.ts +187 -0
- package/esm/midy-GM1.d.ts.map +1 -0
- package/esm/midy-GM1.js +966 -0
- package/esm/midy-GM2.d.ts +280 -0
- package/esm/midy-GM2.d.ts.map +1 -0
- package/esm/midy-GM2.js +1303 -0
- package/esm/midy-GMLite.d.ts +181 -0
- package/esm/midy-GMLite.d.ts.map +1 -0
- package/esm/midy-GMLite.js +957 -0
- package/esm/midy.d.ts +285 -0
- package/esm/midy.d.ts.map +1 -0
- package/esm/midy.js +1372 -0
- package/esm/mod.d.ts +5 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +4 -0
- package/esm/package.json +3 -0
- package/package.json +29 -0
- package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.d.ts +128 -0
- package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.d.ts.map +1 -0
- package/script/deps/cdn.jsdelivr.net/npm/@marmooo/soundfont-parser@0.0.1/+esm.js +162 -0
- package/script/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.d.ts +84 -0
- package/script/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.d.ts.map +1 -0
- package/script/deps/cdn.jsdelivr.net/npm/midi-file@1.2.4/+esm.js +221 -0
- package/script/midy-GM1.d.ts +187 -0
- package/script/midy-GM1.d.ts.map +1 -0
- package/script/midy-GM1.js +970 -0
- package/script/midy-GM2.d.ts +280 -0
- package/script/midy-GM2.d.ts.map +1 -0
- package/script/midy-GM2.js +1307 -0
- package/script/midy-GMLite.d.ts +181 -0
- package/script/midy-GMLite.d.ts.map +1 -0
- package/script/midy-GMLite.js +961 -0
- package/script/midy.d.ts +285 -0
- package/script/midy.d.ts.map +1 -0
- package/script/midy.js +1376 -0
- package/script/mod.d.ts +5 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +11 -0
- package/script/package.json +3 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeMidi = exports.parseMidi = exports.default = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
6
|
+
* Original file: /npm/midi-file@1.2.4/index.js
|
|
7
|
+
*
|
|
8
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
9
|
+
*/
|
|
10
|
+
var t = {};
|
|
11
|
+
exports.default = t;
|
|
12
|
+
function e(t) { for (var e, n = new r(t), i = []; !n.eof();) {
|
|
13
|
+
var a = o();
|
|
14
|
+
i.push(a);
|
|
15
|
+
} return i; function o() { var t = {}; t.deltaTime = n.readVarInt(); var r = n.readUInt8(); if (240 == (240 & r)) {
|
|
16
|
+
if (255 !== r) {
|
|
17
|
+
if (240 == r) {
|
|
18
|
+
t.type = "sysEx";
|
|
19
|
+
a = n.readVarInt();
|
|
20
|
+
return t.data = n.readBytes(a), t;
|
|
21
|
+
}
|
|
22
|
+
if (247 == r) {
|
|
23
|
+
t.type = "endSysEx";
|
|
24
|
+
a = n.readVarInt();
|
|
25
|
+
return t.data = n.readBytes(a), t;
|
|
26
|
+
}
|
|
27
|
+
throw "Unrecognised MIDI event type byte: " + r;
|
|
28
|
+
}
|
|
29
|
+
t.meta = !0;
|
|
30
|
+
var i = n.readUInt8(), a = n.readVarInt();
|
|
31
|
+
switch (i) {
|
|
32
|
+
case 0:
|
|
33
|
+
if (t.type = "sequenceNumber", 2 !== a)
|
|
34
|
+
throw "Expected length for sequenceNumber event is 2, got " + a;
|
|
35
|
+
return t.number = n.readUInt16(), t;
|
|
36
|
+
case 1: return t.type = "text", t.text = n.readString(a), t;
|
|
37
|
+
case 2: return t.type = "copyrightNotice", t.text = n.readString(a), t;
|
|
38
|
+
case 3: return t.type = "trackName", t.text = n.readString(a), t;
|
|
39
|
+
case 4: return t.type = "instrumentName", t.text = n.readString(a), t;
|
|
40
|
+
case 5: return t.type = "lyrics", t.text = n.readString(a), t;
|
|
41
|
+
case 6: return t.type = "marker", t.text = n.readString(a), t;
|
|
42
|
+
case 7: return t.type = "cuePoint", t.text = n.readString(a), t;
|
|
43
|
+
case 32:
|
|
44
|
+
if (t.type = "channelPrefix", 1 != a)
|
|
45
|
+
throw "Expected length for channelPrefix event is 1, got " + a;
|
|
46
|
+
return t.channel = n.readUInt8(), t;
|
|
47
|
+
case 33:
|
|
48
|
+
if (t.type = "portPrefix", 1 != a)
|
|
49
|
+
throw "Expected length for portPrefix event is 1, got " + a;
|
|
50
|
+
return t.port = n.readUInt8(), t;
|
|
51
|
+
case 47:
|
|
52
|
+
if (t.type = "endOfTrack", 0 != a)
|
|
53
|
+
throw "Expected length for endOfTrack event is 0, got " + a;
|
|
54
|
+
return t;
|
|
55
|
+
case 81:
|
|
56
|
+
if (t.type = "setTempo", 3 != a)
|
|
57
|
+
throw "Expected length for setTempo event is 3, got " + a;
|
|
58
|
+
return t.microsecondsPerBeat = n.readUInt24(), t;
|
|
59
|
+
case 84:
|
|
60
|
+
if (t.type = "smpteOffset", 5 != a)
|
|
61
|
+
throw "Expected length for smpteOffset event is 5, got " + a;
|
|
62
|
+
var o = n.readUInt8();
|
|
63
|
+
return t.frameRate = { 0: 24, 32: 25, 64: 29, 96: 30 }[96 & o], t.hour = 31 & o, t.min = n.readUInt8(), t.sec = n.readUInt8(), t.frame = n.readUInt8(), t.subFrame = n.readUInt8(), t;
|
|
64
|
+
case 88:
|
|
65
|
+
if (t.type = "timeSignature", 2 != a && 4 != a)
|
|
66
|
+
throw "Expected length for timeSignature event is 4 or 2, got " + a;
|
|
67
|
+
return t.numerator = n.readUInt8(), t.denominator = 1 << n.readUInt8(), 4 === a ? (t.metronome = n.readUInt8(), t.thirtyseconds = n.readUInt8()) : (t.metronome = 36, t.thirtyseconds = 8), t;
|
|
68
|
+
case 89:
|
|
69
|
+
if (t.type = "keySignature", 2 != a)
|
|
70
|
+
throw "Expected length for keySignature event is 2, got " + a;
|
|
71
|
+
return t.key = n.readInt8(), t.scale = n.readUInt8(), t;
|
|
72
|
+
case 127: return t.type = "sequencerSpecific", t.data = n.readBytes(a), t;
|
|
73
|
+
default: return t.type = "unknownMeta", t.data = n.readBytes(a), t.metatypeByte = i, t;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
var s;
|
|
78
|
+
if (0 == (128 & r)) {
|
|
79
|
+
if (null === e)
|
|
80
|
+
throw "Running status byte encountered before status byte";
|
|
81
|
+
s = r, r = e, t.running = !0;
|
|
82
|
+
}
|
|
83
|
+
else
|
|
84
|
+
s = n.readUInt8(), e = r;
|
|
85
|
+
var I = r >> 4;
|
|
86
|
+
switch (t.channel = 15 & r, I) {
|
|
87
|
+
case 8: return t.type = "noteOff", t.noteNumber = s, t.velocity = n.readUInt8(), t;
|
|
88
|
+
case 9:
|
|
89
|
+
var c = n.readUInt8();
|
|
90
|
+
return t.type = 0 === c ? "noteOff" : "noteOn", t.noteNumber = s, t.velocity = c, 0 === c && (t.byte9 = !0), t;
|
|
91
|
+
case 10: return t.type = "noteAftertouch", t.noteNumber = s, t.amount = n.readUInt8(), t;
|
|
92
|
+
case 11: return t.type = "controller", t.controllerType = s, t.value = n.readUInt8(), t;
|
|
93
|
+
case 12: return t.type = "programChange", t.programNumber = s, t;
|
|
94
|
+
case 13: return t.type = "channelAftertouch", t.amount = s, t;
|
|
95
|
+
case 14: return t.type = "pitchBend", t.value = s + (n.readUInt8() << 7) - 8192, t;
|
|
96
|
+
default: throw "Unrecognised MIDI event type: " + I;
|
|
97
|
+
}
|
|
98
|
+
} } }
|
|
99
|
+
function r(t) { this.buffer = t, this.bufferLen = this.buffer.length, this.pos = 0; }
|
|
100
|
+
r.prototype.eof = function () { return this.pos >= this.bufferLen; }, r.prototype.readUInt8 = function () { var t = this.buffer[this.pos]; return this.pos += 1, t; }, r.prototype.readInt8 = function () { var t = this.readUInt8(); return 128 & t ? t - 256 : t; }, r.prototype.readUInt16 = function () { return (this.readUInt8() << 8) + this.readUInt8(); }, r.prototype.readInt16 = function () { var t = this.readUInt16(); return 32768 & t ? t - 65536 : t; }, r.prototype.readUInt24 = function () { return (this.readUInt8() << 16) + (this.readUInt8() << 8) + this.readUInt8(); }, r.prototype.readInt24 = function () { var t = this.readUInt24(); return 8388608 & t ? t - 16777216 : t; }, r.prototype.readUInt32 = function () { return (this.readUInt8() << 24) + (this.readUInt8() << 16) + (this.readUInt8() << 8) + this.readUInt8(); }, r.prototype.readBytes = function (t) { var e = this.buffer.slice(this.pos, this.pos + t); return this.pos += t, e; }, r.prototype.readString = function (t) { var e = this.readBytes(t); return String.fromCharCode.apply(null, e); }, r.prototype.readVarInt = function () { for (var t = 0; !this.eof();) {
|
|
101
|
+
var e = this.readUInt8();
|
|
102
|
+
if (!(128 & e))
|
|
103
|
+
return t + e;
|
|
104
|
+
t += 127 & e, t <<= 7;
|
|
105
|
+
} return t; }, r.prototype.readChunk = function () { var t = this.readString(4), e = this.readUInt32(); return { id: t, length: e, data: this.readBytes(e) }; };
|
|
106
|
+
var n = function (t) { var n = new r(t), i = n.readChunk(); if ("MThd" != i.id)
|
|
107
|
+
throw "Bad MIDI file. Expected 'MHdr', got: '" + i.id + "'"; for (var a = function (t) { var e = new r(t), n = e.readUInt16(), i = e.readUInt16(), a = { format: n, numTracks: i }, o = e.readUInt16(); 32768 & o ? (a.framesPerSecond = 256 - (o >> 8), a.ticksPerFrame = 255 & o) : a.ticksPerBeat = o; return a; }(i.data), o = [], s = 0; !n.eof() && s < a.numTracks; s++) {
|
|
108
|
+
var I = n.readChunk();
|
|
109
|
+
if ("MTrk" != I.id)
|
|
110
|
+
throw "Bad MIDI file. Expected 'MTrk', got: '" + I.id + "'";
|
|
111
|
+
var c = e(I.data);
|
|
112
|
+
o.push(c);
|
|
113
|
+
} return { header: a, tracks: o }; };
|
|
114
|
+
function i(t, e, r) { var n, i = new o, s = e.length, I = null; for (n = 0; n < s; n++)
|
|
115
|
+
!1 !== r.running && (r.running || e[n].running) || (I = null), I = a(i, e[n], I, r.useByte9ForNoteOff); t.writeChunk("MTrk", i.buffer); }
|
|
116
|
+
function a(t, e, r, n) { var i = e.type, a = e.deltaTime, o = e.text || "", s = e.data || [], I = null; switch (t.writeVarInt(a), i) {
|
|
117
|
+
case "sequenceNumber":
|
|
118
|
+
t.writeUInt8(255), t.writeUInt8(0), t.writeVarInt(2), t.writeUInt16(e.number);
|
|
119
|
+
break;
|
|
120
|
+
case "text":
|
|
121
|
+
t.writeUInt8(255), t.writeUInt8(1), t.writeVarInt(o.length), t.writeString(o);
|
|
122
|
+
break;
|
|
123
|
+
case "copyrightNotice":
|
|
124
|
+
t.writeUInt8(255), t.writeUInt8(2), t.writeVarInt(o.length), t.writeString(o);
|
|
125
|
+
break;
|
|
126
|
+
case "trackName":
|
|
127
|
+
t.writeUInt8(255), t.writeUInt8(3), t.writeVarInt(o.length), t.writeString(o);
|
|
128
|
+
break;
|
|
129
|
+
case "instrumentName":
|
|
130
|
+
t.writeUInt8(255), t.writeUInt8(4), t.writeVarInt(o.length), t.writeString(o);
|
|
131
|
+
break;
|
|
132
|
+
case "lyrics":
|
|
133
|
+
t.writeUInt8(255), t.writeUInt8(5), t.writeVarInt(o.length), t.writeString(o);
|
|
134
|
+
break;
|
|
135
|
+
case "marker":
|
|
136
|
+
t.writeUInt8(255), t.writeUInt8(6), t.writeVarInt(o.length), t.writeString(o);
|
|
137
|
+
break;
|
|
138
|
+
case "cuePoint":
|
|
139
|
+
t.writeUInt8(255), t.writeUInt8(7), t.writeVarInt(o.length), t.writeString(o);
|
|
140
|
+
break;
|
|
141
|
+
case "channelPrefix":
|
|
142
|
+
t.writeUInt8(255), t.writeUInt8(32), t.writeVarInt(1), t.writeUInt8(e.channel);
|
|
143
|
+
break;
|
|
144
|
+
case "portPrefix":
|
|
145
|
+
t.writeUInt8(255), t.writeUInt8(33), t.writeVarInt(1), t.writeUInt8(e.port);
|
|
146
|
+
break;
|
|
147
|
+
case "endOfTrack":
|
|
148
|
+
t.writeUInt8(255), t.writeUInt8(47), t.writeVarInt(0);
|
|
149
|
+
break;
|
|
150
|
+
case "setTempo":
|
|
151
|
+
t.writeUInt8(255), t.writeUInt8(81), t.writeVarInt(3), t.writeUInt24(e.microsecondsPerBeat);
|
|
152
|
+
break;
|
|
153
|
+
case "smpteOffset":
|
|
154
|
+
t.writeUInt8(255), t.writeUInt8(84), t.writeVarInt(5);
|
|
155
|
+
var c = 31 & e.hour | { 24: 0, 25: 32, 29: 64, 30: 96 }[e.frameRate];
|
|
156
|
+
t.writeUInt8(c), t.writeUInt8(e.min), t.writeUInt8(e.sec), t.writeUInt8(e.frame), t.writeUInt8(e.subFrame);
|
|
157
|
+
break;
|
|
158
|
+
case "timeSignature":
|
|
159
|
+
t.writeUInt8(255), t.writeUInt8(88), t.writeVarInt(4), t.writeUInt8(e.numerator);
|
|
160
|
+
var u = 255 & Math.floor(Math.log(e.denominator) / Math.LN2);
|
|
161
|
+
t.writeUInt8(u), t.writeUInt8(e.metronome), t.writeUInt8(e.thirtyseconds || 8);
|
|
162
|
+
break;
|
|
163
|
+
case "keySignature":
|
|
164
|
+
t.writeUInt8(255), t.writeUInt8(89), t.writeVarInt(2), t.writeInt8(e.key), t.writeUInt8(e.scale);
|
|
165
|
+
break;
|
|
166
|
+
case "sequencerSpecific":
|
|
167
|
+
t.writeUInt8(255), t.writeUInt8(127), t.writeVarInt(s.length), t.writeBytes(s);
|
|
168
|
+
break;
|
|
169
|
+
case "unknownMeta":
|
|
170
|
+
null != e.metatypeByte && (t.writeUInt8(255), t.writeUInt8(e.metatypeByte), t.writeVarInt(s.length), t.writeBytes(s));
|
|
171
|
+
break;
|
|
172
|
+
case "sysEx":
|
|
173
|
+
t.writeUInt8(240), t.writeVarInt(s.length), t.writeBytes(s);
|
|
174
|
+
break;
|
|
175
|
+
case "endSysEx":
|
|
176
|
+
t.writeUInt8(247), t.writeVarInt(s.length), t.writeBytes(s);
|
|
177
|
+
break;
|
|
178
|
+
case "noteOff":
|
|
179
|
+
(I = (!1 !== n && e.byte9 || n && 0 == e.velocity ? 144 : 128) | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.noteNumber), t.writeUInt8(e.velocity);
|
|
180
|
+
break;
|
|
181
|
+
case "noteOn":
|
|
182
|
+
(I = 144 | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.noteNumber), t.writeUInt8(e.velocity);
|
|
183
|
+
break;
|
|
184
|
+
case "noteAftertouch":
|
|
185
|
+
(I = 160 | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.noteNumber), t.writeUInt8(e.amount);
|
|
186
|
+
break;
|
|
187
|
+
case "controller":
|
|
188
|
+
(I = 176 | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.controllerType), t.writeUInt8(e.value);
|
|
189
|
+
break;
|
|
190
|
+
case "programChange":
|
|
191
|
+
(I = 192 | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.programNumber);
|
|
192
|
+
break;
|
|
193
|
+
case "channelAftertouch":
|
|
194
|
+
(I = 208 | e.channel) !== r && t.writeUInt8(I), t.writeUInt8(e.amount);
|
|
195
|
+
break;
|
|
196
|
+
case "pitchBend":
|
|
197
|
+
(I = 224 | e.channel) !== r && t.writeUInt8(I);
|
|
198
|
+
var w = 8192 + e.value, h = 127 & w, f = w >> 7 & 127;
|
|
199
|
+
t.writeUInt8(h), t.writeUInt8(f);
|
|
200
|
+
break;
|
|
201
|
+
default: throw "Unrecognized event type: " + i;
|
|
202
|
+
} return I; }
|
|
203
|
+
function o() { this.buffer = []; }
|
|
204
|
+
o.prototype.writeUInt8 = function (t) { this.buffer.push(255 & t); }, o.prototype.writeInt8 = o.prototype.writeUInt8, o.prototype.writeUInt16 = function (t) { var e = t >> 8 & 255, r = 255 & t; this.writeUInt8(e), this.writeUInt8(r); }, o.prototype.writeInt16 = o.prototype.writeUInt16, o.prototype.writeUInt24 = function (t) { var e = t >> 16 & 255, r = t >> 8 & 255, n = 255 & t; this.writeUInt8(e), this.writeUInt8(r), this.writeUInt8(n); }, o.prototype.writeInt24 = o.prototype.writeUInt24, o.prototype.writeUInt32 = function (t) { var e = t >> 24 & 255, r = t >> 16 & 255, n = t >> 8 & 255, i = 255 & t; this.writeUInt8(e), this.writeUInt8(r), this.writeUInt8(n), this.writeUInt8(i); }, o.prototype.writeInt32 = o.prototype.writeUInt32, o.prototype.writeBytes = function (t) { this.buffer = this.buffer.concat(Array.prototype.slice.call(t, 0)); }, o.prototype.writeString = function (t) { var e, r = t.length, n = []; for (e = 0; e < r; e++)
|
|
205
|
+
n.push(t.codePointAt(e)); this.writeBytes(n); }, o.prototype.writeVarInt = function (t) { if (t < 0)
|
|
206
|
+
throw "Cannot write negative variable-length integer"; if (t <= 127)
|
|
207
|
+
this.writeUInt8(t);
|
|
208
|
+
else {
|
|
209
|
+
var e = t, r = [];
|
|
210
|
+
for (r.push(127 & e), e >>= 7; e;) {
|
|
211
|
+
var n = 127 & e | 128;
|
|
212
|
+
r.push(n), e >>= 7;
|
|
213
|
+
}
|
|
214
|
+
this.writeBytes(r.reverse());
|
|
215
|
+
} }, o.prototype.writeChunk = function (t, e) { this.writeString(t), this.writeUInt32(e.length), this.writeBytes(e); };
|
|
216
|
+
var s = function (t, e) { if ("object" != typeof t)
|
|
217
|
+
throw "Invalid MIDI data"; e = e || {}; var r, n = t.header || {}, a = t.tracks || [], s = a.length, I = new o; for (function (t, e, r) { var n = null == e.format ? 1 : e.format, i = 128; e.timeDivision ? i = e.timeDivision : e.ticksPerFrame && e.framesPerSecond ? i = -(255 & e.framesPerSecond) << 8 | 255 & e.ticksPerFrame : e.ticksPerBeat && (i = 32767 & e.ticksPerBeat); var a = new o; a.writeUInt16(n), a.writeUInt16(r), a.writeUInt16(i), t.writeChunk("MThd", a.buffer); }(I, n, s), r = 0; r < s; r++)
|
|
218
|
+
i(I, a[r], e); return I.buffer; }, I = t.parseMidi = n, c = t.writeMidi = s;
|
|
219
|
+
exports.parseMidi = I;
|
|
220
|
+
exports.writeMidi = c;
|
|
221
|
+
//# sourceMappingURL=/sm/4ef9545b018e4043d7034a9272f1e66ac6dc613c64c28b528c827714a6c09f4f.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
export class MidyGM1 {
|
|
2
|
+
static channelSettings: {
|
|
3
|
+
volume: number;
|
|
4
|
+
pan: number;
|
|
5
|
+
vibratoRate: number;
|
|
6
|
+
vibratoDepth: number;
|
|
7
|
+
vibratoDelay: number;
|
|
8
|
+
bank: number;
|
|
9
|
+
dataMSB: number;
|
|
10
|
+
dataLSB: number;
|
|
11
|
+
program: number;
|
|
12
|
+
pitchBend: number;
|
|
13
|
+
fineTuning: number;
|
|
14
|
+
coarseTuning: number;
|
|
15
|
+
modulationDepthRange: number;
|
|
16
|
+
};
|
|
17
|
+
static effectSettings: {
|
|
18
|
+
expression: number;
|
|
19
|
+
modulation: number;
|
|
20
|
+
sustainPedal: boolean;
|
|
21
|
+
rpnMSB: number;
|
|
22
|
+
rpnLSB: number;
|
|
23
|
+
pitchBendRange: number;
|
|
24
|
+
};
|
|
25
|
+
constructor(audioContext: any);
|
|
26
|
+
ticksPerBeat: number;
|
|
27
|
+
secondsPerBeat: number;
|
|
28
|
+
totalTime: number;
|
|
29
|
+
noteCheckInterval: number;
|
|
30
|
+
lookAhead: number;
|
|
31
|
+
startDelay: number;
|
|
32
|
+
startTime: number;
|
|
33
|
+
resumeTime: number;
|
|
34
|
+
soundFonts: any[];
|
|
35
|
+
soundFontTable: any[];
|
|
36
|
+
isPlaying: boolean;
|
|
37
|
+
isPausing: boolean;
|
|
38
|
+
isPaused: boolean;
|
|
39
|
+
isStopping: boolean;
|
|
40
|
+
isSeeking: boolean;
|
|
41
|
+
timeline: any[];
|
|
42
|
+
instruments: any[];
|
|
43
|
+
notePromises: any[];
|
|
44
|
+
audioContext: any;
|
|
45
|
+
masterGain: any;
|
|
46
|
+
channels: {
|
|
47
|
+
scheduledNotes: Map<any, any>;
|
|
48
|
+
sostenutoNotes: Map<any, any>;
|
|
49
|
+
gainNode: any;
|
|
50
|
+
pannerNode: any;
|
|
51
|
+
modulationEffect: {
|
|
52
|
+
lfo: any;
|
|
53
|
+
lfoGain: any;
|
|
54
|
+
};
|
|
55
|
+
expression: number;
|
|
56
|
+
modulation: number;
|
|
57
|
+
sustainPedal: boolean;
|
|
58
|
+
rpnMSB: number;
|
|
59
|
+
rpnLSB: number;
|
|
60
|
+
pitchBendRange: number;
|
|
61
|
+
volume: number;
|
|
62
|
+
pan: number;
|
|
63
|
+
vibratoRate: number;
|
|
64
|
+
vibratoDepth: number;
|
|
65
|
+
vibratoDelay: number;
|
|
66
|
+
bank: number;
|
|
67
|
+
dataMSB: number;
|
|
68
|
+
dataLSB: number;
|
|
69
|
+
program: number;
|
|
70
|
+
pitchBend: number;
|
|
71
|
+
fineTuning: number;
|
|
72
|
+
coarseTuning: number;
|
|
73
|
+
modulationDepthRange: number;
|
|
74
|
+
}[];
|
|
75
|
+
initSoundFontTable(): any[];
|
|
76
|
+
addSoundFont(soundFont: any): void;
|
|
77
|
+
loadSoundFont(soundFontUrl: any): Promise<void>;
|
|
78
|
+
loadMIDI(midiUrl: any): Promise<void>;
|
|
79
|
+
setChannelAudioNodes(audioContext: any): {
|
|
80
|
+
gainNode: any;
|
|
81
|
+
pannerNode: any;
|
|
82
|
+
modulationEffect: {
|
|
83
|
+
lfo: any;
|
|
84
|
+
lfoGain: any;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
createChannels(audioContext: any): {
|
|
88
|
+
scheduledNotes: Map<any, any>;
|
|
89
|
+
sostenutoNotes: Map<any, any>;
|
|
90
|
+
gainNode: any;
|
|
91
|
+
pannerNode: any;
|
|
92
|
+
modulationEffect: {
|
|
93
|
+
lfo: any;
|
|
94
|
+
lfoGain: any;
|
|
95
|
+
};
|
|
96
|
+
expression: number;
|
|
97
|
+
modulation: number;
|
|
98
|
+
sustainPedal: boolean;
|
|
99
|
+
rpnMSB: number;
|
|
100
|
+
rpnLSB: number;
|
|
101
|
+
pitchBendRange: number;
|
|
102
|
+
volume: number;
|
|
103
|
+
pan: number;
|
|
104
|
+
vibratoRate: number;
|
|
105
|
+
vibratoDepth: number;
|
|
106
|
+
vibratoDelay: number;
|
|
107
|
+
bank: number;
|
|
108
|
+
dataMSB: number;
|
|
109
|
+
dataLSB: number;
|
|
110
|
+
program: number;
|
|
111
|
+
pitchBend: number;
|
|
112
|
+
fineTuning: number;
|
|
113
|
+
coarseTuning: number;
|
|
114
|
+
modulationDepthRange: number;
|
|
115
|
+
}[];
|
|
116
|
+
createNoteBuffer(noteInfo: any, isSF3: any): Promise<any>;
|
|
117
|
+
createNoteBufferNode(noteInfo: any, isSF3: any): Promise<any>;
|
|
118
|
+
convertToFloat32Array(uint8Array: any): Float32Array;
|
|
119
|
+
scheduleTimelineEvents(t: any, offset: any, queueIndex: any): Promise<any>;
|
|
120
|
+
getQueueIndex(second: any): number;
|
|
121
|
+
playNotes(): Promise<any>;
|
|
122
|
+
ticksToSecond(ticks: any, secondsPerBeat: any): number;
|
|
123
|
+
secondToTicks(second: any, secondsPerBeat: any): number;
|
|
124
|
+
extractMidiData(midi: any): {
|
|
125
|
+
instruments: Set<any>;
|
|
126
|
+
timeline: any[];
|
|
127
|
+
};
|
|
128
|
+
stopNotes(): Promise<any[]>;
|
|
129
|
+
start(): Promise<void>;
|
|
130
|
+
stop(): void;
|
|
131
|
+
pause(): void;
|
|
132
|
+
resume(): Promise<void>;
|
|
133
|
+
seekTo(second: any): void;
|
|
134
|
+
calcTotalTime(): number;
|
|
135
|
+
currentTime(): number;
|
|
136
|
+
getActiveNotes(channel: any): Map<any, any>;
|
|
137
|
+
getActiveChannelNotes(scheduledNotes: any): any;
|
|
138
|
+
createModulationEffect(audioContext: any): {
|
|
139
|
+
lfo: any;
|
|
140
|
+
lfoGain: any;
|
|
141
|
+
};
|
|
142
|
+
createReverbEffect(audioContext: any, options?: {}): {
|
|
143
|
+
convolverNode: any;
|
|
144
|
+
dryGain: any;
|
|
145
|
+
wetGain: any;
|
|
146
|
+
};
|
|
147
|
+
connectNoteEffects(channel: any, gainNode: any): void;
|
|
148
|
+
cbToRatio(cb: any): number;
|
|
149
|
+
centToHz(cent: any): number;
|
|
150
|
+
createNoteAudioChain(channel: any, noteInfo: any, noteNumber: any, velocity: any, startTime: any, isSF3: any): Promise<{
|
|
151
|
+
bufferSource: any;
|
|
152
|
+
gainNode: any;
|
|
153
|
+
filterNode: any;
|
|
154
|
+
}>;
|
|
155
|
+
scheduleNoteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any): Promise<void>;
|
|
156
|
+
noteOn(channelNumber: any, noteNumber: any, velocity: any): Promise<void>;
|
|
157
|
+
scheduleNoteRelease(channelNumber: any, noteNumber: any, velocity: any, stopTime: any, stopPedal?: boolean): Promise<any> | undefined;
|
|
158
|
+
releaseNote(channelNumber: any, noteNumber: any, velocity: any): Promise<any> | undefined;
|
|
159
|
+
releaseSustainPedal(channelNumber: any): void;
|
|
160
|
+
handleMIDIMessage(statusByte: any, data1: any, data2: any): void | any[] | Promise<any>;
|
|
161
|
+
handlePolyphonicKeyPressure(channelNumber: any, noteNumber: any, pressure: any): void;
|
|
162
|
+
handleProgramChange(channelNumber: any, program: any): void;
|
|
163
|
+
handleChannelPressure(channelNumber: any, pressure: any): void;
|
|
164
|
+
handlePitchBend(channelNumber: any, lsb: any, msb: any): void;
|
|
165
|
+
handleControlChange(channelNumber: any, controller: any, value: any): void | any[];
|
|
166
|
+
setModulation(channelNumber: any, modulation: any): void;
|
|
167
|
+
setVolume(channelNumber: any, volume: any): void;
|
|
168
|
+
setPan(channelNumber: any, pan: any): void;
|
|
169
|
+
setExpression(channelNumber: any, expression: any): void;
|
|
170
|
+
updateChannelGain(channel: any): void;
|
|
171
|
+
setSustainPedal(channelNumber: any, value: any): void;
|
|
172
|
+
setRPNMSB(channelNumber: any, value: any): void;
|
|
173
|
+
setRPNLSB(channelNumber: any, value: any): void;
|
|
174
|
+
setDataEntry(channelNumber: any, value: any, isMSB: any): void;
|
|
175
|
+
allSoundOff(channelNumber: any): any[];
|
|
176
|
+
resetAllControllers(channelNumber: any): void;
|
|
177
|
+
allNotesOff(channelNumber: any): any[];
|
|
178
|
+
handleUniversalNonRealTimeExclusiveMessage(data: any): void;
|
|
179
|
+
GM1SystemOn(): void;
|
|
180
|
+
handleUniversalRealTimeExclusiveMessage(data: any): void;
|
|
181
|
+
handleMasterVolumeSysEx(data: any): void;
|
|
182
|
+
handleMasterVolume(volume: any): void;
|
|
183
|
+
handleExclusiveMessage(data: any): void;
|
|
184
|
+
handleSysEx(data: any): void;
|
|
185
|
+
scheduleTask(callback: any, startTime: any): Promise<any>;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=midy-GM1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midy-GM1.d.ts","sourceRoot":"","sources":["../src/midy-GM1.js"],"names":[],"mappings":"AAMA;IAoBE;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;MAOE;IAEF,+BAMC;IAlDD,qBAAmB;IACnB,uBAAqB;IACrB,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;IA4BhB,kBAAgC;IAChC,gBAA4C;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAiD;IAInD,4BAMC;IAED,mCASC;IAED,gDAMC;IAED,sCASC;IAED;;;;;;;MAgBC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWC;IAED,0DAyBC;IAED,8DAUC;IAED,qDAOC;IAED,2EA6CC;IAED,mCAQC;IAED,0BA+CC;IAED,uDAEC;IAED,wDAEC;IAED;;;MA0DC;IAED,4BAsBC;IAED,uBAKC;IAED,aAGC;IAED,cAKC;IAED,wBAIC;IAED,0BAKC;IAED,wBA2BC;IAED,sBAGC;IAED,4CASC;IAED,gDAKC;IAED;;;MAUC;IAED;;;;MAoCC;IAED,sDAEC;IAED,2BAEC;IAED,4BAEC;IAED;;;;OAoEC;IAED,kGAsCC;IAED,0EAGC;IAED,sIAuCC;IAED,0FAGC;IAED,8CAmBC;IAED,wFAqBC;IAED,sFAeC;IAED,4DAGC;IAED,+DAEC;IAED,8DAGC;IAED,mFA+BC;IAED,yDAQC;IAED,iDAIC;IAED,2CAMC;IAED,yDAIC;IAED,sCAKC;IAED,sDAKC;IAED,gDAEC;IAED,gDAEC;IAED,+DAoBC;IAED,uCAoBC;IAED,8CAEC;IAED,uCAoBC;IAED,4DAgBC;IAED,oBAQC;IAED,yDAaC;IAED,yCAGC;IAED,sCAIC;IAED,wCAEC;IAED,6BASC;IAED,0DAUC;CACF"}
|