Bulk editing capabilites in Kilowhat

Hello,

After editing the properties for 16 encoders, it would be really nice to be able to select multiple encoders and change a setting on all of the selected encoders. E.g.: select all and change the switch type. Or select 4 and change a color. etc.

Thanks!

1 Like

@qbrd, yep absolutely.
It’s on the to-do list.

Thanks for the patience.

I would say of all the feature requests, at least for me, this would be top of the list.

I discovered last night I’m going to have to go through all my encoders again just to change one value… And I’m loving the controller! But wouldn’t use the same adjectives to describe programming it… :wink:

Hi @qbrd!

We know, and we even hate it ourselves, so we get the feeling.

A tip that @mike got to make this faster:

Use a JSON editor to edit the properties you want to set for your encoders. Maybe set one encoder as you want it, and the find and replace.

You can the load the modified file to Kilowhat and send it to your device!

@francoytx haha, I actually did a bit of that yesterday. But the JSON file is so big I was having trouble groking it… (that’s why I was asking if the structure was documented anywhere :wink: )

Basically from what I can gather, each button has basically the same structure? And then depending on what values are set the firmware knows “this is a knob”, “this is a button”? And each switch can have multiple “sections”, e.g.: (From memory) the encoder and pads had a switch stanza, and the encoder and knobs had a… “knob” (it wasn’t called that) stanza.

So for the “velocity to color” option it was something like flipping the 0 to 1 in allow_velocity_to_color: 0,… (I know that’s not exactly the attribute, for the sake of discussion) but if I just did a global perl -pei 's/allow_velocity_to_color: 0/allow_velocity_to_color: 1/g QBRDS1.ytx` that would do it for every button… so wouldn’t that change the setting on the encoders as well?

Anyway, you guys rock and have been super responsive (I didn’t expect replies over the weekend!) so no big deal, we’ll work out the kinks! :smiley:

@scanner_darkly suggested using Prettify JSON, which I think lets you edit, I didn’t know that one but I’ve been using this site to view the JSON structure and find the fields that I need to edit, then I find and replace only for the components I want.

I use VSCode and the Prettify JSON plugin.

Works alright, but I only have so much vertical real estate! :smiley:

Oh it was you who used Prettify JSON and mentioned it in a previous post! ahaha sorry for that

Please be patient and we’ll come up with something to address this soon.

My buddy helped me come up with a bit of JavaScript to edit the JSON. It uses traverse which walks the tree recursively. We got lucky because only the encoders have a switch_config. It SEEMS like it did what I wanted… :slight_smile:

const fs = require('fs')
const traverse = require('traverse')

const inputFile = 'QBRDS1.ytx'
const outputFile = 'QBRDS1-out.ytx'

const qbrds1 = JSON.parse(fs.readFileSync(inputFile).toString())

traverse(qbrds1).forEach(function (value) {
  if (this.key === 'switch_config') {
    value.channel = 1
  }
})

fs.writeFileSync(outputFile, JSON.stringify(qbrds1, null, 2))
2 Likes