Constructor
new MidiOut(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
TODO |
- Source:
Methods
allNotesOff(channel)
Turn off all notes for the given channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
Number | MIDI channel |
- Source:
- See:
close() → {boolean}
Close the MIDI input port
- Source:
Returns:
true if the port was closed
- Type
- boolean
note(pitch, velocity, duration, channel)
Send a note on, followed by a note off after the given duration in milliseconds
NOTE: This is a convenience method. The timing is not always predictable. It's recommend you explicitly schedule noteOn() and noteOff() calls when using the Scheduler.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pitch |
|||
velocity |
70 | ||
duration |
|||
channel |
1 |
- Source:
noteOff(pitch, velocity, channel)
Send a note off message
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pitch |
|||
velocity |
70 | ||
channel |
1 |
- Source:
noteOn(pitch, velocity, channel)
Send a note on message
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pitch |
|||
velocity |
70 | ||
channel |
1 |
- Source:
open(selector) → {boolean}
Open a MIDI input port
Parameters:
Name | Type | Default | Description |
---|---|---|---|
selector |
0 | TODO |
- Source:
Returns:
true if the port was opened
- Type
- boolean
panic() → {Promise}
Turn off all notes that could possibly be playing. Fixes "stuck" notes.
Called automatically when Node.js exits.
Note: Due to MIDI rate-limiting, this operation happens asynchronously over a few milliseconds.
- Source:
- See:
Returns:
- Type
- Promise
play(songOrJSON) → {Scheduler}
Play a Song or MIDI JSON
Parameters:
Name | Type | Description |
---|---|---|
songOrJSON |
Song | object | a Song or MIDI JSON |
- Source:
Returns:
A Scheduler that has already been started. It's returned so you can stop it early if desired.
- Type
- Scheduler
ports()
List available MIDI input ports
- Source:
send(…bytes)
Send a raw byte list
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
bytes |
Iterable |
<repeatable> |
- Source: