Katana MKII 50W - 'Katana Solutions USB Foot Controller' - In Progress

Started by StevenMartin, February 11, 2020, 04:17:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bauerbyter

the video is private, you have to set it to "unlisted", so we can see it

StevenMartin

Whoops! Try that. Although... That video is very rushed and messy. I'll make a new video and put text on to show what I'm doing.

I'm thinking of going through and pulling stuff out to make an updateLEDs() and an updateLCD() function. I think that might speed things along. In fact, the whole process has been a case of me shoe-horning one feature inside another... and it's getting quite convoluted. Might need a rethink from scratch.

sixeight

Ha, I started five years ago with bread boards and all. Pretty soon started to organize my code into several .ino files. One for the display, one for the LEDS, one for the switches, one for the actual functionality  and The main sketch ties it all together. That structure is still there in my code.

Then I rewrote everything when I developed the VController v2, where I put in place the derived class structure for the devices I support. This main structure is still there after five years of development.

Just keep going and who knows where this will end.

Though I guess most people will call it a day once everything works. I just kept going as I had new ideas and devices to work with. Got into PCB design, developed an editor for it. Still have loads of ideas. Art is never finished, it is only abandoned.

StevenMartin

I can only hope to end up there!

Maybe a slightly odd question. Do you know of a way to use a USB splitter or something so I can have the Katana plugged into the Mac and the Arduino at the same time? (I suspect not!)

The reason being, up until now I have been able to visually see on the amp if my foot controller sends are working because there are LEDs on the amp that helpfully come on and off.

But now, I've gotten past the very basics, and I'm dialling down into setting effect types such as Spring reverb, Plate reverb etc. The only way I can tell which type is active at the moment is to write a diff reverb type to each channel (1a, 2a, 1b, 1b) then unplug it all and plug into the mac and use Boss Tone Studio to see if my writes worked on each channel. Then unplug and get the Arduino back in, and set a new batch to channels. Rinse and repeat.

Not an issue for reverb as there are only 5 types, but I've just done it for the 20 Boost types and that was a lot of setting, unplugging, plugging in etc. Not looking forward to FX and Mod types.

Do you know of a better way to check? Ideally, I could have Mac BTS and my foot controller both plugged into the amp, so that when I press the foot controller buttons I can see them all in BTS.

StevenMartin

That could be interesting.

So I'd need a USB B to USB A adapter to plug that into the back of the Katana, then I could presumably plug the arduino and the Mac into the 1-4 ports. That would certainly prevent the cable swapping, but my guess is that the switches control power to the ports and not just the data. So I'd still need to 'restart' the arduino software each time.

I think that would allow BTS and arduino both to make changes on the amp though, but I'm not certain that the reverse signal would work? So when the amp spits back out the 'read' data, I can't see that hub duplicating the same data from the amp across to two ports to the Mac and the Arduino.

Have I understood that wrongly?

admin

Quote from: StevenMartin on May 21, 2020, 02:45:50 AM
That could be interesting.

So I'd need a USB B to USB A adapter to plug that into the back of the Katana, then I could presumably plug the arduino and the Mac into the 1-4 ports. That would certainly prevent the cable swapping, but my guess is that the switches control power to the ports and not just the data. So I'd still need to 'restart' the arduino software each time.

I think that would allow BTS and arduino both to make changes on the amp though, but I'm not certain that the reverse signal would work? So when the amp spits back out the 'read' data, I can't see that hub duplicating the same data from the amp across to two ports to the Mac and the Arduino.

Have I understood that wrongly?
'

'Then that USB hub will not work -
Need a USB A/B/ switch  - to  between 2 separate USB Hosts

Only One USB Host connection is allowed at any given  time


https://www.ebay.com/itm/USB-2-0-Sharing-Share-Switch-Box-Hub-2-Ports-PC-Computer-Scanner-Printer-Manual/223698536294

gumtown

You can't run two USB hosts into the same device (Katana).

