Katana Head SysEx on Midi In Port

Started by LyndsW, December 08, 2017, 02:08:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alancarl

I think the reason that SYSEX might not work at the MIDI DIN connector could be the one way only comm... A while ago I was working with Robert of Primova to see if we could get blind SYSEX commands to flow from the MIDX-20 to the Katana USB port. We were not successful and Robert's explanation was that the normal negotiation talk between SYSEX device and Katana could not take place.
So only one midi port apparently only tells half of the story.
Thoughts?
Thanks
Al

gumtown

#26
One way to test sysx on the Katana midi in port is to use Katana FxFloorBoard editor, and a usb-midi adapter.
Run the editor and select the midi device in the 'Preferences' menu and set to 'debug' mode to allow a forced midi connection and blind sysx sending.
Plug the USB midi device 'midi out' into the Katana 'midi in' and press the editor's "Connect" button and try any editor controls/settings.
The midi/sysx data sent will also be displayed on the bottom status bar.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

joelt

Thanks for the thoughts all
It would be odd for them to block Sysex over Midi so I'm going to guess it's one of three things
- As mentioned above it could be the one way communication of the Midi In port (this has been a pain with my midi controller anyway to get LED statuses correct!)
- There is a bug in the Katana software that is probably very low priority for Boss
- We're doing something wrong!

The FxFloorBoard editor + usb-midi adapter test is a very good idea, I'll have to give that a try and if it doesn't work then cut my losses for now with v2 of my controller being over USB - I mostly want Tap tempo and cycle through fx colours but I can live without them for now as I'm enjoying what is basically a mini DIY GA-FC

vtgearhead

Quote from: alancarl on April 02, 2018, 10:48:13 AM
I think the reason that SYSEX might not work at the MIDI DIN connector could be the one way only comm... A while ago I was working with Robert of Primova to see if we could get blind SYSEX commands to flow from the MIDX-20 to the Katana USB port. We were not successful and Robert's explanation was that the normal negotiation talk between SYSEX device and Katana could not take place.
So only one midi port apparently only tells half of the story.
Thoughts?
Thanks
Al

I'm not sure what you mean by "blind" SYSEX commands.  Can you explain further?

CodeSmart

Quote from: vtgearhead on April 03, 2018, 04:56:09 AM
I'm not sure what you mean by "blind" SYSEX commands.  Can you explain further?
What we did was a special firmware that would say "yes its a katana" regardless what was connected.
Of course the initial negotiation would time out, but after that we were hoping that sending 5-pin Katana sysex would affect the amp. It did not work. The whole experiment was not very scientific and I did never dig deep into the issue since I had not much time.

Still have no time, so please go ahead try the Gumtown thing...
But I got more gear than I need...and I like it!

alancarl

#30
Quote from: gumtown on April 02, 2018, 11:42:04 AM
One way to test sysx on the Katana midi in port is to use Katana FxFloorBoard editor, and a usb-midi adapter.
Run the editor and select the midi device in the 'Preferences' menu and set to 'debug' mode to allow a forced midi connection and blind sysx sending.
Plug the USB midi device 'midi out' into the Katana 'midi in' and press the editor's "Connect" button and try any editor controls/settings.
The midi/sysx data sent will also be displayed on the bottom status bar.

Thanks Gummie!
    I tried your experiment with the FX Floorboard and I still arrived at the same conclusion: The KATANA Head does not read SYSEX at the 5 pin DIN MIDI In port.

I do appreciate your experiment because I learned how to send a blind SYSEX command from your FX Floorboard application to the KATANA!
I Will find uses for that knowledge :-)

Here is a screen shot showing verification in two ways of the commands that i sent from my MBP to the KATANA MIDI In port.




To show that I had a working MIDI connection here is one showing the MIDI Program changes that I sent to the KATANA MIDI In port that did in fact change the channels on the KATANA as I watched!



I solved this by obtaining not one but two Primova Sound MIDX-20's! This gave me the SYSEX to MIDI DIN path to the KATANA head that we are looking for here.

