Connect midi devices to your app
npm install @midiative/capacitor-midi-device
npx cap sync
listMIDIDevices()
openDevice(...)
initConnectionListener()
addListener('MIDI_MSG_EVENT', ...)
addListener('MIDI_CON_EVENT', ...)
- Interfaces
listMIDIDevices() => Promise<{ value: string[]; }>
Returns: Promise<{ value: string[]; }>
openDevice(options: DeviceOptions) => Promise<void>
Param | Type |
---|---|
options |
DeviceOptions |
initConnectionListener() => Promise<void>
addListener(eventName: 'MIDI_MSG_EVENT', listenerFunc: (message: MidiMessage) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
eventName |
'MIDI_MSG_EVENT' |
listenerFunc |
(message: MidiMessage) => void |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'MIDI_CON_EVENT', listenerFunc: (devices: { value: string[]; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
eventName |
'MIDI_CON_EVENT' |
listenerFunc |
(devices: { value: string[]; }) => void |
Returns: Promise<PluginListenerHandle>
Prop | Type |
---|---|
deviceNumber |
number |
Prop | Type |
---|---|
remove |
() => Promise<void> |
Prop | Type |
---|---|
type |
string |
note |
number |
velocity |
number |