New DIY Basic Midi Footswitch based on Arduino Mega - Help Needed/Apreciated

  • Hello all,


    I've spent the last few days looking for the 'perfect' MIDI controller for me.


    I've realised I do things differently, so I'm going to have a go at building one. I don't like dancing around my pedal board, I use about 8 different sounds in a gig and I want to have them available at the push of a button.


    My board will feature 8 MIDI PC to switch between the 1st 4 profiles of the first 2 performances in the Kemper's performance mode.
    I will then have 5 CC buttons to control Stomp boxes A-D & X. (These will mainly be used for boosts/EQs and not used that frequently as all FX needed are programmed into the PCs instead!)


    I'd also like to keep a tuner in the loop which can be engaged at any time (In an ideal world, I'll have the 3 light Kemper tuner always on display above this button - But that's low on the priority list)
    Finally, a tap tempo button, with the LED constantly blinking the current tap tempo attached.


    No banks, No expression, No Loops.. All quite simple.


    [Blocked Image: https://farm1.staticflickr.com/911/40867950524_e688a3beaf_k.jpg]


    I've been downloading any templates I can and I have searched the forums extensively.. However, the ones I've seen are way too detailed and I quickly get lost in the code as I have no need for banks, loops etc.


    Does anyone have a basic script I can start with? Happy to throw someone a couple of quid to give me a hand scripting it if needed.
    I've purchased a Arduino Mega board (I bought this to give me enough inputs/outputs for 20 live switches). I may decide to extend to a screen/loops/banks down the line so wanted to have the base infrastructure in place to do this if I desired.


    I also have ordered an alloy case and all appropriate switches & LED to start my board - It's the scripting and programming side I'm a bit put off by... I'll keep everyone posted on my progress.


    Looking forward to getting this all together! Thanks in advance for any help!
    Gaz. :thumbup:

  • Hi Gaz, I'm sure you know this but just in case, you can use a shift register for the LEDs and a simple 4X5 matrix for the switches, so you probably don't really need a Mega...but if you have the space...why not!
    One benefit of using a Mega though is that it has 4 UARTS so you can use hardware MIDI and the MIDI library.
    I used SoftwareSerial for my MIDI comms, which is fast enough for this kind of application, but you do need to write your own MIDI routines.


    Giz

  • Sending midi commands to control the KPA is one thing. Getting some data back is a bigger job.
    I'd suggest by starting with a one-way setup- getting your controller to send midi-commands to the KPA to do as you want.
    This can be as simple as program and CC commands and the hardware for a midi-out on the Arduino is relatively simple.


    Once you're happy with that you can go "deep" and get your midi-controller to "ask" the KPA for values.
    Firstly, you will have to build the hardware using a midi input, which should include an opto-isolator.
    You need to do most of this with sysex requests and the Arduino MIDI library is a useful add-on (you can easily get away with not having to use this add-on library for a one-way controller) There's quite a bit of learning along the way!


    Its one of those projects that is fun to get stuck into but the deeper you get you may question if you've jumped down a rabbit-hole.


    One thing i would suggest is that if you are wanting a controller to gig with asap it might be quicker and less risky to get an "off the shelf" unit.
    However, i understand the satisfaction from building your own. A bit like why mountain climbers climb mountains- because they're there.

  • Sage advice Slateboy.


    Also, if you haven'y already, get your self a good MIDI monitor app. If you're a Mac user, midipipe, midi monitor, or MIDI Tools are three that really help you see what's going on.

  • Also, if you haven'y already, get your self a good MIDI monitor app. If you're a Mac user, midipipe, midi monitor, or MIDI Tools are three that really help you see what's going on.

    Wise words, also from @Gizmo


    midi ox is still an awesome tool for testing, reading, all midi and even sending your sysex data to/from to make sure you have the right midi data going back and forth. see http://www.midiox.com
    a good midi understanding is a definitely a prerequisite.


    The serial monitor is pretty indispensable for displaying bits, especially sysex data.
    During development, i display confirmation dialogs so i can see what's happening inside the arduino, plus most sysex, on the serial monitor (PC arduino IDE) but the downside is that this slows down performance considerably and i cant show more than 4 or 5 sysex messages received in one hit. (might be too much for whatever buffer is holding the data or just to laggy) So it makes sense to break it up into bite-size sections and get it working piece by piece and build it up like a house, brick by brick.


    Its a big task that would put most people off but there's something perversely satisfying knowing that you've hacked into the brains and guts of the KPA (In the sense of technical achievement, not in a malicious way, in case the admins are reading! :rolleyes:

  • If you are not new to programming and you want flexibility, consider use Eclipse IDE for your development and not just the basic Arduino IDE.


    I've used it for over 3 years now and would never go back to the limited Arduino app.


    I takes a bit of setting up and a learning curve, but well worth it in the long run.
    A very clever guy has done most of the handwork here:


    http://eclipse.baeyens.it


    However if you haven't done much programming yet, then definitely start off with the Arduino app.

  • @Gizmo, is the eclipse ide anything like sublime, do you know?


  • @Gizmo, is the eclipse ide anything like sublime, do you know?

    I use Sublime sometimes as just an editor when i want to quickly look at some source code without launching Eclipse. I haven't linked it with any tools.


    Eclipse is a full featured pro level development environment (free). It has been "merged/modified" with the Arduino side to work REALLY well for Arduino code.


    If you haven't tried it yet Slate, you owe it to yourself to give it a go.
    Start with this link . eclipse.baeyens.it
    You have to dig around a little but it's all there.


    Available for both Mac OSX and Windows OS.


    You can "merge" it yourself (I haven't and wouldn't) or download it as a ready "merged" app. Very customizable.


    GREAT STUFF!


    I tried posting a screenshot here, but can't seem to figure that out duh!


    Here's a link to the Eclipse home page (not the Arduino version)


    https://www.eclipse.org/ide/

  • Hello gazhimself


    maybe it's a good idea to watch some youtube videos.
    I used a Arduino Nano for a very small controller.
    check out this videos
    the basics : https://goo.gl/BqJx2r


    also from the group member basaran
    source code for Kemper




    I don't use single LED (you need to much ports and multiplexers) it's easier to us this serial LED there is also a ready to use Arduino lib.
    Display : Nextion HMI TFT LCD Display

  • Thanks guys for all your input. I'll get hold of the software and try getting some basic commands working ASAP then look to develop further.
    I do have an FCB1010 that I can use the with the Kemper at the moment, I had looked at re-housing that as another shorter-term project but I'm leaning towards keeping the FCB1010 as stock and using it until I've got my custom build together in a position to gig with.

    Jack of all trades, master of none.


    PRS Custom 24
    Kemper Rack
    Marshall 1960b

  • Prepare yourself if you look at Basaran's code.
    There are some interesting routines there but it is quite complex and unfortunately not commented.


    I've found that it is really challenging to even understand code that I wrote myself just a couple of years ago if I didn't comment it well.


    mschmitt63 ......those LEDs are way cool!

  • Great stuff which could save hours of typing.


    Still no way to simply request current program number (which will give you performance and slot number)...at least that I can see,

  • Great stuff which could save hours of typing.


    Still no way to simply request current program number (which will give you performance and slot number)...at least that I can see,

    Hi Gizmo


    I think it's CC47 (0xB0 0x2F 0x
    see Midi Parameter Documentation Page 3/4/5.



    Responses
    With firmware 2.3.0, the profiler, if in performance mode, will send back the current performance number via CC47 and the appropriate slot selection. Example:
    Table 2: Example communication for performance mode Preselection


    Floorboard (or another Client) Kemper Profiler
    B0 2F 03 Shows preselected performance 4
    B0 31 00 Shows preselected performance 5
    B0 2F 04
    B0 35 01 Selects and loads Performance 5, Slot 3
    B0 35 01
  • Thanks @mschmitt63


    I'v looked at that and always assumed that it was something to do with performance preselection.... maybe I should have paid more attention.


    I'll give it a go and see what I get...I might owe u a beer!!


    Ah yes , I remember that table now. Made absolutely no sense to me and all I ended up achieving is selecting some performance that was greyed out until I selected a slot number.


    The performance and slot number are amalgamated into 1 number...the program number, which is calculated by ((perf*5) +slot).
    I only want to query for just this number...here's why...


    My board only selects slots, not performances. During a gig I sometimes manually select a different performance/slot directly on the KPA. I want to get this new number to keep my board in synch.


    @gazhimself sorry mate, not trying to hijack your thread.

    Edited once, last by Gizmo ().

  • Not At all...


    All information is getting read through and I’m sure will be useful down the line.


    Still building the breadboard and starting to look at a very basic script to get me started. The plan is to have the 15 buttons call up the first 15 profile in performance mode (slot 1-3)


    Once I have this working I can get to work getting the LED and such working as i’d like. I’ve never done any coding (or anything like this) so it’s a slow process, but I’ll get there.


    Keep the conversation flowing. Again, if anyone has any very basic scripts they’re happy to share, I’m all ears. So far, I’m getting lost in the multiple pages/scripts as most are adding banks and LCD Panels that I don’t require.


    Thanks!

    Jack of all trades, master of none.


    PRS Custom 24
    Kemper Rack
    Marshall 1960b