MIDI Extension for Hammerspoon.
This extension supports listening, transmitting and synthesizing MIDI commands.
This extension was thrown together by Chris Hocking for CommandPost.
This extension uses MIKMIDI, an easy-to-use Objective-C MIDI library created by Andrew Madsen and developed by him and Chris Flesner of Mixed In Key.
MIKMIDI LICENSE: Copyright (c) 2013 Mixed In Key, LLC. Original author: Andrew R. Madsen (andrew@mixedinkey.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Signature | hs.midi.commandTypes[] |
---|---|
Type | Constant |
Description | A table containing the numeric value for the possible flags returned by the |
Source | extensions/midi/libmidi.m line 1513 |
Signature | hs.midi.deviceCallback(callbackFn) -> none |
---|---|
Type | Function |
Description | A callback that's triggered when a physical or virtual MIDI device is added or removed from the system. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 342 |
Signature | hs.midi.devices() -> table |
---|---|
Type | Function |
Description | Returns a table of currently connected physical MIDI devices. |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 300 |
Signature | hs.midi.virtualSources() -> table |
---|---|
Type | Function |
Description | Returns a table of currently available Virtual MIDI sources. This includes devices, such as Native Instruments controllers which present as virtual endpoints rather than physical devices. |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 321 |
Signature | hs.midi.new(deviceName) -> |
---|---|
Type | Constructor |
Description | Creates a new |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 391 |
Signature | hs.midi.newVirtualSource(virtualSource) -> |
---|---|
Type | Constructor |
Description | Creates a new |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 418 |
Signature | hs.midi:callback(callbackFn) |
---|---|
Type | Method |
Description | Sets or removes a callback function for the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 447 |
Signature | hs.midi:displayName() -> string |
---|---|
Type | Method |
Description | Returns the display name of a |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1423 |
Signature | hs.midi:identityRequest() -> none |
---|---|
Type | Method |
Description | Sends an Identity Request message to the |
Parameters |
|
Returns |
|
Notes |
midiDevice = hs.midi.new(hs.midi.devices()[3])
midiDevice:callback(function(object, deviceName, commandType, description, metadata)
print("object: " .. tostring(object))
print("deviceName: " .. deviceName)
print("commandType: " .. commandType)
print("description: " .. description)
print("metadata: " .. hs.inspect(metadata))
end)
midiDevice:identityRequest()```
|
Source | extensions/midi/libmidi.m line 1343 |
Signature | hs.midi:isOnline() -> boolean |
---|---|
Type | Method |
Description | Returns the online status of a |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1477 |
Signature | hs.midi:isVirtual() -> boolean |
---|---|
Type | Method |
Description | Returns |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1494 |
Signature | hs.midi:manufacturer() -> string |
---|---|
Type | Method |
Description | Returns the manufacturer name of a |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1459 |
Signature | hs.midi:model() -> string |
---|---|
Type | Method |
Description | Returns the model name of a |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1441 |
Signature | hs.midi:name() -> string |
---|---|
Type | Method |
Description | Returns the name of a |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1405 |
Signature | hs.midi:sendCommand(commandType, metadata) -> boolean |
---|---|
Type | Method |
Description | Sends a command to the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 1033 |
Signature | hs.midi:sendSysex(command) -> none |
---|---|
Type | Method |
Description | Sends a System Exclusive Command to the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/midi/libmidi.m line 1011 |
Signature | hs.midi:synthesize([value]) -> boolean |
---|---|
Type | Method |
Description | Set or display whether or not the MIDI device should synthesize audio on your computer. |
Parameters |
|
Returns |
|
Source | extensions/midi/libmidi.m line 1377 |