FWIW the MIDX-20 allows me to connect my MIDIDesigner iPad control template to the KATANA head without a computer for the gig!
I used it for a Detroit Symphony Orchestra Pops concert yesterday night and it worked great!
Thanks everyone!
AL

BSilveira

Hello, guys. I hope you are great.
First of all, congratulations on the excellent work you've put into developing these alternative DIY solutions to control our beloved Katana amps.

After an extensive research in this forum, reading several topics on the subject at least 3 times, I couldn't figure out exactly if would be possible to use Arduino as a midi controller in order to mimic all 6 GA-FC's controls (with exp pedals), but using Katana's Midi Input.. I'm aware that midi input does not receive SysEx commands and that Arduino through the GA-FC input is not yet fully implemented.

Please, note that I only want to mimic GA-FC controls, but using the Midi input on Katana. Why? Because GA-FC is hell^3 expensive here in Brazil (just like every piece of electronic gear guitar related :'().
Also, I'm not a programming expert, neither Midi monster, so I kindly ask you to be a little slow on the explanations.

Well, I found a series of 3 videos on youtube () which demonstrate step by step how to configure arduino Uno (or Nano) as a Midi controller, with pots and momentary switches.

This way, I will be extremely grateful if you Midi Gurus could answer my questions below:

1 - Would that codes from the youtube videos work with Katana if I choose the correct CC and PC commands for the amp?

2 - Will I be able to configure 3 of Arduino's analog inputs as TRS Jacks and plug expression pedals (vol, effects, wah) using the CC codes provided in the owner's manual of Katana? (2 of GA-FC and 1 from the empty Exp Jack on the back of the Head)

3 - How can I code the button Effect from the GA-FC since it doesn't have a CC command in the manual?

4 - How to manage the Tap Tempo when changing from Preset to Effects by pressing the Effects button? Will that work automatically just by coding "FX3 SW" while Effects is activated?

Many thanks to anyone that could help me with some mentoring.

Cheers!

CodeSmart

Re-read the label of this thread. You need Sysex MIDI commands to do deep communication with the Katana.
Without an in-between translator box like the MIDX-20 there's very little CC the Katana listens to.
But I got more gear than I need...and I like it!

BSilveira

Quote from: CodeSmart on January 23, 2019, 03:59:47 PM
Re-read the label of this thread. You need Sysex MIDI commands to do deep communication with the Katana.
Without an in-between translator box like the MIDX-20 there's very little CC the Katana listens to.

Thanks for the reply, CodeSmart!
I do understand we need SysEx commands to control extra features of the amp other than those with GA-FC, but I don't consider using "official" Midi command list of the manual a deep communication with the amp, since it is almost the same as GA-FC. MIDX-20 for sure is deep communication, the same for the FloorBoard.

This way, I was thinking about only replicate GA-FC functionalities using the Midi commands listed in the owner's manual to send messages via Arduino (with proper Midi library installed) to Katana Midi IN without any hubs in the middle.

In fact, I've seen someone doing part of it in Reddit. It is clear that he managed to add the Effects button function from the GA-FC to his rig, but the guy did not finish his project, since he did not add expression pedal functions, neither tap tempo and I think also the button to change to Panel Mode. Here is the link:
from r/arduino


Well. I'll build a protoboard with arduino to test those PC and CC commands to see for myself and also try to contact the guy from Reddit.

If someone has other ideas or some advice, I appreciate!

Cheers!

SteveO

I have a working prototype of a USB MIDI replacement for a GAFC. However, I don't have an expression pedal input yet nor do I have taptempo. I'm going to try adding an expression pedal input later if I have time. I don't need the tap tempo.

I can share my code tomorrow but I'm not much of a programmer and it's not finished so it's messy and not concise.  I hope to start to make an enclosure for it next week. It's been tested on my desk but that's about it.

I have it working with an Arduino Nano or Uno r3 plus a usb host Sheild. I used this library but changed one line of code to make it work with the Katana: https://github.com/MrHaroldA/MS3  This is the thread that I read before using the library: https://www.vguitarforums.com/smf/index.php?topic=21864.msg156460#msg156460

BSilveira

Quote from: TrainedChimp on January 23, 2019, 07:36:19 PM
I have a working prototype of a USB MIDI replacement for a GAFC. However, I don't have an expression pedal input yet nor do I have taptempo. I'm going to try adding an expression pedal input later if I have time. I don't need the tap tempo.

I can share my code tomorrow but I'm not much of a programmer and it's not finished so it's messy and not concise.  I hope to start to make an enclosure for it next week. It's been tested on my desk but that's about it.

I have it working with an Arduino Nano or Uno r3 plus a usb host Sheild. I used this library but changed one line of code to make it work with the Katana: https://github.com/MrHaroldA/MS3  This is the thread that I read before using the library: https://www.vguitarforums.com/smf/index.php?topic=21864.msg156460#msg156460

Interesting stuff, Mr. Chimp.
The USB Host thing with Arduino is very interesting making it similar to the MIDX 20. It is very complex for me to code at this level since I have very little programming skills (I've just started to learn Python).

The coding for Beaglebone is available on github in this link https://github.com/snhirsch/katana-midi-bridge (credits to the Gurus here in this forum).
Is it possible to adapt this code to use it with Arduino? (I'm not sure this is a silly question... ;D)

Good luck to us!

Cheers!



vtgearhead

Quote from: BSilveira on January 24, 2019, 05:20:16 AM
The coding for Beaglebone is available on github in this link https://github.com/snhirsch/katana-midi-bridge (credits to the Gurus here in this forum).
Is it possible to adapt this code to use it with Arduino? (I'm not sure this is a silly question... ;D)

You could use my code for ideas and general guidance, but I think you'll have a long wait before a full-featured Python runtime is available for Arduino.  Feel free to ask any questions you might have about my katana MIDI bridge.  I no longer have time or interest in working on it and seldom use my Katana since acquiring a Helix.  But, if any of the ideas there are useful to others I'm available to discuss or explain (assuming I remember :-)).

SteveO

#37
BSilveira,

This is the code I have, it's not very complex. I'm actually using an LCD and OLEDs with my build; I stripped all of that out to make the important stuff easier to see. My test setup only has four buttons, but the final will have 6 or 7. It should give you an idea. You can have the full version if you rather. 

You'll need https://www.amazon.com/gp/product/B0777DR3T6/ref=ppx_yo_dt_b_asin_title_o03__o00_s00?ie=UTF8&psc=1 or something like this: https://www.amazon.com/gp/product/B01EWW9R1E/ref=ppx_yo_dt_b_asin_title_o01__o00_s00?ie=UTF8&psc=1

/* In MS3.h library change the lin below for sysex headerfrom 0x3b to 0x33 for Katana amps
   const byte MS3_HEADER[6] = {0x41, 0x00, 0x00, 0x00, 0x00, 0x33};
*/

// Uncomment this to enable verbose debug messages.
#define MS3_DEBUG_MODE

#include "Arduino.h"
#include "MS3.h"
//#include <Wire.h>
#define TOTAL_LED 4

const int SW1 = 2;
const int SW2 = 3;
const int SW3 = 4;
const int SW4 = 5;
const int SW5 = 6;
const int SW6 = 7;
const int ledPin1 = A0;
const int ledPin2 = A1;
const int ledPin3 = A2;
const int ledPin4 = A3;
byte ledArray[] = {ledPin1, ledPin2, ledPin3, ledPin4};
unsigned long db = 500; // Variable for debounce
unsigned long lastRead = millis();
int effects = 0;  // set effects sw to off -> buttons 1-4 send PC
int bank = 1;     // Set to send PCs 1-4
int effectsState1 = 0;
int effectsState2 = 0;
int effectsState3 = 0;
int fxLoopstate = 0;
int channel1 = 1;
int currentChannel = 1;
int midiByte = 0 ;
byte chn = 3;     // Midi channel
const unsigned long msg = 0;

// sysex define ################################
const unsigned long PC = 0x00010000; // change channel MS3.write(P_PATCH, 1, 2) second byte is channel number 3rd is length
const unsigned long CC16 = 0x60000030; //turn button 1 on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long CC17 = 0x6000034C; //turn button 2 on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long CC18 = 0x60000610; //turn reverb on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long Loop = 0x60000655;   // turn loop off on
const unsigned long rvbRed = 0x60001214; // set reverb type to red  MS3.write(P_PATCH, 1, 1)
// end sysex define ##############################
//###########################
//###########################
// Initialize the MS3 class.
MS3 katana;

//###########################
//###########################
// Loop to turn all LEDs off
void setAllLEDs(int type) {
  for (int i = 0; i < TOTAL_LED - 2; i++) {
    digitalWrite(ledArray[i], type);
  }
}
//###########################
//###########################
// blink the leds at start up
void blinkAllLeds(int numTimes, int inDelay) {
  for (int j = 0; j < numTimes; j++) {
    for (int i = 0; i < TOTAL_LED; i++) {
      digitalWrite(ledArray[i], HIGH);
      delay(inDelay);
      digitalWrite(ledArray[i], LOW);
    }
  }
}
//###########################
//###########################

void setup() {
// Wire.begin();
  while (!Serial);
  delay(1000);

  pinMode(SW1, INPUT_PULLUP); // setup button as input
  pinMode(SW2, INPUT_PULLUP); // setup button as input
  pinMode(SW3, INPUT_PULLUP); // setup button as input
  pinMode(SW4, INPUT_PULLUP); // setup button as input
  pinMode(SW5, INPUT_PULLUP); // setup button as input
  pinMode(SW6, INPUT_PULLUP); // setup button as input
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  //////////////////////////// End OLED

  Serial.begin(115200);
  delay(1500);
  while (!Serial) {}

  if (!katana.begin()) {
    Serial.println(F("*** USB / MS3 init error! ***"));
    while (true);
  }
  Serial.println(F("Ready!"));
  Serial.println();

  // Set the katana into BTS edit mode
  // This allows for patch changes and effects to be changed
  unsigned long parameter = 0;
  byte data = 0;
  switch (katana.update(parameter, data)) {
    case MS3_READY:
      katana.setEditorMode();
      katana.read(PC, 0x02);
      break;
  }

  blinkAllLeds(1, 200);
  setAllLEDs(LOW);
}
//###########################
//###########################
// Query the katana
void parseData(unsigned long parameter, byte data) {
  switch (parameter) {
    case msg:
      break;
    default:
      ;
  }
}

//###########################
//###########################
// If USB connection is lost set the katana back in BTS edit mode
void setEdit(void) {
  unsigned long test = 0;
  byte dataTest = 0;
  Serial.println();
  Serial.println(F("Waiting..."));
  Serial.println();
  katana.begin();
  delay(400);
  switch (katana.update(test, dataTest)) {
    case MS3_READY:
      Serial.println(F("############ Now I'm ready!"));
      Serial.println();
      katana.setEditorMode();
      katana.read(PC, 0x02);
      break;
  }
}
//###########################
//###########################
void loop() {

  // Check for incoming data or send a queued item.
  unsigned long parameter = 0;
  byte data = 0;
  switch (katana.update(parameter, data)) {
    case MS3_NOT_READY:
      Serial.println(F("Katana NOT READY!"));
      Serial.println();
      setEdit();
      break;

    case MS3_DATA_RECEIVED:
      break;
  }


  if (digitalRead(SW3) == LOW  && millis() - lastRead > db) {
    if (bank == 1) {
      digitalWrite(ledPin3, HIGH);
      lastRead = millis();
      bank = 2;
    }

    else {
      digitalWrite(ledPin3, LOW);
      lastRead = millis();
      bank = 1;
    }
  }

  if (digitalRead(SW4) == LOW  && millis() - lastRead > db) {
    if (effects == 0) {
      effects = 1;
      digitalWrite(ledPin4, HIGH);
      lastRead = millis();
    }

    else {
      effects = 0;
      digitalWrite(ledPin4, LOW);
      lastRead = millis();
    }
  }


  if (bank == 1 && effects == 0) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin1, HIGH);
      data = 1; // this is the channel you want to select
      katana.write(PC, data, 2);
      lastRead = millis();
    }

    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin2, HIGH);
      data = 2;
      katana.write(PC, data, 2);
      lastRead = millis();
    }
  }

  if (bank == 2 && effects == 0) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin1, HIGH);
      data = 5;
      katana.write(PC, data, 2);
      lastRead = millis();
    }

    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin2, HIGH);
      data = 6;
      katana.write(PC, data, 2);
      lastRead = millis();
    }
  }

  if (effects == 1) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      if (effectsState1 == 0) {
        digitalWrite(ledPin1, HIGH);

        katana.write(CC16, 1, 1);
        lastRead = millis();
        effectsState1 = 1;
      }
      else {
        digitalWrite(ledPin1, LOW);
        katana.write(CC16, 0, 1);
        lastRead = millis();
        effectsState1 = 0;
      }
    }
    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      if (effectsState2 == 0) {
        digitalWrite(ledPin2, HIGH);
        katana.write(CC17, 1, 1);
        effectsState2 = 1;
        lastRead = millis();
      }

      else {
        digitalWrite(ledPin2, LOW);
        katana.write(CC17, 0, 1);
        lastRead = millis();
        effectsState2 = 0;
      }
    }
    if (digitalRead(SW3) == LOW && millis() - lastRead > db) {
      if (effectsState3 == 0) {
        katana.write(CC17, 1, 1);
        lastRead = millis();
        effectsState3 = 1;
      }

      else {
        katana.write(CC17, 0, 1);
        lastRead = millis();
        katana.write(CC17, 0, 1);
        effectsState3 = 0;
      }
    }
    if (digitalRead(SW4) == LOW && millis() - lastRead > db) {
      if (fxLoopstate == 0) {
        katana.write(Loop, 1, 1);
        fxLoopstate = 1;
        lastRead = millis();
      }

      else {
        katana.write(Loop, 0, 1);
        lastRead = millis();
        katana.write(Loop, 0, 1);
        fxLoopstate =0;
       
      }
    }
  }
}

