KATANA - Snhirsch's Katana MIDI Bridge for RPI / BeagleBone

Started by vtgearhead, December 26, 2016, 08:53:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vtgearhead

If you can do 5-pin MIDI I/O by bit-banging rather than a UART it might be reasonably inexpensive to build.  On a BB you could run bit-banger logic on one of the PRUs and get guaranteed real-time response.  Would be a bit of assembly coding on the PRU side, but parts count reduces to one opto-isolator and a couple of resistors for each 5-pin port.  Different story on the RPi, unfortunately.  No auxiliary processor available and the Linux kernel doesn't make any latency guarantees. 

The PRUs (Programmable Realtime Units) are little processors that run at 200Mhz. with fully deterministic timing.  They're fast enough to read data from older hard disks and handle MFM decoding on the fly while doing so.  For a classic computer geek like me, that's a valuable capability.

sixeight


vtgearhead

I learn something every day.  For some reason I had it in my head that the Pi lacked a UART.  That should work fine.

admin


vtgearhead

I (finally) had a chunk of time to get back to coding on the MIDI bridge and just checked in some major updates. Previously I was saving / restoring only the 'Tone Setting' (patch) and front panel knob settings.  The newest code pays no attention to built-in patch - it neither saves nor restores it.  Instead I take a complete snapshot of front panel knob state, "color button" assignment, active color for each button and all DSP device deep parameters.  A virtual preset restore now brings back the entire amplifier state as it existed at the time it was captured.  Best of all, having gotten patch change out of the process it happens VERY quickly. 

(Patch change is much faster on the Katana than on other Roland devices, but still requires a 50 msec. settling delay before the unit will respond to additional MIDI commands.  Without it the restore is gated only by USB latency.)

If anyone wants to play with this, do:

git clone https://github.com/snhirsch/katana-midi-bridge.git

Then, change into the katana-midi-bridge directory and

git checkout development

Installation procedure is as documented on the front page and the wiki. 

I will eventually get around to implementing most / all of the CC# mappings in the MIDX-20 spec, but given the size of my user community it's not a high priority.

Almost forgot:  Is anyone interested in having the send/return loop settings saved and restored as part of each virtual preset?

alancarl

Quote from: snhirsch on March 26, 2017, 02:46:28 PM
I will eventually get around to implementing most / all of the CC# mappings in the MIDX-20 spec, but given the size of my user community it's not a high priority.

Almost forgot:  Is anyone interested in having the send/return loop settings saved and restored as part of each virtual preset?

Hi Snhirsch,
     I have a Katana head and I really dig it. I am a professional guitarist and I am finding the tone + the feature set of the Katana series amps is pretty hard to beat...and for rock bottom pricing! I have been messing around with Bome's Miidi Translator to send individual parameter values to the Katana and I can see the tremendous potential for the implementation of MIDI cc's to the SYSEX strings to control the amp and its effects and FX loop routings.

I wish that I had more control (or any for that matter) over the DSP allocation. For example I could really use a Limiter and a post Graphic EQ at the same time in every preset... I have been doing this in my discreet device rigs for many years now and I can imagine this is not that unusual.

As for a real useful application for real time control over the Katana parameters Imagine a touch screen device with Graphic EQ faders...the virtual and recallable version of the infamous MESA Boogie onboard 5 band graphic EQ option from their amps of the late 1970's!!
The tone sculpting power of a good and quiet post EQ block is huge for subtle or drastic Timbre changes!
There are certainly a few devices that give us programmable post EQ processing but they are all out of the way to get to and adjust which is a tweak head's nightmare!

I have reverse engineered 20 parameter settings or so and I certainly could do more but a big hurdle is the non USB class compliant port on the KATANA...
Some of the new gear is getting closer to actually being useful to us on the gig... especially if it can happen without a computer.

So the MIDX 20 and your code could really makes this a seriously slammin' platform....

So you have My Vote to carry-on with the project...Real Time Parameter access=Tone sculpting potential!
Thanks!
Al

Elantric

Quotefor a real useful application for real time control over the Katana parameters Imagine a touch screen device with Graphic EQ faders...the virtual and recallable version of the infamous MESA Boogie onboard 5 band graphic EQ option from their amps of the late 1970's!!


Might check out Condors Katana Editor for Android

https://www.vguitarforums.com/smf/index.php?topic=20234.0




alancarl

Quote from: Elantric on March 28, 2017, 07:17:53 PM

Might check out Condors Katana Editor for Android

https://www.vguitarforums.com/smf/index.php?topic=20234.0





Thanks Steve,
     I did read about this nice editor.... I am not an Android user yet:-0
I have made a lot of use of MIDIDesigner for IOS. I find it really easy to get useable MIDI control templates quickly and I have implemented them on many gigs  since I copped the App.

The Midx 20 looks like a path to explore too.. It seems as though the availability is not happening right now...
Al

vtgearhead

I have merged some recent work into the main branch of the Katana MIDI bridge project:

https://github.com/snhirsch/katana-midi-bridge

README has been updated to explain what's changed, but briefly:  The bridge now saves and restores the entire amplifier state, front panel, deep settings, noise-gate - the works.  It no longer knows or cares about the current internal amp preset (Tone Setting).  Full recall is artifact-free and runs in about 50 ms.  If you can tolerate a bit of glitching the muting period can be shortened.

CodeSmart

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

vtgearhead

Thanks.  Now I get to sit down and rebuild all my patches from the ground up.  Good thing my wife likes to listen to me noodle away!

alancarl

Right on Steve!
Once I can get a hold of a MiDx20 I'll be rockin away:-)
Al

vtgearhead

Quote from: alancarl on March 28, 2017, 06:54:07 PM
have been messing around with Bome's Miidi Translator to send individual parameter values to the Katana and I can see the tremendous potential for the implementation of MIDI cc's to the SYSEX strings to control the amp and its effects and FX loop routings.

That's precisely what my Katana bridge and Codesmart's MIDX-20 do for you.

Quote
I have reverse engineered 20 parameter settings or so and I certainly could do more but a big hurdle is the non USB class compliant port on the KATANA...

No need to reverse engineer anything.  I spent most of my Christmas vacation last year doing it for you:

https://github.com/snhirsch/katana-midi-bridge/blob/master/doc/katana_sysex.txt

Quote
So the MIDX 20 and your code could really makes this a seriously slammin' platform....

The MIDX 20 implements the same CC --> sysex mapping that I eventually will.  Robert laid out a nice specification for it and I added my $0.02 in a few places. 

alancarl

Thanks Steve and Robert!
I am now aware of the work you two have done for us with the Katana...
I had started my own reinventing the wheel before I new of you collective solution... but it was good for me to do a bit anyhow.
The availability of the MidX20 will govern what I end up doing with my Katana editor rig but it sounds really slick!
Fwiw I had done a lot of work on an iPad editor for the Fishman Triple Play but I ran into a few roadblocks and i was unsuccessful getting any info from the developers.
The need for tactile control and tweak ability IS in my experience where most platforms fall short.
Al

Elantric

#39
https://www.thegearpage.net/board/index.php?posts/23928466/

Quotesidk47 said: ↑
Would you need the beagle bone with the head version of the katana?

Scatabrain wrote>
----------------------
Here is my FCB setup with the beagle bone. Basically each bank is setup with the following:

10 - tap 3 times to start save - then select 1 - 5 to store
1-5 call up a patch
6, 7, 8, 9 toggles like on the ga/fc in effects mode (not select channel mode)

Then I can switch to a new bank and be able to group 5 related patches there and have the above row for switching effects on and off. Since 10 is save patch on each bank, I don't have to switch banks endlessly to organize on the fly.

FYI: This is a work in progress as the switches only toggle off. The toggle function isn't working. I haven't had any time to fix that yet.

;===============================================================
;===== FCB1010 setup =====
;===== =====
;===== Filename : Katana.txt =====
;===== Created : 14/04/2017 =====
;===== Version : 5.0 =====
;===============================================================
Enable MIDI Merge : true
Enable RunningStatus : true
Disable TapTempo : false
Block repeating PCs : false
Direct Select mode : off
Stompbox mode : off
Stomps on lower row : true
Relay 1 mode : toggling
Relay 1 actuation : normally open
Relay 2 mode : toggling
Relay 2 actuation : normally closed
Note velocity : 100
MIDI channel for PC1 : 02
MIDI channel for PC2 : 02
MIDI channel for PC3 : 02
MIDI channel for PC4 : 02
MIDI channel for PC5 : 02
MIDI channel for CC1 : 02
MIDI channel for CC2 : 02
MIDI channel for Note: 02
MIDI channel for EPA : 02
MIDI channel for EPB : 02

Index | Preset name | PC1 PC2 PC3 PC4 PC5 | CC1:val/alt CC2:val/alt| Note| ExprA:min-max ExprB:min-max | SW |
-------------------------------------------------------------------------------------------------------------------
00.01 | PRESET 001 | 011 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
00.02 | PRESET 002 | 012 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
00.03 | PRESET 003 | 013 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
00.04 | PRESET 004 | 014 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
00.05 | PRESET 005 | 015 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
00.06 | PRESET 006 | ... ... ... ... ... | 016 127 127 016 000 001 | ... | . ... ... ... . ... ... ... | .. |
00.07 | PRESET 007 | ... ... ... ... ... | 017 127 127 017 000 000 | ... | . ... ... ... . ... ... ... | .. |
00.08 | PRESET 008 | ... ... ... ... ... | 018 127 127 018 000 000 | ... | . ... ... ... . ... ... ... | .. |
00.09 | PRESET 009 | ... ... ... ... ... | 019 127 127 019 000 127 | ... | . ... ... ... . ... ... ... | .. |
00.10 | PRESET 010 | ... ... ... ... ... | 003 127 ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.01 | PRESET 011 | 016 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.02 | PRESET 012 | 017 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.03 | PRESET 013 | 018 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.04 | PRESET 014 | 019 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.05 | PRESET 015 | 020 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
01.06 | PRESET 016 | ... ... ... ... ... | 016 127 127 016 000 001 | ... | . ... ... ... . ... ... ... | .. |
01.07 | PRESET 017 | ... ... ... ... ... | 017 127 127 017 000 000 | ... | . ... ... ... . ... ... ... | .. |
01.08 | PRESET 018 | ... ... ... ... ... | 018 127 127 018 000 000 | ... | . ... ... ... . ... ... ... | .. |
01.09 | PRESET 019 | ... ... ... ... ... | 019 127 127 019 000 127 | ... | . ... ... ... . ... ... ... | .. |
01.10 | PRESET 020 | ... ... ... ... ... | 003 127 ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
02.01 | PRESET 021 | 021 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
02.02 | PRESET 022 | 022 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
02.03 | PRESET 023 | 023 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
02.04 | PRESET 024 | 024 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |
02.05 | PRESET 025 | 025 ... ... ... ... | ... ... ... ... ... ... | ... | . ... ... ... . ... ... ... | .. |

etc....

QuoteAs a practical matter, how are folks housing and mounting the Begalboard and Midi/USB interface? Or has anyone gotten that far in the process?
I tried a 3m strip on the inside. It did not work. I will probably use small screws if I need the setup for gigging.

BTW: used a purchased case. I did not like it as there was no flat bottom surface and the flip lid is cool but flops around. I ended up 3d printing one at the local library.

https://www.thingiverse.com/thing:1788065

vtgearhead

I have my BBGW in an open frame case purchased from Seeed Studios web site.  A fully enclosed case would be ideal, but I have not been able to locate one for this particular computer.

vtgearhead

I am continuing to plug away at my katana bridge code.  Version 3.0 is now available on the master branch:

https://github.com/snhirsch/katana-midi-bridge

See README for details.  Main point of this update was to ensure compatibility with "sneaky" settings discovered by Robin Van Boven and accessible through Gumtown's 'FxFloorboard' tool.  I have tied the volume CC to the internal pedal rather than the amplifier volume and operation is much more consistent.

I am using this code for performance and it works quite well.  Patch change takes about 50-60 msec. with only a brief audio dropout.  Not quite as smooth as the internal "Tone Setting" changes, but quite usable. 

The various software tools for Katana cover different feature sets.  Mine may be spartan in terms of CC# mapping but it supports an operation that I find critical: live capture of amplifier panel knob tweaks.  I can craft settings to my heart's content in my practice room but this does not always translate well to ensemble playing. With the bridge I'm free to tweak amplifier volume, tone controls and presence to put on the finishing touch, then overwrite the stored virtual patch with a few pedal taps.  Note:  This won't work for amplifier type, gain or effects controls (since those force a number of deep parameters into states you probably don't want), but for the ones that play nice it's invaluable.

sikejsudjek

