I can adjust the image size. The following fills the entire 100x100 square in the display
await sd.fillLcdRegion(0, 700, 0, await bi.render(100, 100), {format: ârgbâ, width: 100, height: 100} );
But, as you suspected it wont stretch asymmetrically. This one results in a 200 pixel square with the bottom cutoff
await sd.fillLcdRegion(0, 600, 0, await bi.render(200, 100), {format: ârgbâ, width: 200, height: 100} );
Iâm not sure I really care. I plan to try and make some 200x100 images that can display a name or an icon, a gain level and/or a bar graph. Then see if I can get the value form a binding to the display. I suppose just starting with a number in a blank field would be enough to verify the connection. Then try to make it pretty.
update - I have master volume in first cell of LCD responding to master volume from cantabile and master volume up-down buttons I created earlier. Next step - encoders.
There seems to already be something in the encoders. When I turn one, a display pops up on lcd saying midi not connected. WeirdâŚ
update 2:
I now have an encoder wired up to master output volume, displayed on the lcd above the encoder and 2-way connection to Cantabile. Not yet esthetically pleasing, but I feel pretty good about my progress.
A bit of a struggle with the encoder because the math wasnât mathing. Perhaps you can educate an ancient c++ guy, accustomed to data types being more explicit.
I declared a variable
let masterLeveldB = 0;
I assumed that would declare a number
Here is my test code for an encoder:
sd.on(ârotateâ, (key, value) => {
console.log(ârotateâ, key.index, value);
switch (key.index)
{
case 3:
masterLeveldB = Number(masterLeveldB) + value;
if (masterLeveldB > 7)masterLeveldB = 7;
if (masterLeveldB < -120)masterLeveldB = -120;
masterLevel = Math.pow(10.0, masterLeveldB / 20.0);
C.bindings4.invoke(âmasterLevelsâ, âoutputGainâ, masterLevel);
console.log(âvolume-rotateâ, masterLevel, masterLeveldB);
break;
My math was originally masterLeveldB += value; But that resulted in concatenation, not addition. If masterLeveldB was 100 and value was 1, new masterLeveldB was 1001 (very loud
) Number(value) made no difference.
Note that my code is properly indented. Leading whitespace disappeared when posting.
Update 3:
At this point I think I can do buttons, encoders, and lcd panel interfaces and I want to proceed with something useful. I took a quick look at what is needed for the pretty animated knob displays you see in typical StreamDeck apps. That made my brain hurt. I was able to send 200x100 svg files with text overlays, but, in reality, all the prettiness is a distraction. Basically, I would be happy with the same look as the controller bar with the controller bar slider replaced by the hardware encoder. A value and a caption in big bold letters.
In the picture the right hand knob is fully implemented. It has a binding available:
global.masterLevels.outputGain.
The others are just dummies for now.
It looks like the only way to get into those things directly is by rack index and plugin index. But I want these to change with the song selection, so hard-wired rack/plugin numbers wonât work. And those numbers will change with different setlists. Maybe there is a way to expose a binding that StreamDeck can see, but I donât know how,
My plan is to add a simple mixer rack to every song and connect the individual input levels to StreamDeck. The only way I know how I might do that is via midi through osk. But when I try to watch that, StreamDeck Crashes.
The working watcher looks like this:
let masterOutputLevelsWatcher = C.bindings.watch(âglobal.masterLevels.outputGainâ);
based on http://localhost:35007/api/bindings/availableBindingPoints i tried
C.onscreenKeyboard.open();
et oskWatcher = C.bindings.watch(âmidiOutputPort.Onscreen Keyboard Outâ);
but it is not happy:
file:///C:/MyShit/StreamDeck/Rays_cantabile-streamdeck-demo/node_modules/@toptensoftware/cantabile-js/CantabileAPI.js:489
handlerInfo.reject(new Error(${msg.status} - ${msg.statusDescription}));
^
Error: 500 - Internal Server Error - JSON parse error at line 5, character 17, context routingMode - syntax error, expected EOF found Literal
at Cantabile._onSocketMessage (file:///C:/MyShit/StreamDeck/Rays_cantabile-streamdeck-demo/node_modules/@toptensoftware/cantabile-js/CantabileAPI.js:489:24)
at WebSocket.onMessage (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (node:events:508:28)
at Receiver.receiverOnMessage (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\websocket.js:720:20)
at Receiver.emit (node:events:508:28)
at Receiver.dataMessage (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\receiver.js:414:14)
at Receiver.getData (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\receiver.js:346:17)
at Receiver.startLoop (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\receiver.js:133:22)
at Receiver._write (C:\MyShit\StreamDeck\Rays_cantabile-streamdeck-demo\node_modules\ws\lib\receiver.js:69:10)
at writeOrBuffer (node:internal/streams/writable:570:12)
Node.js v24.12.0
I havenât tried to trace those error messages in hope that you might have a quick answer.
I have been debugging with console.log(). The instructions you provide for debugging at http://localhost:23654/ donât seem to work. Do I need a different localhost or a different regedit?