BSilveira

Quote from: TrainedChimp on January 24, 2019, 09:08:53 AM
BSilveira,

This is the code I have, it's not very complex. I'm actually using an LCD and OLEDs with my build; I stripped all of that out to make the important stuff easier to see. My test setup only has four buttons, but the final will have 6 or 7. It should give you an idea. You can have the full version if you rather. 

You'll need https://www.amazon.com/gp/product/B0777DR3T6/ref=ppx_yo_dt_b_asin_title_o03__o00_s00?ie=UTF8&psc=1 or something like this: https://www.amazon.com/gp/product/B01EWW9R1E/ref=ppx_yo_dt_b_asin_title_o01__o00_s00?ie=UTF8&psc=1

/* In MS3.h library change the lin below for sysex headerfrom 0x3b to 0x33 for Katana amps
   const byte MS3_HEADER[6] = {0x41, 0x00, 0x00, 0x00, 0x00, 0x33};
*/

// Uncomment this to enable verbose debug messages.
#define MS3_DEBUG_MODE

#include "Arduino.h"
#include "MS3.h"
//#include <Wire.h>
#define TOTAL_LED 4

const int SW1 = 2;
const int SW2 = 3;
const int SW3 = 4;
const int SW4 = 5;
const int SW5 = 6;
const int SW6 = 7;
const int ledPin1 = A0;
const int ledPin2 = A1;
const int ledPin3 = A2;
const int ledPin4 = A3;
byte ledArray[] = {ledPin1, ledPin2, ledPin3, ledPin4};
unsigned long db = 500; // Variable for debounce
unsigned long lastRead = millis();
int effects = 0;  // set effects sw to off -> buttons 1-4 send PC
int bank = 1;     // Set to send PCs 1-4
int effectsState1 = 0;
int effectsState2 = 0;
int effectsState3 = 0;
int fxLoopstate = 0;
int channel1 = 1;
int currentChannel = 1;
int midiByte = 0 ;
byte chn = 3;     // Midi channel
const unsigned long msg = 0;