Maybe both into the Mac and re-route the controller midi into the Katana, setup an aggregate midi connection in the MAc system midi menu.

Have you tried the Katana FxFloorBoard editor for MKii ?,
set into 'deBug mode" it will spew out sysx data for all the controls on the bottom status bar (with or without the Katana).
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

StevenMartin

Quote from: gumtown on May 21, 2020, 03:08:25 AM
Maybe both into the Mac and re-route the controller midi into the Katana, setup an aggregate midi connection in the MAc system midi menu.

I understand all of those words but I think I need another coffee to work out how to pull that one off ;D I think I can make sense of it.

So:

Amp -> Mac
Controller -> Mac
Aggregate MIDI (Controller -> Through Mac -> Amp)?


If I had known FxFloorBoard editor did that I could have saved a bucket of time messing with send/reads with Pocket Midi!!!!  ;D Brilliant. Time to make the swap to that then I think :D Maybe I can set up a debug on my controller to spew out full sysex on writes and then just compare them manually.

sixeight

The solution that partly works for me is to connect the PC to the regular midi port of the Arduino) Teensy) and connect the host port to the Katana. If MIDI is set up on both, you can forward the Midi data.

Use fxfloorboard and set the midi ports to the Arduino.

It may or may not work. It needs large buffers. I still do not have it working fully.... .

gumtown

Have you looked at the Tone Studio address map?
All the sysx addresses are mapped out here
C:\Users\your.username\AppData\Local\Roland\BOSS TONE STUDIO for KATANA MkII\html\js\config\address_map.js
for a Windows system.

Actually might be easier to attach here, renamed *.txt (permitted attachment)
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

StevenMartin

Sounds like it might be a nice solution but I don't have a MIDI port to plug into, and at the moment I'm not planning on adding one as USB will do me for now. So that's a dead-end on my setup. Cool thought though!


I have seen the address map yes, in another forum post. It's in my 'Hoard these potential important resources' folder (not a real name) but it goes over my head.

For example. To toggle Delay type to say Digital, I've been sending something like 0x00 to the address 0x6000062D

