foxxyz / loupedeck

Node.js API for Loupedeck Controllers
MIT License
87 stars 10 forks source link

Possible solution for Loupedeck CT V2 #33

Open elementalTIMING opened 6 months ago

elementalTIMING commented 6 months ago

Hi,

after playing a bit with your code I found a possible solution for the CT V2 (https://github.com/foxxyz/loupedeck/issues/27). Because I've no published repo for this I put the small changes here in the text.

In device.js change productID to:

class LoupedeckCT extends LoupedeckLive {
    static productId = 0x0007;

The CT is now discovered BUT the grid is not drawn anymore. Originally I did a mistake and and changed the productID in the LoupedeckLive but not in the LoupedeckCT. But after fixing my mistake the grid buttons are not shown or updated anymore.

You also need to modify the id in the displays. Here you can use the same values from the LoupedeckLive, wich seems to work pretty well.

class LoupedeckCT extends LoupedeckLive {
    static productId = 0x0007;
    displays = {
        // values from LoupedeckLive
        center: { id: Buffer.from('\x00M'), width: 360, height: 270, offset: [60, 0] },
        left: { id: Buffer.from('\x00M'), width: 60, height: 270 },
        right: { id: Buffer.from('\x00M'), width: 60, height: 270, offset: [420, 0] },

        // original LoupedeckCT values
        // center: { id: Buffer.from('\x00A'), width: 360, height: 270 }, // "A"
        // left: { id: Buffer.from('\x00L'), width: 60, height: 270 }, // "L"
        // right: { id: Buffer.from('\x00R'), width: 60, height: 270 }, // "R"
        knob: { id: Buffer.from('\x00W'), width: 240, height: 240, endianness: 'be' }, // "W"
    };

You can keep the rest of the code as it is. That's it and all CT function work now. I hope that this will help somebody here.

foxxyz commented 6 months ago

This is great, thank you! Looks a lot like the firmware change that has been affecting some of the other devices.

Are you able to submit a PR?

elementalTIMING commented 6 months ago

This is great, thank you! Looks a lot like the firmware change that has been affecting some of the other devices.

Are you able to submit a PR?

Unfortunately not. I've never published anything to Git. It's something I need to deal with next summer ;-)