// sysex define ################################
const unsigned long PC = 0x00010000; // change channel MS3.write(P_PATCH, 1, 2) second byte is channel number 3rd is length
const unsigned long CC16 = 0x60000030; //turn button 1 on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long CC17 = 0x6000034C; //turn button 2 on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long CC18 = 0x60000610; //turn reverb on  MS3.write(P_PATCH, 1, 1) second byte 0 = off 1 = on
const unsigned long Loop = 0x60000655;   // turn loop off on
const unsigned long rvbRed = 0x60001214; // set reverb type to red  MS3.write(P_PATCH, 1, 1)
// end sysex define ##############################
//###########################
//###########################
// Initialize the MS3 class.
MS3 katana;

//###########################
//###########################
// Loop to turn all LEDs off
void setAllLEDs(int type) {
  for (int i = 0; i < TOTAL_LED - 2; i++) {
    digitalWrite(ledArray[i], type);
  }
}
//###########################
//###########################
// blink the leds at start up
void blinkAllLeds(int numTimes, int inDelay) {
  for (int j = 0; j < numTimes; j++) {
    for (int i = 0; i < TOTAL_LED; i++) {
      digitalWrite(ledArray[i], HIGH);
      delay(inDelay);
      digitalWrite(ledArray[i], LOW);
    }
  }
}
//###########################
//###########################

