-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.d.ts
1680 lines (1645 loc) · 62 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import 'webmidi';
declare namespace JZZ {
namespace SMPTE {
interface Constructor {
/** Create new SMPTE object
*
* https://jazz-soft.net/doc/JZZ/smpte.html#constructor */
new (...args: any[]): SMPTE;
/** Create new SMPTE object
*
* https://jazz-soft.net/doc/JZZ/smpte.html#constructor */
(...args: any[]): SMPTE;
}
}
interface SMPTE {
/** Convert SMPTE to human-readable string
*
* https://jazz-soft.net/doc/JZZ/smpte.html#tostring */
toString(): string;
/** SMPTE event is Full Frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#isFullFrame */
isFullFrame(): boolean;
/** Get SMPTE type
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getType */
getType(): number;
/** Get SMPTE hour
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getHour */
getHour(): number;
/** Get SMPTE minute
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getMinute */
getMinute(): number;
/** Get SMPTE second
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getSecond */
getSecond(): number;
/** Get SMPTE frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getFrame */
getFrame(): number;
/** Get SMPTE quarter frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#getQuarter */
getQuarter(): number;
/** Set SMPTE type
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setType */
setType(n: number): SMPTE;
/** Set SMPTE hour
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setHour */
setHour(n: number): SMPTE;
/** Set SMPTE minute
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setMinute */
setMinute(n: number): SMPTE;
/** Set SMPTE second
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setSecond */
setSecond(n: number): SMPTE;
/** Set SMPTE frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setFrame */
setFrame(n: number): SMPTE;
/** Set SMPTE quarter frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#setQuarter */
setQuarter(n: number): SMPTE;
/** Increase SMPTE time by one frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#incrFrame */
incrFrame(): SMPTE;
/** Decrease SMPTE time by one frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#decrFrame */
decrFrame(): SMPTE;
/** Increase SMPTE time by quarter frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#incrQF */
incrQF(): SMPTE;
/** Decrease SMPTE time by quarter frame
*
* https://jazz-soft.net/doc/JZZ/smpte.html#decrQF */
decrQF(): SMPTE;
/** Read MIDI Time Code message
*
* https://jazz-soft.net/doc/JZZ/smpte.html#read */
read(...args: any[]): boolean;
/** Reset SMPTE object
*
* https://jazz-soft.net/doc/JZZ/smpte.html#reset */
reset(...args: any[]): SMPTE;
}
namespace MIDI {
interface Constructor {
/** Create new MIDI message
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#constructor */
new (...args: any[]): MIDI;
/** Create new MIDI message
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#constructor */
(...args: any[]): MIDI;
// Channel-dependent
/** Note On: `[9x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOn */
noteOn(x: number, nn: number | string, vv?: number): MIDI;
/** Note Off: `[8x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOff */
noteOff(x: number, nn: number | string, vv?: number): MIDI;
/** Polyphonic aftetouch: `[Ax nn vv]`; `x`: channel, `nn`: note, `vv`: value
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#aftertouch */
aftertouch(x: number, nn: number | string, vv: number): MIDI;
/** MIDI control: `[Bx nn vv]`; `x`: channel, `nn`: function, `vv`: value
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#control */
control(x: number, nn: number, vv: number): MIDI;
/** Program change: `[Cx nn]`; `x`: channel, `nn`: program
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#program */
program(x: number, nn: number | string): MIDI;
/** Pressure: `[Dx nn]`; `x`: channel, `nn`: pressure
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#pressure */
pressure(x: number, nn: number): MIDI;
/** Pitch bend: `[Ex lsb msb]`; `x`: channel, `msb`/`lsb`: most/least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#pitchBend */
pitchBend(x: number, nn: number): MIDI;
/** Bank select MSB: `[Bx 00 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#bankMSB */
bankMSB(x: number, nn: number): MIDI;
/** Bank select LSB: `[Bx 20 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#bankLSB */
bankLSB(x: number, nn: number): MIDI;
/** Modulation MSB: `[Bx 01 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#modMSB */
modMSB(x: number, nn: number): MIDI;
/** Modulation LSB: `[Bx 21 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#modLSB */
modLSB(x: number, nn: number): MIDI;
/** Breath controller MSB: `[Bx 02 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#breathMSB */
breathMSB(x: number, nn: number): MIDI;
/** Breath controller LSB: `[Bx 22 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#breathLSB */
breathLSB(x: number, nn: number): MIDI;
/** Foot controller MSB: `[Bx 04 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#footMSB */
footMSB(x: number, nn: number): MIDI;
/** Foot controller LSB: `[Bx 24 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#footLSB */
footLSB(x: number, nn: number): MIDI;
/** Portamento MSB: `[Bx 05 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamentoMSB */
portamentoMSB(x: number, nn: number): MIDI;
/** Portamento LSB: `[Bx 25 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamentoLSB */
portamentoLSB(x: number, nn: number): MIDI;
/** Volume MSB: `[Bx 07 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#volumeMSB */
volumeMSB(x: number, nn: number): MIDI;
/** Volume LSB: `[Bx 27 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#volumeLSB */
volumeLSB(x: number, nn: number): MIDI;
/** Balance MSB: `[Bx 08 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#balanceMSB */
balanceMSB(x: number, nn: number): MIDI;
/** Balance LSB: `[Bx 28 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#balanceLSB */
balanceLSB(x: number, nn: number): MIDI;
/** Pan MSB: `[Bx 0A nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#panMSB */
panMSB(x: number, nn: number): MIDI;
/** Pan LSB: `[Bx 2A nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#panLSB */
panLSB(x: number, nn: number): MIDI;
/** Expression MSB: `[Bx 0B nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#expressionMSB */
expressionMSB(x: number, nn: number): MIDI;
/** Expression LSB: `[Bx 2B nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#expressionLSB */
expressionLSB(x: number, nn: number): MIDI;
/** Damper on/off: `[Bx 40 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#damper */
damper(x: number, bb: boolean): MIDI;
/** Portamento on/off: `[Bx 41 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamento */
portamento(x: number, bb: boolean): MIDI;
/** Sostenuto on/off: `[Bx 42 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sostenuto */
sostenuto(x: number, bb: boolean): MIDI;
/** Soft on/off: `[Bx 43 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#soft */
soft(x: number, bb: boolean): MIDI;
/** All sound off: `[Bx 78 00]`; `x`: channel
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#allSoundOff */
allSoundOff(x: number): MIDI;
/** All notes off: `[Bx 7B 00]`; `x`: channel
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#allNotesOff */
allNotesOff(x: number): MIDI;
// Channel-independent
/** Song position: `[F2 lsb msb]`; `msb`/`lsb`: most/least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#songPosition */
songPosition(nn: number): MIDI;
/** Song select: `[F3 nn]`; `nn`: song number
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#songSelect */
songSelect(nn: number): MIDI;
/** Tune: `[F6]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#tune */
tune(): MIDI;
/** Clock: `[F8]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#clock */
clock(): MIDI;
/** Start: `[FA]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#start */
start(): MIDI;
/** Continue: `[FB]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#continue */
continue(): MIDI;
/** Stop: `[FC]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#stop */
stop(): MIDI;
/** Active sense signal: `[FE]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#active */
active(): MIDI;
/** Reset: `[FF]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#reset */
reset(): MIDI;
/** ID Request SysEx: `[F0 7E 7F 06 01 F7]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sxIdRequest */
sxIdRequest(): MIDI;
/** MIDI time code (SMPTE quarter frame): `[F1 xx]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#mtc */
mtc(t: SMPTE): MIDI;
/** SMPTE Full Frame SysEx: `[F0 7F 7F 01 01 xx xx xx xx F7]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sxFullFrame */
sxFullFrame(t: SMPTE): MIDI;
// SMF
/** Standard MIDI File meta event: [FFxx len data]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smf */
smf(...args: any): MIDI;
/** SMF Sequence Number: [FF00 02 ssss]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSeqNumber */
smfSeqNumber(ssss: number): MIDI;
/** SMF Text: [FF01 len text]; used in Karaoke files
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfText */
smfText(str: string): MIDI;
/** SMF Copyright: [FF02 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfCopyright */
smfCopyright(str: string): MIDI;
/** SMF Sequence Name: [FF03 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSeqName */
smfSeqName(str: string): MIDI;
/** SMF Instrument Name: [FF04 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfInstrName */
smfInstrName(str: string): MIDI;
/** SMF Lyric: [FF05 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfLyric */
smfLyric(str: string): MIDI;
/** SMF Marker: [FF06 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfMarker */
smfMarker(str: string): MIDI;
/** SMF Cue Point: [FF07 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfCuePoint */
smfCuePoint(str: string): MIDI;
/** SMF Program Name: [FF08 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfProgName */
smfProgName(str: string): MIDI;
/** SMF Device Name: [FF09 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfDevName */
smfDevName(str: string): MIDI;
/** SMF Channel Prefix: [FF20 01 cc]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfChannelPrefix */
smfChannelPrefix(cc: number): MIDI;
/** SMF MIDI Port [FF21 01 pp]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfMidiPort */
smfMidiPort(pp: number): MIDI;
/** SMF End of Track: [FF2F 00]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfEndOfTrack */
smfEndOfTrack(): MIDI;
/** SMF Tempo: [FF51 03 tttttt]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfTempo */
smfTempo(tttttt: number): MIDI;
/** SMF Tempo, BMP: [FF51 03 tttttt]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfBPM */
smfBPM(bpm: number): MIDI;
/** SMF SMPTE offset: [FF54 05 hh mm ss fr ff]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSMPTE */
smfSMPTE(smpte: SMPTE | number[]): MIDI;
/** SMF Time Signature: [FF58 04 nn dd cc bb]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfTimeSignature */
smfTimeSignature(nn: number, dd: number, cc?: number, bb?: number): MIDI;
/** SMF Key Signature: [FF59 02 sf mi]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfKeySignature */
smfKeySignature(key: string): MIDI;
/** SMF Sequencer-specific Data: [FF7F len data]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSequencer */
smfSequencer(data: string): MIDI;
// Other
/** Note MIDI value by name
*
* https://jazz-soft.net/doc/JZZ/midigm.html#noteValue */
noteValue(note: number | string): number;
/** Program MIDI value by name
*
* https://jazz-soft.net/doc/JZZ/midigm.html#programValue */
programValue(prog: number | string): number;
/** Note frequency in HZ; `a5`: frequency of the `A5`, default: `440`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#freq */
freq(note: number | string, a5?: number): number;
}
}
interface MIDI extends Array<number> {
/** Convert MIDI to human-readable string
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#tostring */
toString(): string;
/** The message is Note On
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isNoteOn */
isNoteOn(): boolean;
/** The message is Note Off
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isNoteOff */
isNoteOff(): boolean;
/** The message is a SysEx
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isSysEx */
isSysEx(): boolean;
/** The message is a full SysEx
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isFullSysEx */
isFullSysEx(): boolean;
/** The message is a Standard MIDI File meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isSMF */
isSMF(): boolean;
/** The message is a Tempo meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isTempo */
isTempo(): boolean;
/** The message is a Time Signature meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isTimeSignature */
isTimeSignature(): boolean;
/** The message is a Key Signature meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isKeySignature */
isKeySignature(): boolean;
/** The message is an End of Track meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#isEOT */
isEOT(): boolean;
/** Return the channel number where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getChannel */
getChannel(): number;
/** Set the channel number where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setChannel */
setChannel(cc: number): MIDI;
/** Return the note value where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getNote */
getNote(): number;
/** Set the note where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setNote */
setNote(note: number | string): MIDI;
/** Return the velocity where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getVelocity */
getVelocity(): number;
/** Set the velocity where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setVelocity */
setVelocity(vv: number): MIDI;
/** Return the SysEx channel number where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getSysExChannel */
getSysExChannel(): number;
/** Set the SysEx channel number where applicable
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setSysExChannel */
setSysExChannel(cc: number): MIDI;
/** Get data from SMF meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getData */
getData(): string;
/** Set data on SMF meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setData */
setData(data: string): MIDI;
/** Get UTF8 text from SMF meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getText */
getText(): string;
/** Set UTF8 text on SMF meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#setText */
setText(str: string): MIDI;
/** Get tempo in ms per quarter note from SMF Tempo meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getTempo */
getTempo(): number;
/** Get tempo as BPM from SMF Tempo meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getBPM */
getBPM(): number;
/** Get time signature from SMF Time Signature meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getTimeSignature */
getTimeSignature(): number[];
/** Get key signature from SMF Key Signature meta event
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#getKeySignature */
getKeySignature(): any[];
}
namespace Stub {
interface Async extends Stub, PromiseLike<Stub> {}
}
interface Stub {
/** Print if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(text: string): Stub.Async;
/** Execute if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(func: (self?: Stub) => void): Stub.Async;
/** Print if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(text: string): Stub.Async;
/** Execute if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(func: (self?: Stub) => void): Stub.Async;
/** Wait `ms` milliseconds
*
* https://jazz-soft.net/doc/JZZ/common.html#wait */
wait(ms: number): Stub.Async;
}
namespace Engine {
interface Async extends Engine, PromiseLike<Engine> {}
}
interface Engine {
// Stub
/** Print if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(text: string): Engine.Async;
/** Execute if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(func: (self?: Stub) => void): Engine.Async;
/** Print if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(text: string): Engine.Async;
/** Execute if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(func: (self?: Stub) => void): Engine.Async;
/** Wait `ms` milliseconds
*
* https://jazz-soft.net/doc/JZZ/common.html#wait */
wait(ms: number): Engine.Async;
// Engine
/** Return an `info` object
*
* https://jazz-soft.net/doc/JZZ/jzz.html#info */
info(): any;
/** Refresh the list of available ports
*
* https://jazz-soft.net/doc/JZZ/jzz.html#refresh */
refresh(): Engine.Async;
/** Open MIDI-In port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#open */
openMidiIn(arg?: any): Port.Async;
/** Open MIDI-Out port
*
* https://jazz-soft.net/doc/JZZ/midiout.html#open */
openMidiOut(arg?: any): Port.Async;
/** Watch MIDI connection changes
*
* https://jazz-soft.net/doc/JZZ/jzz.html#onChange */
onChange(arg?: any): Watcher.Async;
/** Close MIDI engine
*
* https://jazz-soft.net/doc/JZZ/jzz.html#close */
close(): Stub.Async;
}
namespace Port {
interface Async extends Port, PromiseLike<Port> {}
}
interface Port {
// Stub
/** Print if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(text: string): Port.Async;
/** Execute if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(func: (self?: Stub) => void): Port.Async;
/** Print if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(text: string): Port.Async;
/** Execute if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(func: (self?: Stub) => void): Port.Async;
/** Wait `ms` milliseconds
*
* https://jazz-soft.net/doc/JZZ/common.html#wait */
wait(ms: number): Port.Async;
// Port
/** Return an `info` object
*
* https://jazz-soft.net/doc/JZZ/midiin.html#info */
info(): any;
/** Return the port name
*
* https://jazz-soft.net/doc/JZZ/midiin.html#name */
name(): string;
/** Connect MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#connect */
connect(arg: any): Port.Async;
/** Disonnect MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#disconnect */
disconnect(arg?: any): Port.Async;
/** Send MIDI message
*
* https://jazz-soft.net/doc/JZZ/midiout.html#send */
send(...args: any[]): Port.Async;
/** Emit MIDI message
*
* https://jazz-soft.net/doc/JZZ/midithru.html#emit */
emit(...args: any[]): Port.Async;
/** Emit MIDI message
*
* https://jazz-soft.net/doc/JZZ/midithru.html#emit */
_emit(...args: any[]): void;
/** Close MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#close */
close(): Stub.Async;
/** MIDI channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#ch */
ch(x: number): Channel.Async;
/** MIDI channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#ch */
ch(): Port.Async;
/** MPE channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#mpe */
mpe(m: number, n: number): MPE.Async;
/** MPE channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#mpe */
mpe(): Port.Async;
/** Play note
*
* https://jazz-soft.net/doc/JZZ/midiout.html#note */
note(x: number, nn: number | string, vv?: number, tt?: number): Port.Async;
// Channel-dependent
/** Note On: `[9x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOn */
noteOn(x: number, nn: number | string, vv?: number): Port.Async;
/** Note Off: `[8x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOff */
noteOff(x: number, nn: number | string, vv?: number): Port.Async;
/** Polyphonic aftetouch: `[Ax nn vv]`; `x`: channel, `nn`: note, `vv`: value
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#aftertouch */
aftertouch(x: number, nn: number | string, vv: number): Port.Async;
/** MIDI control: `[Bx nn vv]`; `x`: channel, `nn`: function, `vv`: value
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#control */
control(x: number, nn: number, vv: number): Port.Async;
/** Program change: `[Cx nn]`; `x`: channel, `nn`: program
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#program */
program(x: number, nn: number | string): Port.Async;
/** Pressure: `[Dx nn]`; `x`: channel, `nn`: pressure
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#pressure */
pressure(x: number, nn: number): Port.Async;
/** Pitch bend: `[Ex lsb msb]`; `x`: channel, `msb`/`lsb`: most/least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#pitchBend */
pitchBend(x: number, nn: number): Port.Async;
/** Bank select MSB: `[Bx 00 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#bankMSB */
bankMSB(x: number, nn: number): Port.Async;
/** Bank select LSB: `[Bx 20 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#bankLSB */
bankLSB(x: number, nn: number): Port.Async;
/** Modulation MSB: `[Bx 01 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#modMSB */
modMSB(x: number, nn: number): Port.Async;
/** Modulation LSB: `[Bx 21 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#modLSB */
modLSB(x: number, nn: number): Port.Async;
/** Breath controller MSB: `[Bx 02 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#breathMSB */
breathMSB(x: number, nn: number): Port.Async;
/** Breath controller LSB: `[Bx 22 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#breathLSB */
breathLSB(x: number, nn: number): Port.Async;
/** Foot controller MSB: `[Bx 04 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#footMSB */
footMSB(x: number, nn: number): Port.Async;
/** Foot controller LSB: `[Bx 24 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#footLSB */
footLSB(x: number, nn: number): Port.Async;
/** Portamento MSB: `[Bx 05 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamentoMSB */
portamentoMSB(x: number, nn: number): Port.Async;
/** Portamento LSB: `[Bx 25 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamentoLSB */
portamentoLSB(x: number, nn: number): Port.Async;
/** Volume MSB: `[Bx 07 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#volumeMSB */
volumeMSB(x: number, nn: number): Port.Async;
/** Volume LSB: `[Bx 27 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#volumeLSB */
volumeLSB(x: number, nn: number): Port.Async;
/** Balance MSB: `[Bx 08 nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#balanceMSB */
balanceMSB(x: number, nn: number): Port.Async;
/** Balance LSB: `[Bx 28 nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#balanceLSB */
balanceLSB(x: number, nn: number): Port.Async;
/** Pan MSB: `[Bx 0A nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#panMSB */
panMSB(x: number, nn: number): Port.Async;
/** Pan LSB: `[Bx 2A nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#panLSB */
panLSB(x: number, nn: number): Port.Async;
/** Expression MSB: `[Bx 0B nn]`; `x`: channel, `nn`: most significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#expressionMSB */
expressionMSB(x: number, nn: number): Port.Async;
/** Expression LSB: `[Bx 2B nn]`; `x`: channel, `nn`: least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#expressionLSB */
expressionLSB(x: number, nn: number): Port.Async;
/** Damper on/off: `[Bx 40 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#damper */
damper(x: number, bb: boolean): Port.Async;
/** Portamento on/off: `[Bx 41 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#portamento */
portamento(x: number, bb: boolean): Port.Async;
/** Sostenuto on/off: `[Bx 42 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sostenuto */
sostenuto(x: number, bb: boolean): Port.Async;
/** Soft on/off: `[Bx 43 nn]`; `x`: channel, `nn`: `bb ? 7f : 00`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#soft */
soft(x: number, bb: boolean): Port.Async;
/** All sound off: `[Bx 78 00]`; `x`: channel
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#allSoundOff */
allSoundOff(x: number): Port.Async;
/** All notes off: `[Bx 7B 00]`; `x`: channel
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#allNotesOff */
allNotesOff(x: number): Port.Async;
// Channel-independent
/** Song position: `[F2 lsb msb]`; `msb`/`lsb`: most/least significant 7 bits
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#songPosition */
songPosition(nn: number): Port.Async;
/** Song select: `[F3 nn]`; `nn`: song number
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#songSelect */
songSelect(nn: number): Port.Async;
/** Tune: `[F6]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#tune */
tune(): Port.Async;
/** Clock: `[F8]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#clock */
clock(): Port.Async;
/** Start: `[FA]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#start */
start(): Port.Async;
/** Continue: `[FB]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#continue */
continue(): Port.Async;
/** Stop: `[FC]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#stop */
stop(): Port.Async;
/** Active sense signal: `[FE]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#active */
active(): Port.Async;
/** Reset: `[FF]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#reset */
reset(): Port.Async;
/** ID Request SysEx: `[F0 7E 7F 06 01 F7]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sxIdRequest */
sxIdRequest(): Port.Async;
/** MIDI time code (SMPTE quarter frame): `[F1 xx]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#mtc */
mtc(t: SMPTE): Port.Async;
/** SMPTE Full Frame SysEx: `[F0 7F 7F 01 01 xx xx xx xx F7]`
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#sxFullFrame */
sxFullFrame(t: SMPTE): Port.Async;
// SMF
/** Standard MIDI File meta event: [FFxx len data]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smf */
smf(...args: any): Port.Async;
/** SMF Sequence Number: [FF00 02 ssss]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSeqNumber */
smfSeqNumber(ssss: number): Port.Async;
/** SMF Text: [FF01 len text]; used in Karaoke files
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfText */
smfText(str: string): Port.Async;
/** SMF Copyright: [FF02 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfCopyright */
smfCopyright(str: string): Port.Async;
/** SMF Sequence Name: [FF03 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSeqName */
smfSeqName(str: string): Port.Async;
/** SMF Instrument Name: [FF04 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfInstrName */
smfInstrName(str: string): Port.Async;
/** SMF Lyric: [FF05 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfLyric */
smfLyric(str: string): Port.Async;
/** SMF Marker: [FF06 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfMarker */
smfMarker(str: string): Port.Async;
/** SMF Cue Point: [FF07 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfCuePoint */
smfCuePoint(str: string): Port.Async;
/** SMF Program Name: [FF08 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfProgName */
smfProgName(str: string): Port.Async;
/** SMF Device Name: [FF09 len text]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfDevName */
smfDevName(str: string): Port.Async;
/** SMF Channel Prefix: [FF20 01 cc]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfChannelPrefix */
smfChannelPrefix(cc: number): Port.Async;
/** SMF MIDI Port [FF21 01 pp]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfMidiPort */
smfMidiPort(pp: number): Port.Async;
/** SMF End of Track: [FF2F 00]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfEndOfTrack */
smfEndOfTrack(): Port.Async;
/** SMF Tempo: [FF51 03 tttttt]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfTempo */
smfTempo(tttttt: number): Port.Async;
/** SMF Tempo, BMP: [FF51 03 tttttt]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfBPM */
smfBPM(bpm: number): Port.Async;
/** SMF SMPTE offset: [FF54 05 hh mm ss fr ff]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSMPTE */
smfSMPTE(smpte: SMPTE | number[]): Port.Async;
/** SMF Time Signature: [FF58 04 nn dd cc bb]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfTimeSignature */
smfTimeSignature(nn: number, dd: number, cc?: number, bb?: number): Port.Async;
/** SMF Key Signature: [FF59 02 sf mi]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfKeySignature */
smfKeySignature(key: string): Port.Async;
/** SMF Sequencer-specific Data: [FF7F len data]
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#smfSequencer */
smfSequencer(data: string): Port.Async;
}
namespace Channel {
interface Async extends Channel, PromiseLike<Channel> {}
}
interface Channel {
// Stub
/** Print if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(text: string): Channel.Async;
/** Execute if OK
*
* https://jazz-soft.net/doc/JZZ/common.html#and */
and(func: (self?: Stub) => void): Channel.Async;
/** Print if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(text: string): Channel.Async;
/** Execute if not OK
*
* https://jazz-soft.net/doc/JZZ/common.html#or */
or(func: (self?: Stub) => void): Channel.Async;
/** Wait `ms` milliseconds
*
* https://jazz-soft.net/doc/JZZ/common.html#wait */
wait(ms: number): Channel.Async;
// Port
/** Return an `info` object
*
* https://jazz-soft.net/doc/JZZ/midiin.html#info */
info(): any;
/** Return the port name
*
* https://jazz-soft.net/doc/JZZ/midiin.html#name */
name(): string;
/** Connect MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#connect */
connect(arg: any): Channel.Async;
/** Disonnect MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#disconnect */
disconnect(arg?: any): Channel.Async;
/** Send MIDI message
*
* https://jazz-soft.net/doc/JZZ/midiout.html#send */
send(...args: any[]): Channel.Async;
/** Emit MIDI message
*
* https://jazz-soft.net/doc/JZZ/midithru.html#emit */
emit(...args: any[]): Channel.Async;
/** Emit MIDI message
*
* https://jazz-soft.net/doc/JZZ/midithru.html#emit */
_emit(...args: any[]): void;
/** Close MIDI port
*
* https://jazz-soft.net/doc/JZZ/midiin.html#close */
close(): Stub.Async;
/** MIDI channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#ch */
ch(x: number): Channel.Async;
/** MIDI channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#ch */
ch(): Port.Async;
/** MPE channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#mpe */
mpe(m: number, n: number): MPE.Async;
/** MPE channel
*
* https://jazz-soft.net/doc/JZZ/midiout.html#mpe */
mpe(): Port.Async;
/** Play note
*
* https://jazz-soft.net/doc/JZZ/midiout.html#note */
note(nn: number | string, vv?: number, tt?: number): Channel.Async;
// Channel-dependent
/** Note On: `[9x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOn */
noteOn(nn: number | string, vv?: number): Channel.Async;
/** Note Off: `[8x nn vv]`; `x`: channel, `nn`: note, `vv`: velocity
*
* https://jazz-soft.net/doc/JZZ/jzzmidi.html#noteOff */