But in the address map there it shows:


   var prm_prop_patch_delay = [   // 0x00000500
        ....
        { addr:0x00000001, size:INTEGER1x7        , ofs:0   , init:0   , min:0   , max:10  , name:'TYPE'                   },    // PRM_DLY_TYPE

CodeSmart

Quote from: StevenMartin on May 21, 2020, 04:38:41 AM
Sounds like it might be a nice solution but I don't have a MIDI port to plug into, and at the moment I'm not planning on adding one as USB will do me for now. So that's a dead-end on my setup. Cool thought though!


I have seen the address map yes, in another forum post. It's in my 'Hoard these potential important resources' folder (not a real name) but it goes over my head.

For example. To toggle Delay type to say Digital, I've been sending something like 0x00 to the address 0x6000062D

But in the address map there it shows:


   var prm_prop_patch_delay = [   // 0x00000500
        ....
        { addr:0x00000001, size:INTEGER1x7        , ofs:0   , init:0   , min:0   , max:10  , name:'TYPE'                   },    // PRM_DLY_TYPE


The address map in .js is a relative address. It's not a absolute memory location. To get to the absolute address you have to add things up.

But I got more gear than I need...and I like it!

CodeSmart

That's why I tried to help everyone by publish a list of the absolute addresses.

Also I tried to indicate how to request the actual settings for a block (FX etc) from the amp.

See the "In:" and "Out:" comments in this file.

https://www.vguitarforums.com/smf/index.php?action=dlattach;topic=27749.0;attach=20332

But I got more gear than I need...and I like it!

StevenMartin

Cheers CodeSmart I'll take a look!

Another update:

We can now set effect types to each of the effect GRY slots!

So, we can cycle through all the reverbs and set for example, Plate as Green Reverb, Hall as Yellow Reverb and Spring as Green Reverb.  The same is true for the G/R/Y of the other effects: BST, DLY, MOD, FX.

With that in play, I'm about done with what I can achieve with my little plywood and breadboard prototype! Payday rolls around soon, and then I'll pick up the 'real' hardware such as the footswitches, RGB LEDs and hopefully 5 rotary encoders with push button functions. Then the real fun starts. At that stage, I'll hopefully be able to get some dials working to adjust levels such as gain, bass, mid, treble etc. And adjust the fine details of the effect params.

I'll also need to program a few more buttons such as Wah, Mute, Tap function and Expression (although I don't have an expression to test with yet)

I'll make a video soon to show it all working. I'm honestly baffled I've somehow made it this far, but very pleased. You guys are all super cool for helping out where you have, and I appreciate the advice so far!

StevenMartin

When it's finished processing... full-screen HD will help you see better.


StevenMartin

Any tips on trying to read the tap tempo and convert it into an integer(either into milliseconds or as a BPM)?

I've got the katana.read(TAP_TEMP, 2); and I've got a switch case inside a parseData function detecting TAP_TEMP but I'm not too sure how to get the data back into millis or bpm.

Any ideas from you fine gentlemen?

My Tap Tempo send is working nicely thanks to me pinching Gumtowns wonderful code he posted on another thread:

  uint8_t dd_time_msb = ((60000 / tempo) / 128);
  uint8_t dd_time_lsb = (60000 / tempo) - (dd_time_msb * 128);
  uint8_t data[2];
  data[0] = {dd_time_msb};
  data[1] = {dd_time_lsb};
  katana.send(TAP_TEMP, data, 2, MS3_WRITE);  // bypassing the MS3 Queue, but only way to send 2 byte data


but when I try to read TAP_TEMP I'm not sure it's giving 2 bytes back and even then I don't know how to get it back into millis/bpm  ;D

StevenMartin

I think the answer is tempo = 60000 / ((katana.dataOut2 * 128)+data); //Where dataOut2 is the second byte and data is the first

Seems 'close' mostly.... But I think it's giving inaccurate results as the tempo gets quite high (According to me looking at the katana tap tempo light, and using a tap tempo app.)

StevenMartin

Only a base coat of black that hadn't fully dried (hence the fingerprints) but I got too impatient and had to get this thing test fitted and soldered. Seems to be working well so far!


3dRyan

Fantastic job on this! You've inspired me (with my limited coding knowledge) to tackle this project. I've been reading through your code to help me get an understanding of what is going on. I would love to see an updated video when you have time. You had some issues with your first USB Host board. Which one did you end up getting that worked?

StevenMartin

Hey Ryan,

It was this: https://coolcomponents.co.uk/products/arduino-usb-host-shield I think it's discontinued/out of stock but you can probably find it second hand, or possibly a clone. It piggybacked onto the Mega perfectly and worked out of the box. I think I'd accidentally fried my original mini host shield. I've heard some of the clone host shields need some pins swapping so you might need to do some digging if you go down that route.


Glad you like what I've been doing! I'm honestly not sure you should be looking to my code as an example of anything :D but if it helps them I'm glad.

Some bigger plans to come for this soon, I've sourced some sheet aluminium to make the real casing. Hoping to get it CNC'd out and bend into shape, and then get a custom vinyl wrap printed with a sweet design my mate helped me with so it looks nice. Also, I've got the addition of 5 rotary encoders with push switches built in to arrive in the post yet (I'll retrofit them), and an expression pedal to get working with it too.

Currently, I'm at Version 0.2 in my software. Obviously, the encoders and EXP will need a bunch of new code writing too which I will shoehorn in, so loads of work still to come. After learning some more stuff about C++ I'm thinking of starting again in V.1 and changing my code to be OOP based (object-oriented programming) and working with 'classes' from the start. I think it will cut hundreds and hundreds of unneeded lines from my code and make it much more simple.

sixeight