void setup() {
// Wire.begin();
  while (!Serial);
  delay(1000);

  pinMode(SW1, INPUT_PULLUP); // setup button as input
  pinMode(SW2, INPUT_PULLUP); // setup button as input
  pinMode(SW3, INPUT_PULLUP); // setup button as input
  pinMode(SW4, INPUT_PULLUP); // setup button as input
  pinMode(SW5, INPUT_PULLUP); // setup button as input
  pinMode(SW6, INPUT_PULLUP); // setup button as input
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  //////////////////////////// End OLED

  Serial.begin(115200);
  delay(1500);
  while (!Serial) {}

  if (!katana.begin()) {
    Serial.println(F("*** USB / MS3 init error! ***"));
    while (true);
  }
  Serial.println(F("Ready!"));
  Serial.println();

  // Set the katana into BTS edit mode
  // This allows for patch changes and effects to be changed
  unsigned long parameter = 0;
  byte data = 0;
  switch (katana.update(parameter, data)) {
    case MS3_READY:
      katana.setEditorMode();
      katana.read(PC, 0x02);
      break;
  }

  blinkAllLeds(1, 200);
  setAllLEDs(LOW);
}
//###########################
//###########################
// Query the katana
void parseData(unsigned long parameter, byte data) {
  switch (parameter) {
    case msg:
      break;
    default:
      ;
  }
}

