Katana Head MkII: Can I read amp state with MIDI SysEx commands?

Started by nonsequitarian, April 28, 2023, 01:32:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nonsequitarian

Hi there,

I've got a nice little setup working where I use a Raspberry Pi as a bridge between some MIDI foot controllers and my Katana head. The Pi gets simple CC MIDI commands from the controllers and translates those into SysEx messages to control settings on the Katana. I've got it working to select any patch, toggle solo on/off, toggle the pedal effect on/off, cycle through green/red/yellow for each effect, and even to tap the delay tempo for both of the internal delays. I figured out all of the SysEx commands to use by snooping the MIDI commands that the FxFloorboard app sends.

What I haven't been able to do is figure out how to read the state of the amp, to know what things are set to when I change to a new patch, for instance. I want to be able to update the lights on my controllers, to know where each effect is in the green/red/yellow cycle, etc. I found the MkII MIDI address map, but it's too low level for me, I don't know how to make sense of it.

The FxFloorboard app UI updates when I use my controllers to change settings, so I know it's possible to get the Katana state somehow. Might anyone here be able to tell me what SysEx messages I can use to read the settings from my amp?

Thanks!

sixeight

Read this: https://www.2writers.com/eddie/TutSysEx.htm

It helped me on my way of really understanding Boss/Roland sysex messages.

nonsequitarian

Yes! This is super helpful, thank you!

I think that with this I can piece together how to get the state of the amp that I need. I'll dig in later today, but I have just a couple more questions, if you (or anyone else) happen to know:

  • The linked post containing the address map is from 2020. Are those still valid, or have firmware updates moved things around?
  • The FxFloorboard responds in real time to me changing the settings on my amp, which means it's somehow getting a signal when something changes. It should be easy for me to read all the settings I care about when the patch changes, but I'd get out of sync if I used the amp panel to change a setting. How does FxFloorboard get notified that a setting has changed?

Regardless, this definitely points me in the right direction. Thank you!

sixeight

The v2 update added some new parameters and values. But everything in the linked post is still valid.

gumtownadmin

The Katana sysex can operate in two modes.
Play mode, where a device requests a block of data and the Katana sends the appropriate replied data block.
Then there is Editor(verbose) mode, where any changes to the Katana controls will send out those changes in sysex, a patch/channel change will send out patch data, and any sysex command sent to the Katan is relayed back to the midi controller.
Always remember that you are absolutely unique. Just like everyone else.

gumtown

Here are a couple of handy commands

    "F0410000000033127F000001017FF7"        // enable verbose editor mode.
    "F0410000000033110001000000000002FEF7"  // request current patch number.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

nonsequitarian

Quote from: gumtownadmin on April 29, 2023, 02:28:22 PMThe Katana sysex can operate in two modes.
Play mode, where a device requests a block of data and the Katana sends the appropriate replied data block.
Then there is Editor(verbose) mode, where any changes to the Katana controls will send out those changes in sysex, a patch/channel change will send out patch data, and any sysex command sent to the Katana is relayed back to the midi controller.

Ah, got it. I'd discovered on my own that my Katana was sending all of the state over the bus, now I realize that's because I had FxFloorboard open, which must be putting it into verbose mode. Thanks!

I'm starting to get there, but I still don't quite have it dialed. I went back to the MIDI address map and started trying to use the 'Out' messages there. If I send the 'Request ID' message ("F0 7E 7F 06 01 F7") I *do* get the expected SysEx message ("F0 7E 00 06 02 41 33 03 00 00 08 00 00 00 F7") in response. But that's the only one that works. Every other "Out" example I've tried from the address map has not caused a reply to be sent.

As another test, I watched the commands that FxFloorboard sends out when it starts up. When FxFloorboard sends them, the Katana sends all sorts of data back. But when I send them, I get nothing. I can start my app, and then start FxFloorboard, or vice versa, and verify that we're both sending the same SysEx messages, but only FxFloorboard gets any response.

Finally, I tried the "request current patch number" command you offered, which would be helpful indeed, but I can't even send that one, it's telling me the data byte "FE" is out of range. I think the max size is 127, right? Am I supposed to break the FE down further?

gumtown

Are you calculating the correct checksum for each system exclusive message ? (the second to last byte in each message), if the correct checksum is not calculated, the Katana will ignore that received data.

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

nonsequitarian

The checksums do all seem to be right, yes. Here's a little snippet of code:

def init():
    ports = engine.out_ports()
    port = ports[0]
    cmds = ["F0 7E 7F 06 01 F7",
            "F0 41 00 00 00 00 33 11 10 02 00 00 00 00 00 10 5e F7",
            "F0 41 00 00 00 00 33 11 10 03 00 00 00 00 00 10 5d F7",
            "F0 41 00 00 00 00 33 11 10 04 00 00 00 00 00 10 5c F7",
            "F0 41 00 00 00 00 33 11 10 05 00 00 00 00 00 10 5b F7",
            "F0 41 00 00 00 00 33 11 10 06 00 00 00 00 00 10 5a F7",
            "F0 41 00 00 00 00 33 11 10 07 00 00 00 00 00 10 59 F7",
            "F0 41 00 00 00 00 33 11 10 08 00 00 00 00 00 10 58 F7",
            "F0 41 00 00 00 00 33 11 60 00 00 00 00 00 0f 48 49 F7",
            "F0 41 00 00 00 00 33 11 00 00 00 00 00 02 00 1d 61 F7",
            "F0 41 00 00 00 00 33 11 00 01 00 00 00 00 00 02 7D F7",
            #"F0 41 00 00 00 00 33 11 00 01 00 00 00 00 00 02 FE F7",
            ]
    for cmd in cmds:
        engine.output_event(
            event.SysExEvent(
                port, cmd)
            )

The very first command in the list triggers the response the address map says to expect: "F0 7E 00 06 02 41 33 03 00 00 08 00 00 00 F7". None of the other commands generate a response when I send them, though, even though FxFloorboard does seem to get responses when it sends exactly the same commands.

gumtown

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

nonsequitarian

Quote from: gumtown on April 30, 2023, 05:32:39 AMMaybe your hex code needs to be in upper case.

This was a good thought, but lowercase works just fine. I did get things working, though! I'm on Linux, and the MIDI connections from my script to the Katana were running through JACK. When I set it up so that the connections were using ALSA directly, I started getting the responses.

I was using a2jmidid to route from JACK to ALSA MIDI before, I switched to jamrouter for that and now it seems to be working. Hooray! \o/ Thanks so much to both of you for your help! It's awesome that you're so generous with your time and your knowledge.

Also, for anyone who might try to use this thread in the future (including future me...), the "request current patch number" command that gumroad shared up above has the wrong checksum, the right command is:

    "F04100000000331100010000000000027DF7"  // request current patch number.

Now to tackle the daunting task of making sense of all of the data that the Katana is sending me...


gumtown

You are correct, the code had the wrong checksum, have now updated the FxFloorBoard source with:
F0 41 00 00 00 00 33 11 00 01 00 00 00 00 00 02 7D F7

although the app does have a checksum corrector for all outgoing midi data, so was corrected before sent to the Katana.

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/