libadlmidi-js 1.0.0

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 (86) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +126 -0
  3. package/dist/core.d.ts +276 -0
  4. package/dist/fm_banks/ail/MonopolyDeluxe.wopl +0 -0
  5. package/dist/fm_banks/ail/master_of_magic.wopl +0 -0
  6. package/dist/fm_banks/manifest.json +60 -0
  7. package/dist/fm_banks/wopl/Apogee-IMF-90.wopl +0 -0
  8. package/dist/fm_banks/wopl/DMXOPL3-by-sneakernets-GS.wopl +0 -0
  9. package/dist/fm_banks/wopl/GM-By-J.A.Nguyen-and-Wohlstand.wopl +0 -0
  10. package/dist/fm_banks/wopl/Wohlstand's-modded-FatMan.wopl +0 -0
  11. package/dist/fm_banks/wopl/fatman-2op.wopl +0 -0
  12. package/dist/fm_banks/wopl/fatman-4op.wopl +0 -0
  13. package/dist/fm_banks/wopl/msadlib.wopl +0 -0
  14. package/dist/libadlmidi.d.ts +453 -0
  15. package/dist/libadlmidi.dosbox.browser.js +2 -0
  16. package/dist/libadlmidi.dosbox.browser.wasm +0 -0
  17. package/dist/libadlmidi.dosbox.core.js +2 -0
  18. package/dist/libadlmidi.dosbox.core.wasm +0 -0
  19. package/dist/libadlmidi.dosbox.js +0 -0
  20. package/dist/libadlmidi.dosbox.processor.js +3226 -0
  21. package/dist/libadlmidi.dosbox.slim.browser.js +2 -0
  22. package/dist/libadlmidi.dosbox.slim.browser.wasm +0 -0
  23. package/dist/libadlmidi.dosbox.slim.core.js +2 -0
  24. package/dist/libadlmidi.dosbox.slim.core.wasm +0 -0
  25. package/dist/libadlmidi.dosbox.slim.js +0 -0
  26. package/dist/libadlmidi.dosbox.slim.processor.js +3226 -0
  27. package/dist/libadlmidi.full.browser.js +2 -0
  28. package/dist/libadlmidi.full.browser.wasm +0 -0
  29. package/dist/libadlmidi.full.core.js +2 -0
  30. package/dist/libadlmidi.full.core.wasm +0 -0
  31. package/dist/libadlmidi.full.js +0 -0
  32. package/dist/libadlmidi.full.processor.js +3226 -0
  33. package/dist/libadlmidi.full.slim.browser.js +2 -0
  34. package/dist/libadlmidi.full.slim.browser.wasm +0 -0
  35. package/dist/libadlmidi.full.slim.core.js +2 -0
  36. package/dist/libadlmidi.full.slim.core.wasm +0 -0
  37. package/dist/libadlmidi.full.slim.js +0 -0
  38. package/dist/libadlmidi.full.slim.processor.js +3226 -0
  39. package/dist/libadlmidi.js +445 -0
  40. package/dist/libadlmidi.js.map +7 -0
  41. package/dist/libadlmidi.light.browser.js +2 -0
  42. package/dist/libadlmidi.light.browser.wasm +0 -0
  43. package/dist/libadlmidi.light.core.js +2 -0
  44. package/dist/libadlmidi.light.core.wasm +0 -0
  45. package/dist/libadlmidi.light.js +0 -0
  46. package/dist/libadlmidi.light.processor.js +3226 -0
  47. package/dist/libadlmidi.light.slim.browser.js +2 -0
  48. package/dist/libadlmidi.light.slim.browser.wasm +0 -0
  49. package/dist/libadlmidi.light.slim.core.js +2 -0
  50. package/dist/libadlmidi.light.slim.core.wasm +0 -0
  51. package/dist/libadlmidi.light.slim.js +0 -0
  52. package/dist/libadlmidi.light.slim.processor.js +3226 -0
  53. package/dist/libadlmidi.nuked.browser.js +2 -0
  54. package/dist/libadlmidi.nuked.browser.wasm +0 -0
  55. package/dist/libadlmidi.nuked.core.js +2 -0
  56. package/dist/libadlmidi.nuked.core.wasm +0 -0
  57. package/dist/libadlmidi.nuked.js +0 -0
  58. package/dist/libadlmidi.nuked.processor.js +3226 -0
  59. package/dist/libadlmidi.nuked.slim.browser.js +2 -0
  60. package/dist/libadlmidi.nuked.slim.browser.wasm +0 -0
  61. package/dist/libadlmidi.nuked.slim.core.js +2 -0
  62. package/dist/libadlmidi.nuked.slim.core.wasm +0 -0
  63. package/dist/libadlmidi.nuked.slim.js +0 -0
  64. package/dist/libadlmidi.nuked.slim.processor.js +3226 -0
  65. package/dist/profiles/dosbox.d.ts +49 -0
  66. package/dist/profiles/dosbox.slim.d.ts +49 -0
  67. package/dist/profiles/full.d.ts +49 -0
  68. package/dist/profiles/full.slim.d.ts +49 -0
  69. package/dist/profiles/light.d.ts +49 -0
  70. package/dist/profiles/light.slim.d.ts +49 -0
  71. package/dist/profiles/nuked.d.ts +49 -0
  72. package/dist/profiles/nuked.slim.d.ts +49 -0
  73. package/dist/utils/struct.d.ts +209 -0
  74. package/package.json +103 -0
  75. package/src/core.js +591 -0
  76. package/src/libadlmidi.js +524 -0
  77. package/src/processor.js +517 -0
  78. package/src/profiles/dosbox.js +82 -0
  79. package/src/profiles/dosbox.slim.js +82 -0
  80. package/src/profiles/full.js +82 -0
  81. package/src/profiles/full.slim.js +82 -0
  82. package/src/profiles/light.js +82 -0
  83. package/src/profiles/light.slim.js +82 -0
  84. package/src/profiles/nuked.js +82 -0
  85. package/src/profiles/nuked.slim.js +82 -0
  86. package/src/utils/struct.js +288 -0