//###########################
//###########################
// If USB connection is lost set the katana back in BTS edit mode
void setEdit(void) {
  unsigned long test = 0;
  byte dataTest = 0;
  Serial.println();
  Serial.println(F("Waiting..."));
  Serial.println();
  katana.begin();
  delay(400);
  switch (katana.update(test, dataTest)) {
    case MS3_READY:
      Serial.println(F("############ Now I'm ready!"));
      Serial.println();
      katana.setEditorMode();
      katana.read(PC, 0x02);
      break;
  }
}
//###########################
//###########################
void loop() {

  // Check for incoming data or send a queued item.
  unsigned long parameter = 0;
  byte data = 0;
  switch (katana.update(parameter, data)) {
    case MS3_NOT_READY:
      Serial.println(F("Katana NOT READY!"));
      Serial.println();
      setEdit();
      break;

    case MS3_DATA_RECEIVED:
      break;
  }


  if (digitalRead(SW3) == LOW  && millis() - lastRead > db) {
    if (bank == 1) {
      digitalWrite(ledPin3, HIGH);
      lastRead = millis();
      bank = 2;
    }

    else {
      digitalWrite(ledPin3, LOW);
      lastRead = millis();
      bank = 1;
    }
  }

  if (digitalRead(SW4) == LOW  && millis() - lastRead > db) {
    if (effects == 0) {
      effects = 1;
      digitalWrite(ledPin4, HIGH);
      lastRead = millis();
    }

    else {
      effects = 0;
      digitalWrite(ledPin4, LOW);
      lastRead = millis();
    }
  }


  if (bank == 1 && effects == 0) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin1, HIGH);
      data = 1; // this is the channel you want to select
      katana.write(PC, data, 2);
      lastRead = millis();
    }

    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin2, HIGH);
      data = 2;
      katana.write(PC, data, 2);
      lastRead = millis();
    }
  }

  if (bank == 2 && effects == 0) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin1, HIGH);
      data = 5;
      katana.write(PC, data, 2);
      lastRead = millis();
    }

    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      setAllLEDs(LOW);
      digitalWrite(ledPin2, HIGH);
      data = 6;
      katana.write(PC, data, 2);
      lastRead = millis();
    }
  }

  if (effects == 1) {
    if (digitalRead(SW1) == LOW && millis() - lastRead > db) {
      if (effectsState1 == 0) {
        digitalWrite(ledPin1, HIGH);

        katana.write(CC16, 1, 1);
        lastRead = millis();
        effectsState1 = 1;
      }
      else {
        digitalWrite(ledPin1, LOW);
        katana.write(CC16, 0, 1);
        lastRead = millis();
        effectsState1 = 0;
      }
    }
    if (digitalRead(SW2) == LOW && millis() - lastRead > db) {
      if (effectsState2 == 0) {
        digitalWrite(ledPin2, HIGH);
        katana.write(CC17, 1, 1);
        effectsState2 = 1;
        lastRead = millis();
      }

      else {
        digitalWrite(ledPin2, LOW);
        katana.write(CC17, 0, 1);
        lastRead = millis();
        effectsState2 = 0;
      }
    }
    if (digitalRead(SW3) == LOW && millis() - lastRead > db) {
      if (effectsState3 == 0) {
        katana.write(CC17, 1, 1);
        lastRead = millis();
        effectsState3 = 1;
      }

      else {
        katana.write(CC17, 0, 1);
        lastRead = millis();
        katana.write(CC17, 0, 1);
        effectsState3 = 0;
      }
    }
    if (digitalRead(SW4) == LOW && millis() - lastRead > db) {
      if (fxLoopstate == 0) {
        katana.write(Loop, 1, 1);
        fxLoopstate = 1;
        lastRead = millis();
      }

      else {
        katana.write(Loop, 0, 1);
        lastRead = millis();
        katana.write(Loop, 0, 1);
        fxLoopstate =0;
       
      }
    }
  }
}


