7.0.0 • Published 8 months ago
@midiative/capacitor-midi-device
Connect midi devices to your app
Install
npm install @midiative/capacitor-midi-device
npx cap sync
API
listMIDIDevices()
listMIDIDevices() => Promise<{ value: string[]; }>
Returns: Promise<{ value: string[]; }>
openDevice(...)
openDevice(options: DeviceOptions) => Promise<void>
Param | Type |
---|
options | DeviceOptions |
initConnectionListener()
initConnectionListener() => Promise<void>
addListener('MIDI_MSG_EVENT', ...)
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('MIDI_CON_EVENT', ...)
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>
Interfaces
DeviceOptions
Prop | Type |
---|
deviceNumber | number |
PluginListenerHandle
Prop | Type |
---|
remove | () => Promise<void> |
MidiMessage
Prop | Type |
---|
type | string |
note | number |
velocity | number |