package/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you do both of the
85
+ following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, provided that you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # libadlmidi-js
2
+
3
+ WebAssembly build of [libADLMIDI](https://github.com/Wohlstand/libADLMIDI) - a free Software MIDI synthesizer library with OPL3 (FM synthesis) emulation.
4
+
5
+ ## Features
6
+
7
+ - **AudioWorklet Integration**: Runs synthesis in a separate thread to prevent UI stuttering. Interoperates with all the usual browser audio APIs.
8
+ - **WOPL Bank Support**: Load custom FM banks or use the high-quality embedded banks.
9
+ - **Real-time API**: Fine-grained control over MIDI channels, notes, and controllers.
10
+ - **Instrument Editing**: Programmatic access to OPL3 operator parameters.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install libadlmidi-js
16
+ ```
17
+
18
+ ## Quick Start (Browser + AudioWorklet)
19
+
20
+ ```javascript
21
+ import { AdlMidi } from 'libadlmidi-js/nuked';
22
+
23
+ const synth = new AdlMidi();
24
+ await synth.init();
25
+
26
+ // Play a middle C on channel 0
27
+ synth.noteOn(0, 60, 100);
28
+
29
+ // Stop it after 1 second
30
+ setTimeout(() => {
31
+ synth.noteOff(0, 60);
32
+ }, 1000);
33
+ ```
34
+
35
+ ## Low-Level API (Node.js / Custom Backends)
36
+
37
+ For batch rendering, custom audio backends, or non-browser environments:
38
+
39
+ ```javascript
40
+ import { AdlMidiCore } from 'libadlmidi-js/nuked';
41
+
42
+ const synth = await AdlMidiCore.create();
43
+
44
+ synth.init(44100);
45
+ synth.setBank(72);
46
+
47
+ // Real-time synthesis
48
+ synth.noteOn(0, 60, 100);
49
+ const samples = synth.generate(4096); // Float32Array, stereo interleaved
50
+
51
+ // Or MIDI file playback
52
+ import { readFileSync } from 'fs';
53
+ synth.loadMidi(readFileSync('song.mid'));
54
+ while (!synth.atEnd) {
55
+ const audio = synth.play(4096);
56
+ // ... write to file or audio output
57
+ }
58
+
59
+ synth.close();
60
+ ```
61
+
62
+ ### Slim Builds (No Embedded Banks)
63
+
64
+ For smaller bundles, use slim variants and load banks at runtime:
65
+
66
+ ```javascript
67
+ import { AdlMidi } from 'libadlmidi-js/nuked/slim';
68
+
69
+ const synth = new AdlMidi();
70
+ await synth.init();
71
+ await synth.loadBankFile('./mybank.wopl'); // Load WOPL bank
72
+ ```
73
+
74
+ ### Struct Utilities
75
+
76
+ For direct OPL3 instrument manipulation:
77
+
78
+ ```javascript
79
+ import { AdlMidi } from 'libadlmidi-js/nuked';
80
+ import { encodeInstrument, decodeInstrument, defaultInstrument } from 'libadlmidi-js/structs';
81
+
82
+ const synth = new AdlMidi();
83
+ await synth.init();
84
+
85
+ // Create a custom instrument from the default template
86
+ const inst = defaultInstrument();
87
+ inst.operators[0].attack = 15;
88
+ inst.operators[0].decay = 8;
89
+ inst.feedback1 = 7;
90
+
91
+ // Encode and apply to channel 0
92
+ const bytes = encodeInstrument(inst); // 40-byte Uint8Array
93
+ synth.setCustomInstrument(0, bytes);
94
+
95
+ // Notes on channel 0 now use the custom instrument
96
+ synth.noteOn(0, 60, 100);
97
+
98
+ // You can also decode instrument data from a bank
99
+ const decoded = decodeInstrument(bytes);
100
+ ```
101
+
102
+ ## Profiles
103
+
104
+ | Profile | Emulator(s) | Usage |
105
+ |---------|-------------|-------|
106
+ | `nuked` | Nuked OPL3 v1.8 | Maximum accuracy, highest CPU usage. |
107
+ | `dosbox` | DosBox OPL3 | Great balance of speed and accuracy. |
108
+ | `light` | Nuked + DosBox | Flexible for varied performance needs. |
109
+ | `full` | All supported | Includes Opal, Java OPL3, ESFMu, etc. |
110
+
111
+ ## Documentation
112
+
113
+ See the `examples/` directory for advanced usage, including:
114
+ - `player.html`: MIDI file playback.
115
+ - `keyboard.html`: Real-time interaction.
116
+ - `patch-editor.html`: Live OPL3 patch editing.
117
+
118
+ ## Contributing
119
+
120
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and rules.
121
+
122
+ ## License
123
+
124
+ This project is licensed under the **LGPL-3.0**. See the [LICENSE](LICENSE) file for details.
125
+ Upstream libADLMIDI is licensed under a mix of GPL and LGPL; see the `libADLMIDI/LICENSE` for core engine licensing.
126
+
package/dist/core.d.ts ADDED
@@ -0,0 +1,276 @@
1
+ /**
2
+ * Low-level OPL3 synthesis interface.
3
+ *
4
+ * Unlike AdlMidi (which manages AudioWorklet), AdlMidiCore works directly
5
+ * with the WASM module and returns raw audio samples.
6
+ *
7
+ * @example
8
+ * ```javascript
9
+ * import { AdlMidiCore } from 'libadlmidi-js/core';
10
+ *
11
+ * // Load with specific WASM profile
12
+ * const synth = await AdlMidiCore.create({
13
+ * corePath: './node_modules/libadlmidi-js/dist/libadlmidi.nuked.core.js'
14
+ * });
15
+ *
16
+ * await synth.init(44100);
17
+ * synth.setBank(72);
18
+ * synth.noteOn(0, 60, 100);
19
+ *
20
+ * // Generate audio
21
+ * const samples = synth.generate(4096); // Float32Array, stereo interleaved
22
+ *
23
+ * synth.close();
24
+ * ```
25
+ */
26
+ export class AdlMidiCore {
27
+ /**
28
+ * Create a new AdlMidiCore instance.
29
+ *
30
+ * @param {Object} options
31
+ * @param {string} options.corePath - Path to the .core.js WASM loader module
32
+ * @param {ArrayBuffer} [options.wasmBinary] - Pre-loaded WASM binary (optional)
33
+ * @returns {Promise<AdlMidiCore>}
34
+ */
35
+ static create(options: {
36
+ corePath: string;
37
+ wasmBinary?: ArrayBuffer | undefined;
38
+ }): Promise<AdlMidiCore>;
39
+ /** @private @type {any} */
40
+ private _module;
41
+ /** @private @type {number|null} */
42
+ private _player;
43
+ /** @private @type {number} */
44
+ private _sampleRate;
45
+ /** @private @type {Float32Array|null} */
46
+ private _audioBuffer;
47
+ /** @private @type {number|null} */
48
+ private _audioBufferPtr;
49
+ /**
50
+ * Initialize the synthesizer.
51
+ *
52
+ * @param {number} [sampleRate=44100] - Audio sample rate
53
+ * @returns {boolean} True if successful
54
+ */
55
+ init(sampleRate?: number): boolean;
56
+ /**
57
+ * Close the synthesizer and free resources.
58
+ */
59
+ close(): void;
60
+ /**
61
+ * Reset the synthesizer state (stop all notes).
62
+ */
63
+ reset(): void;
64
+ /**
65
+ * Panic - immediately stop all notes.
66
+ */
67
+ panic(): void;
68
+ /**
69
+ * Set the FM bank by index.
70
+ *
71
+ * @param {number} bank - Bank index (0-72+ depending on build)
72
+ * @returns {boolean} True if successful
73
+ */
74
+ setBank(bank: number): boolean;
75
+ /**
76
+ * Load a custom WOPL bank from data.
77
+ *
78
+ * @param {ArrayBuffer|Uint8Array} data - WOPL bank data
79
+ * @returns {boolean} True if successful
80
+ */
81
+ loadBankData(data: ArrayBuffer | Uint8Array): boolean;
82
+ /**
83
+ * Get the number of available embedded banks.
84
+ *
85
+ * @returns {number} Number of banks
86
+ */
87
+ getBankCount(): number;
88
+ /**
89
+ * Set the number of emulated OPL3 chips.
90
+ *
91
+ * @param {number} count - Number of chips (1-100)
92
+ * @returns {boolean} True if successful
93
+ */
94
+ setNumChips(count: number): boolean;
95
+ /**
96
+ * Enable/disable soft stereo panning.
97
+ *
98
+ * @param {boolean} enabled
99
+ */
100
+ setSoftPan(enabled: boolean): void;
101
+ /**
102
+ * Enable/disable deep vibrato.
103
+ *
104
+ * @param {boolean} enabled
105
+ */
106
+ setDeepVibrato(enabled: boolean): void;
107
+ /**
108
+ * Enable/disable deep tremolo.
109
+ *
110
+ * @param {boolean} enabled
111
+ */
112
+ setDeepTremolo(enabled: boolean): void;
113
+ /**
114
+ * Switch OPL3 emulator (if multiple are compiled in).
115
+ *
116
+ * @param {number} emulator - Emulator ID (0=Nuked, 2=DosBox, etc.)
117
+ * @returns {boolean} True if successful
118
+ */
119
+ switchEmulator(emulator: number): boolean;
120
+ /**
121
+ * Get the current chip emulator name.
122
+ *
123
+ * @returns {string} Emulator name
124
+ */
125
+ getEmulatorName(): string;
126
+ /**
127
+ * Trigger a note on.
128
+ *
129
+ * @param {number} channel - MIDI channel (0-15)
130
+ * @param {number} note - MIDI note (0-127)
131
+ * @param {number} velocity - Velocity (0-127)
132
+ */
133
+ noteOn(channel: number, note: number, velocity: number): void;
134
+ /**
135
+ * Trigger a note off.
136
+ *
137
+ * @param {number} channel - MIDI channel (0-15)
138
+ * @param {number} note - MIDI note (0-127)
139
+ */
140
+ noteOff(channel: number, note: number): void;
141
+ /**
142
+ * Send a pitch bend message.
143
+ *
144
+ * @param {number} channel - MIDI channel (0-15)
145
+ * @param {number} value - Pitch bend value (0-16383, 8192 = center)
146
+ */
147
+ pitchBend(channel: number, value: number): void;
148
+ /**
149
+ * Send a controller change message.
150
+ *
151
+ * @param {number} channel - MIDI channel (0-15)
152
+ * @param {number} controller - Controller number (0-127)
153
+ * @param {number} value - Controller value (0-127)
154
+ */
155
+ controllerChange(channel: number, controller: number, value: number): void;
156
+ /**
157
+ * Send a program change message.
158
+ *
159
+ * @param {number} channel - MIDI channel (0-15)
160
+ * @param {number} program - Program number (0-127)
161
+ */
162
+ programChange(channel: number, program: number): void;
163
+ /**
164
+ * Generate audio samples (real-time synthesis).
165
+ *
166
+ * @param {number} frames - Number of stereo frames to generate
167
+ * @returns {Float32Array} Stereo interleaved audio samples (-1 to +1)
168
+ */
169
+ generate(frames: number): Float32Array;
170
+ /**
171
+ * Load a MIDI file from data.
172
+ *
173
+ * @param {ArrayBuffer|Uint8Array} data - MIDI file data
174
+ * @returns {boolean} True if successful
175
+ */
176
+ loadMidi(data: ArrayBuffer | Uint8Array): boolean;
177
+ /**
178
+ * Play MIDI file and generate audio.
179
+ *
180
+ * @param {number} frames - Number of stereo frames to generate
181
+ * @returns {Float32Array} Stereo interleaved audio samples (-1 to +1)
182
+ */
183
+ play(frames: number): Float32Array;
184
+ /**
185
+ * Get the current playback position in seconds.
186
+ *
187
+ * @returns {number} Position in seconds
188
+ */
189
+ get position(): number;
190
+ /**
191
+ * Get the total duration in seconds.
192
+ *
193
+ * @returns {number} Duration in seconds
194
+ */
195
+ get duration(): number;
196
+ /**
197
+ * Seek to a position.
198
+ *
199
+ * @param {number} seconds - Position in seconds
200
+ */
201
+ seek(seconds: number): void;
202
+ /**
203
+ * Rewind to the beginning.
204
+ */
205
+ rewind(): void;
206
+ /**
207
+ * Check if playback has reached the end.
208
+ *
209
+ * @returns {boolean} True if at end
210
+ */
211
+ get atEnd(): boolean;
212
+ /**
213
+ * Enable/disable looping.
214
+ *
215
+ * @param {boolean} enabled
216
+ */
217
+ setLooping(enabled: boolean): void;
218
+ /**
219
+ * Set playback tempo multiplier.
220
+ *
221
+ * @param {number} tempo - Tempo multiplier (1.0 = normal)
222
+ */
223
+ setTempo(tempo: number): void;
224
+ /**
225
+ * Get an instrument from a bank.
226
+ *
227
+ * @param {Object} bankId - Bank identifier
228
+ * @param {number} bankId.percussive - 0 for melodic, 1 for percussion
229
+ * @param {number} bankId.msb - Bank MSB
230
+ * @param {number} bankId.lsb - Bank LSB
231
+ * @param {number} program - Program number (0-127)
232
+ * @returns {import('./utils/struct.js').Instrument|null} Instrument or null if not found
233
+ */
234
+ getInstrument(bankId: {
235
+ percussive: number;
236
+ msb: number;
237
+ lsb: number;
238
+ }, program: number): import("./utils/struct.js").Instrument | null;
239
+ /**
240
+ * Set an instrument in a bank.
241
+ *
242
+ * @param {Object} bankId - Bank identifier
243
+ * @param {number} bankId.percussive - 0 for melodic, 1 for percussion
244
+ * @param {number} bankId.msb - Bank MSB
245
+ * @param {number} bankId.lsb - Bank LSB
246
+ * @param {number} program - Program number (0-127)
247
+ * @param {import('./utils/struct.js').Instrument} instrument - Instrument to set
248
+ * @returns {boolean} True if successful
249
+ */
250
+ setInstrument(bankId: {
251
+ percussive: number;
252
+ msb: number;
253
+ lsb: number;
254
+ }, program: number, instrument: import("./utils/struct.js").Instrument): boolean;
255
+ /**
256
+ * Get the raw Emscripten module for advanced usage.
257
+ *
258
+ * @returns {Object} The raw WASM module
259
+ */
260
+ get module(): Object;
261
+ /**
262
+ * Get the raw player pointer for advanced usage.
263
+ *
264
+ * @returns {number|null} Player pointer
265
+ */
266
+ get player(): number | null;
267
+ /**
268
+ * Get the sample rate.
269
+ *
270
+ * @returns {number} Sample rate in Hz
271
+ */
272
+ get sampleRate(): number;
273
+ /** @private */
274
+ private _ensurePlayer;
275
+ }
276
+ export default AdlMidiCore;
@@ -0,0 +1,60 @@
1
+ {
2
+ "generated": "2026-01-18T16:02:45.890Z",
3
+ "categories": {
4
+ "wopl": {
5
+ "description": "General WOPL banks",
6
+ "banks": [
7
+ {
8
+ "name": "Apogee-IMF-90",
9
+ "file": "Apogee-IMF-90.wopl",
10
+ "size": 16983
11
+ },
12
+ {
13
+ "name": "DMXOPL3-by-sneakernets-GS",
14
+ "file": "DMXOPL3-by-sneakernets-GS.wopl",
15
+ "size": 118767
16
+ },
17
+ {
18
+ "name": "GM-By-J.A.Nguyen-and-Wohlstand",
19
+ "file": "GM-By-J.A.Nguyen-and-Wohlstand.wopl",
20
+ "size": 16983
21
+ },
22
+ {
23
+ "name": "Wohlstand's-modded-FatMan",
24
+ "file": "Wohlstand's-modded-FatMan.wopl",
25
+ "size": 16983
26
+ },
27
+ {
28
+ "name": "fatman-2op",
29
+ "file": "fatman-2op.wopl",
30
+ "size": 16983
31
+ },
32
+ {
33
+ "name": "fatman-4op",
34
+ "file": "fatman-4op.wopl",
35
+ "size": 16983
36
+ },
37
+ {
38
+ "name": "msadlib",
39
+ "file": "msadlib.wopl",
40
+ "size": 16983
41
+ }
42
+ ]
43
+ },
44
+ "ail": {
45
+ "description": "AIL (Miles Sound System) banks",
46
+ "banks": [
47
+ {
48
+ "name": "MonopolyDeluxe",
49
+ "file": "MonopolyDeluxe.wopl",
50
+ "size": 16983
51
+ },
52
+ {
53
+ "name": "master_of_magic",
54
+ "file": "master_of_magic.wopl",
55
+ "size": 25465
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ }
Binary file