Thank you very much, Chimp.
This is a step further to what I was thinking, but I'll give the midi bridge a try.

I have an Arduino nano, so I don't think the USB shield will work. I suppose I need an Arduino Uno.

I'll let you guys know when I finish my project. It may take I while since I need to import components from the USA or China.

Cheers!

SteveO

The nano works just fine. However, the shield doesn't mount on the nano itself, you just have to do some homework to wire it up properly and make sure the shield only gets 3.3 v. Just make sure whatever you use has enough pins for the number of switches and LEDS you want to use or you'll have to get fancier. I decided to use a Teensy 3.2. The mini usb host can mount right on top of an Arduino mircro pro, but I don't know much about those.


SteveO

BSilveira,

I just remembered that  I "cut the trace inside VBUS jumper" on the host shield  as mentioned in the second paragraph under the Power Options part of this page: https://www.circuitsathome.com/usb-host-shield-hardware-manual/ shown here: https://www.pjrc.com/teensy/td_libs_USBHostShield.html. I googled these pictures: https://geekhack.org/index.php?PHPSESSID=jnim6u2dcno62u8vpbm8sl9ias67hb3o&action=dlattach;topic=80421.0;attach=130856;image and https://geekhack.org/index.php?PHPSESSID=jnim6u2dcno62u8vpbm8sl9ias67hb3o&action=dlattach;topic=80421.0;attach=130858;image

Also, I started a new thread here about using Teensy here:https://www.vguitarforums.com/smf/index.php?topic=25185.0 I haven't tested my newest code with an Arduino, just a Teensy 3.2.

scion19801

Quote from: SteveO on January 23, 2019, 07:36:19 PM
I have a working prototype of a USB MIDI replacement for a GAFC. However, I don't have an expression pedal input yet nor do I have taptempo. I'm going to try adding an expression pedal input later if I have time. I don't need the tap tempo.

I can share my code tomorrow but I'm not much of a programmer and it's not finished so it's messy and not concise.  I hope to start to make an enclosure for it next week. It's been tested on my desk but that's about it.

I have it working with an Arduino Nano or Uno r3 plus a usb host Sheild. I used this library but changed one line of code to make it work with the Katana: https://github.com/MrHaroldA/MS3  This is the thread that I read before using the library: https://www.vguitarforums.com/smf/index.php?topic=21864.msg156460#msg156460
do you have any info or pics on how you had this setup? I just tried to compile it and got multiple errors using code you had listed for using arduino uno and usb host shield. trying to do a cheap knock off of the ga-fc as i have the uno and switches, just need some leds and the usb host shield, then i should be able to get something working.....

alancarl

Quote from: admin on April 02, 2018, 09:30:48 AMAgreed - also the electrical circuit of the Katana 5 pin DIN MIDI Input matches the typical 5 pin MIDI Input on other Roland / Boss gear ( GT-100)

I see no reason why they would block MIDI SYSEX

Suggest retry with a Roland UM-ONE MK II

Hi fellow katana tweakedz:-)
I have an explanation for my findings that the katana head amp does not pass system exclusive information at its MIDI port(with substitutions and comparisons of all connected hardware and software I am confident that this is in fact true)
I'm working on a similar iPad editor wired to one of my boss waza TAE's.. it has 5 pin DIN for MIDI in and 5 pin DIN for MIDI out and it in fact does receive and send system exclusive over those 5 pin DIN ports...
—-/So I hypothesize that Roland saw no need to implement system exclusive on the devices with only a MIDI In port w that would then accommodate the so-called blind transfers:-)
It's a terrific discovery that I made with the waza TAE midi in and out ports because I have one less thing in the rig—-which is my USB control hop interpreter raspberry pi 3B plus!!
Al

gumtown

Quote from: scion19801 on August 13, 2019, 11:58:34 AMdo you have any info or pics on how you had this setup? I just tried to compile it and got multiple errors using code you had listed for using arduino uno and usb host shield. trying to do a cheap knock off of the ga-fc as i have the uno and switches, just need some leds and the usb host shield, then i should be able to get something working.....
An Arduino UNO will not work with the code, as it is designed for the higher spec Teensy3.x and upward.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

Quote from: alancarl on January 14, 2023, 09:04:11 AMHi fellow katana tweakedz:-)
I have an explanation for my findings that the katana head amp does not pass system exclusive information at its MIDI port(with substitutions and comparisons of all connected hardware and software I am confident that this is in fact true)
I'm working on a similar iPad editor wired to one of my boss waza TAE's.. it has 5 pin DIN for MIDI in and 5 pin DIN for MIDI out and it in fact does receive and send system exclusive over those 5 pin DIN ports...
—-/So I hypothesize that Roland saw no need to implement system exclusive on the devices with only a MIDI In port w that would then accommodate the so-called blind transfers:-)
It's a terrific discovery that I made with the waza TAE midi in and out ports because I have one less thing in the rig—-which is my USB control hop interpreter raspberry pi 3B plus!!
Al
I believe it to be true, that the Katana head midi in only listens to program change and cc# controller but not sysex.
You might want to cast your gaze at either the CME Widi uHost or the Airstep, as both connect to the Katana usb port and provide BLE Bluetooth midi capable of system exclusive, so your iPad could interface wireless to the Katana.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

alancarl

Thanks Colin
I actually have and use both of those BTLe options:-)
It's better now with the newer generations of BTLe implementations but I tend to favor wired connections when possible over wireless routes to reduce the variables in a live setting and the parameter changes/updates are usually smoother and quicker.
What I still am hoping for is class compliant usb in all of Roland/Boss products...:-)
Thanks again for all of your contributions in the betterment of controlling our great Boss devices Gumtown!
Al