There's no dependencies so just download a copy of PreSonusAPI.js
const { Client, MessagePrefix } = require('./PreSonusAPI')
-
new Client(host: int, port: int)
Creates a Client object that will later connect to the console athost
:port
-
client.connect()
Connect to the console -
client.listen()
Start the metering server -
client.stop()
Stop the metering server -
client.setUDPServerPort(port: int)
Set the listen port of the metering server.
Can only be run while the metering server is not running -
client.on(evtName: str, fn: function)
Listen forevtName
events that will callfn
-
client.sendList(path: str)
Requestpath
from the console
Events are splitted into Protocol Events (event codes that are part of the protocol), and custom events defined by this API.
Hello
JSON
Setting
Settings2
FileResource
FileResource2
CompressedUnknown
connected
- Emitted when the client has successfully connected to the consolelistening
- Emitted when the client has successfully started the meter servermeter
|meterData
- Emitted when metering data is received
-
client.emit(evttName: str, ...data)
Emits an event forevtName
withdata
-
client._sendPacket(messageCode: bytes[2], data, <customA>, <customB>)
Sends a packet to the server, messageCode is a two byte long string.
customA
is an optional single byte character
customB
is an optional single byte character -
client.conn
=> TCP socket connection
Metering data is stored as a dictionary
{
input: [..., ..., ... /* 32 */], // Input signal
chain1input: input
chain1output: [..., ..., ... /* 32 */], // First FX chain
chain2input: chain1output,
chain2output: [..., ..., ... /* 32 */], // Second FX chain
chain3input: chain2output,
chain3output: [..., ..., ... /* 32 */], // Third FX chain
chain4input: chain3output,
chain4output: [..., ..., ... /* 32 */], // Fourth FX chain
level: chain4output
}