Looking forward to building one of these on a raspberry pi. I have a boss gt-10 - would it work with the midi over usb out from the gt-10 ? Linux seems to recognise it as a midi port. If not I have a midi to usb box I can use.

admin

Quote
Looking forward to building one of these on a raspberry pi. I have a boss gt-10 - would it work with the midi over usb out from the gt-10 ? Linux seems to recognise it as a midi port. If not I have a midi to usb box I can use.

If you already have a Boss GT-10, then this  "Katana MIDI Bridge for RPI / BeagleBone" will be no use for you.

Unlike Katana, the Boss GT-10 already has 5 pin MIDI I/O and full Control assignments

sikejsudjek

#44
Ah sorry for the confusion. I'm thinking of using the gt10 as a midi controller some of the time for the katana combo. I have the 100 watt combo amp without the midi socket.

I'm going from the boss gt10 to the katana 100 watt combo. I can either output midi from the gt10 via usb or its dedicated midi out. Am I right in thinking I need a midi bridge to get the katana combo to read them ?

The katana has better pre amps than the gt10, but in 4 cable mode I can only use 2 channels with the channel switching cable. So I'm thinking with the midi bridge I'd have more options to load different patches into the katana, which I could control via pc or cc messages from the gt10. If it works it saves me getting a ga-fc and gives me more options.

admin

If you own a katana 100 combo amp then yes this thread may be relevant to you

bowtomecha

So where does this project stand right now? Is it updated to work with katana v2.0x? How does it compare with the capabilities of the Midx20 and fxfloorboard at this point? I'm considering using a bb green with this.

vtgearhead

Quote from: Bowtomecha on March 20, 2018, 01:00:33 PM
So where does this project stand right now? Is it updated to work with katana v2.0x? How does it compare with the capabilities of the Midx20 and fxfloorboard at this point? I'm considering using a bb green with this.

It stands still, unfortunately, due to my lack of time and - lately - interest.  Neither MIDX nor Floorboard support snapshots in the sense that my code does, but there are some rough edges to this feature and it's noticeably slower than simple preset changes on the amp.  Now that Colin supports MIDI control of Floorboard there's a good free-as-in-beer solution (although, you really should send a few bucks to Kiwi-land if you use his code :-)).

If an energetic Python coder wants to pick up the work, all the basics are there to build on.

SteveO

#48
I just setup a raspberry pi and had to modify things slightly to get katana_bridge_app to start and stop correctly. I am able to send PC messages. Thank you!

I'm a novice with midi and python. In the bridge_app I see the lines:

def handle_cc( trigger, katana, control, value ):
    if control == 3:
        trigger.detect( value )
    else:
        trigger.clear()
        # All our CC --> sysex mappings here
        if control == 70:
            scaled = log_scale(value)
            katana.volume( scaled )

What would the code look like to add an additional CC message? I can't quite follow how the CC to SysEx mappings should be set up. If you don't have time to answer, no problem. Thanks for the work you've done.

vtgearhead

#49
Quote from: TrainedChimp on December 28, 2018, 07:28:25 PM
I just setup a raspberry pi and had to modify things slightly to get katana_bridge_app to start and stop correctly. I am able to send PC messages. Thank you!

I'm a novice with midi and python. In the bridge_app I see the lines:

def handle_cc( trigger, katana, control, value ):
    if control == 3:
        trigger.detect( value )
    else:
        trigger.clear()
        # All our CC --> sysex mappings here
        if control == 70:
            scaled = log_scale(value)
            katana.volume( scaled )

What would the code look like to add an additional CC message? I can't quite follow how the CC to SysEx mappings should be set up. If you don't have time to answer, no problem. Thanks for the work you've done.

The basic idea is to match incoming CC message numbers ('control') to a method on the Katana class that accepts the message value ('value') as its argument.  The Katana class method is responsible for forming an appropriate sysex string and you'll find some helper methods for that purpose, along with methods for transmitting the string.

So, suppose you have written a method that controls wah pedal filter sweep and you wish to map it to, e.g. CC #71.  This is done by adding another clause to the 'if' statement along the lines of:

if control == 70:
            scaled = log_scale(value)
            katana.volume( scaled )
elif control == 71:
            katana.wah_sweep( value )
...

Keep adding 'elif' statements as required.  I did not like the pedal response characteristics of my Behringer FCB1010 pedal board and wrote a 'log_scale' function to modify it.  You may or may not want to do that for wah or other effects.