@marmooo/midy 0.4.1 → 0.4.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/README.md +12 -0
- package/esm/midy-GM1.d.ts +8 -7
- package/esm/midy-GM1.d.ts.map +1 -1
- package/esm/midy-GM1.js +102 -58
- package/esm/midy-GM2.d.ts +8 -7
- package/esm/midy-GM2.d.ts.map +1 -1
- package/esm/midy-GM2.js +120 -68
- package/esm/midy-GMLite.d.ts +7 -6
- package/esm/midy-GMLite.d.ts.map +1 -1
- package/esm/midy-GMLite.js +98 -56
- package/esm/midy.d.ts +10 -7
- package/esm/midy.d.ts.map +1 -1
- package/esm/midy.js +162 -80
- package/package.json +1 -1
- package/script/midy-GM1.d.ts +8 -7
- package/script/midy-GM1.d.ts.map +1 -1
- package/script/midy-GM1.js +102 -58
- package/script/midy-GM2.d.ts +8 -7
- package/script/midy-GM2.d.ts.map +1 -1
- package/script/midy-GM2.js +120 -68
- package/script/midy-GMLite.d.ts +7 -6
- package/script/midy-GMLite.d.ts.map +1 -1
- package/script/midy-GMLite.js +98 -56
- package/script/midy.d.ts +10 -7
- package/script/midy.d.ts.map +1 -1
- package/script/midy.js +162 -80
package/script/midy-GMLite.js
CHANGED
|
@@ -29,12 +29,6 @@ class Note {
|
|
|
29
29
|
writable: true,
|
|
30
30
|
value: false
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(this, "pending", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true,
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
32
|
Object.defineProperty(this, "bufferSource", {
|
|
39
33
|
enumerable: true,
|
|
40
34
|
configurable: true,
|
|
@@ -80,6 +74,9 @@ class Note {
|
|
|
80
74
|
this.noteNumber = noteNumber;
|
|
81
75
|
this.velocity = velocity;
|
|
82
76
|
this.startTime = startTime;
|
|
77
|
+
this.ready = new Promise((resolve) => {
|
|
78
|
+
this.resolveReady = resolve;
|
|
79
|
+
});
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
const drumExclusiveClasses = new Uint8Array(128);
|
|
@@ -166,8 +163,9 @@ const pitchEnvelopeKeys = [
|
|
|
166
163
|
"playbackRate",
|
|
167
164
|
];
|
|
168
165
|
const pitchEnvelopeKeySet = new Set(pitchEnvelopeKeys);
|
|
169
|
-
class MidyGMLite {
|
|
166
|
+
class MidyGMLite extends EventTarget {
|
|
170
167
|
constructor(audioContext) {
|
|
168
|
+
super();
|
|
171
169
|
Object.defineProperty(this, "mode", {
|
|
172
170
|
enumerable: true,
|
|
173
171
|
configurable: true,
|
|
@@ -282,6 +280,12 @@ class MidyGMLite {
|
|
|
282
280
|
writable: true,
|
|
283
281
|
value: false
|
|
284
282
|
});
|
|
283
|
+
Object.defineProperty(this, "loop", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
configurable: true,
|
|
286
|
+
writable: true,
|
|
287
|
+
value: false
|
|
288
|
+
});
|
|
285
289
|
Object.defineProperty(this, "playPromise", {
|
|
286
290
|
enumerable: true,
|
|
287
291
|
configurable: true,
|
|
@@ -477,7 +481,7 @@ class MidyGMLite {
|
|
|
477
481
|
}
|
|
478
482
|
return bufferSource;
|
|
479
483
|
}
|
|
480
|
-
|
|
484
|
+
scheduleTimelineEvents(scheduleTime, queueIndex) {
|
|
481
485
|
const timeOffset = this.resumeTime - this.startTime;
|
|
482
486
|
const lookAheadCheckTime = scheduleTime + timeOffset + this.lookAhead;
|
|
483
487
|
const schedulingOffset = this.startDelay - timeOffset;
|
|
@@ -489,7 +493,7 @@ class MidyGMLite {
|
|
|
489
493
|
const startTime = event.startTime + schedulingOffset;
|
|
490
494
|
switch (event.type) {
|
|
491
495
|
case "noteOn":
|
|
492
|
-
|
|
496
|
+
this.noteOn(event.channel, event.noteNumber, event.velocity, startTime);
|
|
493
497
|
break;
|
|
494
498
|
case "noteOff": {
|
|
495
499
|
this.noteOff(event.channel, event.noteNumber, event.velocity, startTime, false);
|
|
@@ -530,22 +534,23 @@ class MidyGMLite {
|
|
|
530
534
|
}
|
|
531
535
|
}
|
|
532
536
|
updateStates(queueIndex, nextQueueIndex) {
|
|
537
|
+
const now = this.audioContext.currentTime;
|
|
533
538
|
if (nextQueueIndex < queueIndex)
|
|
534
539
|
queueIndex = 0;
|
|
535
540
|
for (let i = queueIndex; i < nextQueueIndex; i++) {
|
|
536
541
|
const event = this.timeline[i];
|
|
537
542
|
switch (event.type) {
|
|
538
543
|
case "controller":
|
|
539
|
-
this.setControlChange(event.channel, event.controllerType, event.value,
|
|
544
|
+
this.setControlChange(event.channel, event.controllerType, event.value, now - this.resumeTime + event.startTime);
|
|
540
545
|
break;
|
|
541
546
|
case "programChange":
|
|
542
|
-
this.setProgramChange(event.channel, event.programNumber,
|
|
547
|
+
this.setProgramChange(event.channel, event.programNumber, now - this.resumeTime + event.startTime);
|
|
543
548
|
break;
|
|
544
549
|
case "pitchBend":
|
|
545
|
-
this.setPitchBend(event.channel, event.value + 8192,
|
|
550
|
+
this.setPitchBend(event.channel, event.value + 8192, now - this.resumeTime + event.startTime);
|
|
546
551
|
break;
|
|
547
552
|
case "sysEx":
|
|
548
|
-
this.handleSysEx(event.data,
|
|
553
|
+
this.handleSysEx(event.data, now - this.resumeTime + event.startTime);
|
|
549
554
|
}
|
|
550
555
|
}
|
|
551
556
|
}
|
|
@@ -553,50 +558,80 @@ class MidyGMLite {
|
|
|
553
558
|
if (this.audioContext.state === "suspended") {
|
|
554
559
|
await this.audioContext.resume();
|
|
555
560
|
}
|
|
561
|
+
const paused = this.isPaused;
|
|
556
562
|
this.isPlaying = true;
|
|
557
563
|
this.isPaused = false;
|
|
558
564
|
this.startTime = this.audioContext.currentTime;
|
|
565
|
+
if (paused) {
|
|
566
|
+
this.dispatchEvent(new Event("resumed"));
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
this.dispatchEvent(new Event("started"));
|
|
570
|
+
}
|
|
559
571
|
let queueIndex = this.getQueueIndex(this.resumeTime);
|
|
560
|
-
let
|
|
572
|
+
let exitReason;
|
|
561
573
|
this.notePromises = [];
|
|
562
|
-
while (
|
|
574
|
+
while (true) {
|
|
563
575
|
const now = this.audioContext.currentTime;
|
|
576
|
+
if (this.timeline.length <= queueIndex) {
|
|
577
|
+
await this.stopNotes(0, true, now);
|
|
578
|
+
if (this.loop) {
|
|
579
|
+
this.notePromises = [];
|
|
580
|
+
this.resetAllStates();
|
|
581
|
+
this.startTime = this.audioContext.currentTime;
|
|
582
|
+
this.resumeTime = 0;
|
|
583
|
+
queueIndex = 0;
|
|
584
|
+
this.dispatchEvent(new Event("looped"));
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
await this.audioContext.suspend();
|
|
589
|
+
exitReason = "ended";
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
564
593
|
if (this.isPausing) {
|
|
565
594
|
await this.stopNotes(0, true, now);
|
|
566
595
|
await this.audioContext.suspend();
|
|
567
596
|
this.notePromises = [];
|
|
597
|
+
this.isPausing = false;
|
|
598
|
+
exitReason = "paused";
|
|
568
599
|
break;
|
|
569
600
|
}
|
|
570
601
|
else if (this.isStopping) {
|
|
571
602
|
await this.stopNotes(0, true, now);
|
|
572
603
|
await this.audioContext.suspend();
|
|
573
|
-
|
|
604
|
+
this.isStopping = false;
|
|
605
|
+
exitReason = "stopped";
|
|
574
606
|
break;
|
|
575
607
|
}
|
|
576
608
|
else if (this.isSeeking) {
|
|
577
|
-
|
|
609
|
+
this.stopNotes(0, true, now);
|
|
578
610
|
this.startTime = this.audioContext.currentTime;
|
|
579
611
|
const nextQueueIndex = this.getQueueIndex(this.resumeTime);
|
|
580
612
|
this.updateStates(queueIndex, nextQueueIndex);
|
|
581
613
|
queueIndex = nextQueueIndex;
|
|
582
614
|
this.isSeeking = false;
|
|
615
|
+
this.dispatchEvent(new Event("seeked"));
|
|
583
616
|
continue;
|
|
584
617
|
}
|
|
585
|
-
queueIndex =
|
|
618
|
+
queueIndex = this.scheduleTimelineEvents(now, queueIndex);
|
|
586
619
|
const waitTime = now + this.noteCheckInterval;
|
|
587
620
|
await this.scheduleTask(() => { }, waitTime);
|
|
588
621
|
}
|
|
589
|
-
if (
|
|
590
|
-
const now = this.audioContext.currentTime;
|
|
591
|
-
await this.stopNotes(0, true, now);
|
|
592
|
-
await this.audioContext.suspend();
|
|
593
|
-
finished = true;
|
|
594
|
-
}
|
|
595
|
-
if (finished) {
|
|
622
|
+
if (exitReason !== "paused") {
|
|
596
623
|
this.notePromises = [];
|
|
597
624
|
this.resetAllStates();
|
|
598
625
|
}
|
|
599
626
|
this.isPlaying = false;
|
|
627
|
+
if (exitReason === "paused") {
|
|
628
|
+
this.isPaused = true;
|
|
629
|
+
this.dispatchEvent(new Event("paused"));
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
this.isPaused = false;
|
|
633
|
+
this.dispatchEvent(new Event(exitReason));
|
|
634
|
+
}
|
|
600
635
|
}
|
|
601
636
|
ticksToSecond(ticks, secondsPerBeat) {
|
|
602
637
|
return ticks * secondsPerBeat / this.ticksPerBeat;
|
|
@@ -703,24 +738,20 @@ class MidyGMLite {
|
|
|
703
738
|
return;
|
|
704
739
|
this.isStopping = true;
|
|
705
740
|
await this.playPromise;
|
|
706
|
-
this.isStopping = false;
|
|
707
741
|
}
|
|
708
742
|
async pause() {
|
|
709
743
|
if (!this.isPlaying || this.isPaused)
|
|
710
744
|
return;
|
|
711
745
|
const now = this.audioContext.currentTime;
|
|
712
|
-
this.resumeTime = now
|
|
746
|
+
this.resumeTime = now + this.resumeTime - this.startTime;
|
|
713
747
|
this.isPausing = true;
|
|
714
748
|
await this.playPromise;
|
|
715
|
-
this.isPausing = false;
|
|
716
|
-
this.isPaused = true;
|
|
717
749
|
}
|
|
718
750
|
async resume() {
|
|
719
751
|
if (!this.isPaused)
|
|
720
752
|
return;
|
|
721
753
|
this.playPromise = this.playNotes();
|
|
722
754
|
await this.playPromise;
|
|
723
|
-
this.isPaused = false;
|
|
724
755
|
}
|
|
725
756
|
seekTo(second) {
|
|
726
757
|
this.resumeTime = second;
|
|
@@ -743,19 +774,23 @@ class MidyGMLite {
|
|
|
743
774
|
const now = this.audioContext.currentTime;
|
|
744
775
|
return now + this.resumeTime - this.startTime;
|
|
745
776
|
}
|
|
746
|
-
processScheduledNotes(channel, callback) {
|
|
777
|
+
async processScheduledNotes(channel, callback) {
|
|
747
778
|
const scheduledNotes = channel.scheduledNotes;
|
|
779
|
+
const tasks = [];
|
|
748
780
|
for (let i = channel.scheduleIndex; i < scheduledNotes.length; i++) {
|
|
749
781
|
const note = scheduledNotes[i];
|
|
750
782
|
if (!note)
|
|
751
783
|
continue;
|
|
752
784
|
if (note.ending)
|
|
753
785
|
continue;
|
|
754
|
-
callback(note);
|
|
786
|
+
const task = note.ready.then(() => callback(note));
|
|
787
|
+
tasks.push(task);
|
|
755
788
|
}
|
|
789
|
+
await Promise.all(tasks);
|
|
756
790
|
}
|
|
757
|
-
processActiveNotes(channel, scheduleTime, callback) {
|
|
791
|
+
async processActiveNotes(channel, scheduleTime, callback) {
|
|
758
792
|
const scheduledNotes = channel.scheduledNotes;
|
|
793
|
+
const tasks = [];
|
|
759
794
|
for (let i = channel.scheduleIndex; i < scheduledNotes.length; i++) {
|
|
760
795
|
const note = scheduledNotes[i];
|
|
761
796
|
if (!note)
|
|
@@ -764,8 +799,10 @@ class MidyGMLite {
|
|
|
764
799
|
continue;
|
|
765
800
|
if (scheduleTime < note.startTime)
|
|
766
801
|
break;
|
|
767
|
-
callback(note);
|
|
802
|
+
const task = note.ready.then(() => callback(note));
|
|
803
|
+
tasks.push(task);
|
|
768
804
|
}
|
|
805
|
+
await Promise.all(tasks);
|
|
769
806
|
}
|
|
770
807
|
cbToRatio(cb) {
|
|
771
808
|
return Math.pow(10, cb / 200);
|
|
@@ -1001,11 +1038,7 @@ class MidyGMLite {
|
|
|
1001
1038
|
return;
|
|
1002
1039
|
await this.setNoteAudioNode(channel, note, realtime);
|
|
1003
1040
|
this.setNoteRouting(channelNumber, note, startTime);
|
|
1004
|
-
note.
|
|
1005
|
-
const off = note.offEvent;
|
|
1006
|
-
if (off) {
|
|
1007
|
-
this.noteOff(channelNumber, noteNumber, off.velocity, off.startTime);
|
|
1008
|
-
}
|
|
1041
|
+
note.resolveReady();
|
|
1009
1042
|
}
|
|
1010
1043
|
disconnectNote(note) {
|
|
1011
1044
|
note.bufferSource.disconnect();
|
|
@@ -1039,7 +1072,7 @@ class MidyGMLite {
|
|
|
1039
1072
|
}, stopTime);
|
|
1040
1073
|
});
|
|
1041
1074
|
}
|
|
1042
|
-
noteOff(channelNumber, noteNumber,
|
|
1075
|
+
async noteOff(channelNumber, noteNumber, _velocity, endTime, force) {
|
|
1043
1076
|
const channel = this.channels[channelNumber];
|
|
1044
1077
|
if (!force) {
|
|
1045
1078
|
if (channel.isDrum)
|
|
@@ -1051,13 +1084,11 @@ class MidyGMLite {
|
|
|
1051
1084
|
if (index < 0)
|
|
1052
1085
|
return;
|
|
1053
1086
|
const note = channel.scheduledNotes[index];
|
|
1054
|
-
if (note.pending) {
|
|
1055
|
-
note.offEvent = { velocity, startTime: endTime };
|
|
1056
|
-
return;
|
|
1057
|
-
}
|
|
1058
1087
|
note.ending = true;
|
|
1059
1088
|
this.setNoteIndex(channel, index);
|
|
1060
|
-
const promise =
|
|
1089
|
+
const promise = note.ready.then(() => {
|
|
1090
|
+
return this.releaseNote(channel, note, endTime);
|
|
1091
|
+
});
|
|
1061
1092
|
this.notePromises.push(promise);
|
|
1062
1093
|
return promise;
|
|
1063
1094
|
}
|
|
@@ -1145,7 +1176,8 @@ class MidyGMLite {
|
|
|
1145
1176
|
}
|
|
1146
1177
|
setPitchBend(channelNumber, value, scheduleTime) {
|
|
1147
1178
|
const channel = this.channels[channelNumber];
|
|
1148
|
-
|
|
1179
|
+
if (!(0 <= scheduleTime))
|
|
1180
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1149
1181
|
const state = channel.state;
|
|
1150
1182
|
const prev = state.pitchWheel * 2 - 1;
|
|
1151
1183
|
const next = (value - 8192) / 8192;
|
|
@@ -1309,12 +1341,14 @@ class MidyGMLite {
|
|
|
1309
1341
|
}
|
|
1310
1342
|
setModulationDepth(channelNumber, modulation, scheduleTime) {
|
|
1311
1343
|
const channel = this.channels[channelNumber];
|
|
1312
|
-
|
|
1344
|
+
if (!(0 <= scheduleTime))
|
|
1345
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1313
1346
|
channel.state.modulationDepth = modulation / 127;
|
|
1314
1347
|
this.updateModulation(channel, scheduleTime);
|
|
1315
1348
|
}
|
|
1316
1349
|
setVolume(channelNumber, volume, scheduleTime) {
|
|
1317
|
-
|
|
1350
|
+
if (!(0 <= scheduleTime))
|
|
1351
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1318
1352
|
const channel = this.channels[channelNumber];
|
|
1319
1353
|
channel.state.volume = volume / 127;
|
|
1320
1354
|
this.updateChannelVolume(channel, scheduleTime);
|
|
@@ -1327,13 +1361,15 @@ class MidyGMLite {
|
|
|
1327
1361
|
};
|
|
1328
1362
|
}
|
|
1329
1363
|
setPan(channelNumber, pan, scheduleTime) {
|
|
1330
|
-
|
|
1364
|
+
if (!(0 <= scheduleTime))
|
|
1365
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1331
1366
|
const channel = this.channels[channelNumber];
|
|
1332
1367
|
channel.state.pan = pan / 127;
|
|
1333
1368
|
this.updateChannelVolume(channel, scheduleTime);
|
|
1334
1369
|
}
|
|
1335
1370
|
setExpression(channelNumber, expression, scheduleTime) {
|
|
1336
|
-
|
|
1371
|
+
if (!(0 <= scheduleTime))
|
|
1372
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1337
1373
|
const channel = this.channels[channelNumber];
|
|
1338
1374
|
channel.state.expression = expression / 127;
|
|
1339
1375
|
this.updateChannelVolume(channel, scheduleTime);
|
|
@@ -1355,7 +1391,8 @@ class MidyGMLite {
|
|
|
1355
1391
|
}
|
|
1356
1392
|
setSustainPedal(channelNumber, value, scheduleTime) {
|
|
1357
1393
|
const channel = this.channels[channelNumber];
|
|
1358
|
-
|
|
1394
|
+
if (!(0 <= scheduleTime))
|
|
1395
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1359
1396
|
channel.state.sustainPedal = value / 127;
|
|
1360
1397
|
if (64 <= value) {
|
|
1361
1398
|
this.processScheduledNotes(channel, (note) => {
|
|
@@ -1413,7 +1450,8 @@ class MidyGMLite {
|
|
|
1413
1450
|
}
|
|
1414
1451
|
setPitchBendRange(channelNumber, value, scheduleTime) {
|
|
1415
1452
|
const channel = this.channels[channelNumber];
|
|
1416
|
-
|
|
1453
|
+
if (!(0 <= scheduleTime))
|
|
1454
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1417
1455
|
const state = channel.state;
|
|
1418
1456
|
const prev = state.pitchWheelSensitivity;
|
|
1419
1457
|
const next = value / 12800;
|
|
@@ -1423,7 +1461,8 @@ class MidyGMLite {
|
|
|
1423
1461
|
this.applyVoiceParams(channel, 16, scheduleTime);
|
|
1424
1462
|
}
|
|
1425
1463
|
allSoundOff(channelNumber, _value, scheduleTime) {
|
|
1426
|
-
|
|
1464
|
+
if (!(0 <= scheduleTime))
|
|
1465
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1427
1466
|
return this.stopActiveNotes(channelNumber, 0, true, scheduleTime);
|
|
1428
1467
|
}
|
|
1429
1468
|
resetChannelStates(channelNumber) {
|
|
@@ -1475,7 +1514,8 @@ class MidyGMLite {
|
|
|
1475
1514
|
}
|
|
1476
1515
|
}
|
|
1477
1516
|
allNotesOff(channelNumber, _value, scheduleTime) {
|
|
1478
|
-
|
|
1517
|
+
if (!(0 <= scheduleTime))
|
|
1518
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1479
1519
|
return this.stopActiveNotes(channelNumber, 0, false, scheduleTime);
|
|
1480
1520
|
}
|
|
1481
1521
|
handleUniversalNonRealTimeExclusiveMessage(data, scheduleTime) {
|
|
@@ -1496,7 +1536,8 @@ class MidyGMLite {
|
|
|
1496
1536
|
}
|
|
1497
1537
|
}
|
|
1498
1538
|
GM1SystemOn(scheduleTime) {
|
|
1499
|
-
|
|
1539
|
+
if (!(0 <= scheduleTime))
|
|
1540
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1500
1541
|
this.mode = "GM1";
|
|
1501
1542
|
for (let i = 0; i < this.channels.length; i++) {
|
|
1502
1543
|
this.allSoundOff(i, 0, scheduleTime);
|
|
@@ -1524,7 +1565,8 @@ class MidyGMLite {
|
|
|
1524
1565
|
this.setMasterVolume(volume, scheduleTime);
|
|
1525
1566
|
}
|
|
1526
1567
|
setMasterVolume(value, scheduleTime) {
|
|
1527
|
-
|
|
1568
|
+
if (!(0 <= scheduleTime))
|
|
1569
|
+
scheduleTime = this.audioContext.currentTime;
|
|
1528
1570
|
this.masterVolume.gain
|
|
1529
1571
|
.cancelScheduledValues(scheduleTime)
|
|
1530
1572
|
.setValueAtTime(value * value, scheduleTime);
|
package/script/midy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Midy {
|
|
1
|
+
export class Midy extends EventTarget {
|
|
2
2
|
static channelSettings: {
|
|
3
3
|
scheduleIndex: number;
|
|
4
4
|
detune: number;
|
|
@@ -51,6 +51,8 @@ export class Midy {
|
|
|
51
51
|
isPaused: boolean;
|
|
52
52
|
isStopping: boolean;
|
|
53
53
|
isSeeking: boolean;
|
|
54
|
+
loop: boolean;
|
|
55
|
+
loopStart: number;
|
|
54
56
|
playPromise: any;
|
|
55
57
|
timeline: any[];
|
|
56
58
|
notePromises: any[];
|
|
@@ -106,7 +108,7 @@ export class Midy {
|
|
|
106
108
|
createAudioBuffer(voiceParams: any): Promise<any>;
|
|
107
109
|
isLoopDrum(channel: any, noteNumber: any): boolean;
|
|
108
110
|
createBufferSource(channel: any, noteNumber: any, voiceParams: any, audioBuffer: any): any;
|
|
109
|
-
scheduleTimelineEvents(scheduleTime: any, queueIndex: any):
|
|
111
|
+
scheduleTimelineEvents(scheduleTime: any, queueIndex: any): any;
|
|
110
112
|
getQueueIndex(second: any): number;
|
|
111
113
|
resetAllStates(): void;
|
|
112
114
|
updateStates(queueIndex: any, nextQueueIndex: any): void;
|
|
@@ -128,8 +130,8 @@ export class Midy {
|
|
|
128
130
|
seekTo(second: any): void;
|
|
129
131
|
calcTotalTime(): number;
|
|
130
132
|
currentTime(): number;
|
|
131
|
-
processScheduledNotes(channel: any, callback: any): void
|
|
132
|
-
processActiveNotes(channel: any, scheduleTime: any, callback: any): void
|
|
133
|
+
processScheduledNotes(channel: any, callback: any): Promise<void>;
|
|
134
|
+
processActiveNotes(channel: any, scheduleTime: any, callback: any): Promise<void>;
|
|
133
135
|
createConvolutionReverbImpulse(audioContext: any, decay: any, preDecay: any): any;
|
|
134
136
|
createConvolutionReverb(audioContext: any, impulse: any): {
|
|
135
137
|
input: any;
|
|
@@ -183,11 +185,11 @@ export class Midy {
|
|
|
183
185
|
noteOn(channelNumber: any, noteNumber: any, velocity: any, startTime: any): Promise<void>;
|
|
184
186
|
disconnectNote(note: any): void;
|
|
185
187
|
releaseNote(channel: any, note: any, endTime: any): Promise<any>;
|
|
186
|
-
noteOff(channelNumber: any, noteNumber: any,
|
|
188
|
+
noteOff(channelNumber: any, noteNumber: any, _velocity: any, endTime: any, force: any): any;
|
|
187
189
|
setNoteIndex(channel: any, index: any): void;
|
|
188
190
|
findNoteOffIndex(channel: any, noteNumber: any): any;
|
|
189
|
-
releaseSustainPedal(channelNumber: any, halfVelocity: any, scheduleTime: any):
|
|
190
|
-
releaseSostenutoPedal(channelNumber: any, halfVelocity: any, scheduleTime: any):
|
|
191
|
+
releaseSustainPedal(channelNumber: any, halfVelocity: any, scheduleTime: any): any[];
|
|
192
|
+
releaseSostenutoPedal(channelNumber: any, halfVelocity: any, scheduleTime: any): any[];
|
|
191
193
|
createMessageHandlers(): any[];
|
|
192
194
|
handleMessage(data: any, scheduleTime: any): void;
|
|
193
195
|
activeSensing(): void;
|
|
@@ -272,6 +274,7 @@ export class Midy {
|
|
|
272
274
|
setCoarseTuning(channelNumber: any, value: any, scheduleTime: any): void;
|
|
273
275
|
handleModulationDepthRangeRPN(channelNumber: any, scheduleTime: any): void;
|
|
274
276
|
setModulationDepthRange(channelNumber: any, value: any, scheduleTime: any): void;
|
|
277
|
+
setRPGMakerLoop(_channelNumber: any, _value: any, scheduleTime: any): void;
|
|
275
278
|
allSoundOff(channelNumber: any, _value: any, scheduleTime: any): Promise<any[]>;
|
|
276
279
|
resetChannelStates(channelNumber: any): void;
|
|
277
280
|
resetAllControllers(channelNumber: any, _value: any, scheduleTime: any): void;
|
package/script/midy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"midy.d.ts","sourceRoot":"","sources":["../src/midy.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"midy.d.ts","sourceRoot":"","sources":["../src/midy.js"],"names":[],"mappings":"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"}
|