Update MIDI FS SysEx parsing logic and add unit tests for page incrementing
This commit is contained in:
@@ -136,9 +136,11 @@ export function buildSysExGetFileDataRequest(page: number) {
|
||||
}
|
||||
|
||||
export function parseSysExGetFileDataResponse(bytes: Uint8Array) {
|
||||
const page = (bytes[0] << 8) | bytes[1];
|
||||
|
||||
return {
|
||||
page: (bytes[0] << 8) | bytes[1],
|
||||
nextPage: ((bytes[0] << 8) | (bytes[1] + 1)) & 0xffff,
|
||||
page,
|
||||
nextPage: (page + 1) & 0xffff,
|
||||
data: bytes.subarray(2),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user