Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: MIDIPort
Source: JSObjects/MIDIInput.cs
MDN Reference: MIDIInput on MDN
The MIDIInput interface of the Web MIDI API receives messages from a MIDI input port. https://developer.mozilla.org/en-US/docs/Web/API/MIDIInput
| Signature | Description |
|---|---|
MIDIInput(SpawnJSObjectReference _ref) |
Deserialization constructor |
| Event | Type | Description |
|---|---|---|
OnMIDIMessage |
ActionEvent<MIDIMessageEvent> |
Fired when the current port receives a MIDI message. |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<MIDIInput>(...)or constructornew MIDIInput(...)
inputs.forEach((input) => {
console.log(input.name); /* inherited property from MIDIPort */
input.onmidimessage = (message) => {
console.log(message.data);
};
});