Quote from: StevenMartin on June 13, 2020, 11:07:40 PMCurrently, I'm at Version 0.2 in my software. Obviously, the encoders and EXP will need a bunch of new code writing too which I will shoehorn in, so loads of work still to come. After learning some more stuff about C++ I'm thinking of starting again in V.1 and changing my code to be OOP based (object-oriented programming) and working with 'classes' from the start. I think it will cut hundreds and hundreds of unneeded lines from my code and make it much more simple.

This sounds familiar.  I started of in 2015. Now five years down the line I am still coding the VController/VC-mini. It is a great hobby. I just have to remember to settle for good and not go for perfect, otherwise the project will drive me mad.

StevenMartin

Continuing on, the 5 rotary encoders are added and working!

The features I've added now are:

-Use the rotary encoders to adjust Bass 0-100, Mid 0-100, Treble 0-100

-Use the rotary encoders to adjust Channel Gain 0-100 and Channel Volume 0-100

-Use the rotary encoders to adjust Cab Presence 0-100, and Cab Resonance type (Vintage, Modern and Deep)

-Use rotary encoders to adjust Reverb level 0-100, Mod level 0-100, FX level 0-100, Delay level 0-100, Boost level 0-100 (These essentially 'clone' the functionality of adjusting the effect level knobs on the amp... so they each control the most 'relevant' effect parameter.

-Mute button now toggles the amp mute by acting as a Foot Volume set to 0 or 100.

-Just for kicks we can now set the LED brightness from the controller.




Essentially, the foot controller can now do everything that can be done on the amp panel, plus extras such as swap the effect type (so cycling types of reverbs for example) as well as adjusting things that the K50 MKII can't do on the amp panel such as cab presence and cab resonance.

We are getting there! There are a few tweaks and swaps I might make because currently there are certain functions that work but are just inconveniently placed on the board.

For example: If you wanted to change the Green delay type and then save it... You'd need to long-press WRITE/MODE button to set the board to 'EDIT MODE', then short press the Delay button to it to Green, then long-press the Delay button to set the board to 'TYPE EDIT MODE' then short press the Delay button to cycle through the types to choose the type, then short press the WRITE/MODE button to save it to that channel.

That's just too convoluted and unnecessary now because I have more than enough buttons/options with 14 footswitches and 5 momentary switch rotary encoders to be able to make these things a lot easier and more intuitive.

Development might slow down a bit from now as I have a baby on the way in less than two weeks. But aside from the inconvenient placements I mentioned above, I think I've gotten this to a very useable state now.

List of future development to come later down the line:

- Add in the expression pedal for Vol and Wah
- Add in the noise suppressor effect/settings
- Incorporate a full LCD Menu system
- Add the ability to adjust the finer details of each effect (such as for Reverb BTS can adjust Reverb Time, PreDelay, Low Cut, High Cut, Density, Effect Level, Direct Mix)
- Redo the full code from scratch using classes and OOP instead of procedural programming.
- Look into the possibility of adding a Micro SD card/reader so we can permanently save and recall presets even after powering the Arduino down.
- Of course, we also need to make the 'final' product out of aluminium and then transfer all the hardware across before getting it vinyl wrapped and looking fancy.

3dRyan

I thought I would add my finished build here for my Katana-50 MKII. A big thanks to BauerByter and StevenMartin who helped a ton! I used BauerByter's code on github and modified the LED and switch pin numbers and everything worked great. The only thing I couldn't get working was the LED for the tap button but I don't care that much. There were a few dumb things I did at the beginning where I wasted way too much time. All my previous arduino projects (small robotics) used the Arduino IDE. StevenMartin helped me learn about Visual Studio Code and the platformio tool. The second thing is that most USB shields need to have the solder flowed for 5v or 3.3v. Once you flow the solder for the 5v connection everything works.

I then designed and 3d printed a case for it. I made the control labels portion removable so it was an easy change if I wanted to change it. I haven't had much time to do any further work on it and it works good enough for my needs. I'll share my fusion360 files here for anyone who wants to modify my design (it's far from perfect).

Thanks again for everyone's help.

gumtown

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

StevenMartin