-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Other controls #16
Comments
Hi @fis-cz, thanks for taking interest in the project. Absolutely; I planned to implement absolutely everything that I can - and ideally recreate the functionality of Universal Control. The controls you mentioned above are simple to add in, but I first need to solve #14 roadblock. Currently this project is on hold for me because I'm busy finishing up my university thesis, but hopefully soon™ I should be able to jump back on to this! |
Great news, I am trying to work with the code now but unfortunately I never obtain the first subscription packet. It seems to me that there is some problem with permissions as all are returning false in previous packets. Hopefully I'll be able to figure it out. I also try to take a look to CK, it seems to me there is ZB inside so I'll try to figure it out. |
There shouldn't be any permission restrictions if I remember correctly. You will likely need to use commit ce7f395 which has the ZB wait removed. Note that functions will break because they rely on the contents of ZB Call connect with |
Added a packet capture and some notes at #14 (comment) |
Ok, so got it complete. The ZB message is the standard compressed BSJson (https://neurojson.org/) The CK chunk message is just a container for other messages. CK followed by 6 bytes (some kind of header you've already described somehow, but not important for other parsing. CK xx xx xx xx xx xx ZB 00 00 00 00 aa aa aa aa bb bb bb bb cc cc cc cc XX XX XX XX xx ... CK header (maybe it is some chunk ID as all related chunks seems to have same, but can't be sure) Currently I am using these two files to decode (d.ts needed for bjd) (npm install bjd), https://www.npmjs.com/package/bjd. Of course, this needs to be improved so much, but it gives nice and full state of the mixer. bjd.d.ts declare module "bjd" {
export function decode(data: Buffer): any
} CK.ts import Client from "../Client"
import * as zlib from "zlib";
import * as bjd from "bjd";
let chunkBuffer: Buffer[] = [];
export default function handleCKPacket(this: Client, data: Buffer) {
data = data.slice(4);
const chunkOffset = data.readUInt32LE(0);
const totalSize = data.readUInt32LE(4);
const chunkSize = data.readUInt32LE(8);
const chunkData = data.slice(12);
chunkBuffer.push(chunkData);
if (chunkOffset + chunkSize === totalSize) {
const fullData = Buffer.concat(chunkBuffer);
const unzip = zlib.inflateSync(fullData);
const data = bjd.decode(unzip);
console.log(data);
}
} |
Thanks to @fis-cz 🎉 See #16 (comment) Closes #12 Closes #14
That's awesome work @fis-cz! I didn't try to combine the two CK payloads... silly me The https://www.npmjs.com/package/bjd package you used is an implementation of UBJSON. I've updated the decoder implementation to support int64 values - 6eed523#diff-4d26eb190012397140dcf516873130b788d14e55420fde3feb6eb0b9b8a5cdf6R92-R98, and it seems to be working well! So we don't need to add in the extra |
Thanks, Great it works, I checked and it seems to be working even on my mixer (24R). Regarding the UBJson, It took a bit to me to figure out, what it is. It was clear it is some JSON extension, but was hard to find on the internet :) Just consider using of that standard lib for one of further major releases. I know it would have a big impact to the code, but as it is a standard and its source is available I would not be afraid to use it. For now, the parser seems to work correctly, but I need to test it more extensively. |
I'm happy to use a standard library, I only wrote it myself back when I didn't know that it was a UBJSON payload :) According to the listed libraries on the specification website, there are two (though not officially checked) I tried the second one a week ago but it didn't integrate right out of the box |
Hi,
I love your project. I would like to ask, do you also plan to implement other controls (i.e. gain, phanotm, lpf, eq, compressor and so on?)?
I would like to help you as I want completely control the 24R mixer using the MIDI surface from the electron app. I'll try to help you with the protocol analysis, but I need to get in first.
The text was updated successfully, but these errors were encountered: