Jump to content
stoo

Build your own MIDI controller. (I did!)

Recommended Posts

17 minutes ago, stoo said:

It's something I did look into - my first arduino project was an LED lighting controller for my van with 420 addressable LEDs around the ceiling. Slight overkill, but hey-ho :D

The HX Stomp has got LED rings around each footswitch which change colour depending on effect type and brightness depending on it's enabled or not...  but it doesn't send much information out on MIDI for the controller to know what's going on.... I suppose you could manually program the controller with settings for each preset and then update the LED behaviour depending on the last Program Change, but that seems like a lot of work programming in dozens of presets worth of config into the controller, and having to keep them updated whenever I make changes on the Stomp.

I think all the other Helix models have got a MIDI command centre which allows you trigger various MIDI messages on all sorts of various conditions..... but if I'd got one of the bigger Helix models then I wouldn't need the MIDI controller in the first place! 

Ah true. Is there a MIDI implementation chart? As you say though, no feedback to acknowledge program change.

Share this post


Link to post
Share on other sites
17 minutes ago, EBS_freak said:

Ah true. Is there a MIDI implementation chart? As you say though, no feedback to acknowledge program change.

Yeah - they've published it all, but - for the HX stomp at least - it's pretty much all one way. When the preset is changed it does send out a PC message to confirm it, but that's only any use if your midi controller knows the initial state of that preset, which FS each block is assigned to, whether it starts on or off, what type of effect is in that block etc etc.

With the old Zoom stuff it was totally the other way round - they sent out a Sysex message with all the info in it that you could ever need, but the data format was deliberately obfuscated and there was no documentation on it at all, so you end up spending ages with MIDI sniffers trying to work out what the hell was going on.... and it was slightly different for each Zoom pedal, so the work someone else had done wouldn't necessarily work on yours.

Not to worry though - my controller's at the point where I'm not too bothered about doing anything else with it for a while.... Functionality-wise it's doing everything I need it to. Might tweak the preset pages here and there, but other than that I'm OK with it. I'm not very happy with the enclosure, but it's not bad enough that it's worth printing another one. 

 

Share this post


Link to post
Share on other sites
On 20/01/2020 at 18:04, stoo said:

Hiya,

I'd never really thought about whether the code Nextion version could fit on a Nano before... it would definitely need some optimisation but it might be do-able... couldn't say for sure without trying it though!

When I did the OLED + Nano version, I remember the main limitation was RAM. One thing that helped a lot was making sure all the char array text strings were set to use PROGMEM using the F() macro. I know I didn't bother doing that on the Nextion version because the RAM was plentiful enough it just wasn't worth it.

Some other things you'll need to take into consideration with Nano : 

Nano only has one Serial... the MIDI port needs one, and so does the Nextion. You should be able to create a SoftwareSerial port on the Nano, but it's not something I've done. The Arduino IDE also uses Serial to upload new sketches to the Nano... so you may find you need to disconnect your MIDI devices or the Nextion (whichever you have plugged into the hardware serial port on the nano) when you upload a new sketch. 

Power - I was able to power the Nextion from the 5v pin on the Mega, but I'm not sure how much power the power regulator on the Nano can supply safely. If you're running from USB power, it might be a good idea to power the Nextion using the microUSB adapter that should come with your screen, and then power the Nano from the spare pins on the back of that adaptor.

I'm not totally sure what you mean by the "final .ino file".... I had all those files saved separately, and they should appear as different tabs in the Arduino IDE. When it compiles it should work through them in the order the tabs appear in the IDE. Having the different parts of code split into separate tabs made it a bit easier to find stuff as I was going along. I've attached a screenshot so you can see what I mean.

The single_double_long file can be ignored.... it's just a flowchart I was using to plan out the code for single press / long press / double click / multiple switch press functionality and track which bits I'd implemented. You can open it with a free program called yEd if you want to see what's in it, but other than that you can ignore it.

You could get rid of the Booting page on the Nextion if you wanted - there's probably a few other pages in the Nextion HMI file that aren't needed too. It won't hurt to leave them on there though - deleting unused pages on the Nextion memory won't free up any memory on the Nano. Be wary though - if you delete things in the Nextion editor, it can end up automatically renumbering other items with a higher ID#.

Hope that helps....!

 

tabs.png

Rather than a Nano what about one of the Teensy line - even Teensy LC has twice the memory of the Nano.

I’ve built a basic 4 button foot switch using a Teensy LC board which will do MIDI via 5 pin DIN connector and USB MIDI in parallel, so I can use it on either my Stomp or with AmpliTube on my Mac.

I’ve now gone a step further and used a Raspberry Pi to give me USB MIDI thru so I can use USB on the Stomp instead.  Target is to build a second MIDI controller to give me the amp EQ and volume controls in a controller on top of my amp so I can tweak easily during a gig.  

 

 

Share this post


Link to post
Share on other sites

@stoo - how many pins are you utilising at the moment? Was thinking about projecty stuff last night whilst driving. ESP8266 may give you the option of a web based editor which may be easier for bulk configuration... meaning that touch screen could be for just on the gig changes. Mind you, if you've got your phone with you...

Share this post


Link to post
Share on other sites
3 minutes ago, EBS_freak said:

@stoo - how many pins are you utilising at the moment? Was thinking about projecty stuff last night whilst driving. ESP8266 may give you the option of a web based editor which may be easier for bulk configuration... meaning that touch screen could be for just on the gig changes. Mind you, if you've got your phone with you...

8 for the footswitches

2 for the nextion TX/RX

1 for the midi TX

1 for the pedal pot

1 for the pedal toeswitch

Funnily enough, I've just about finished up a completely unrelated project with a Wemos D1 Mini in it... Not enough pins available on those, but I think the bigger D1R2 might just be able to squeak it..... hmmmm

3 hours ago, Gottastopbuyinggear said:

Rather than a Nano what about one of the Teensy line - even Teensy LC has twice the memory of the Nano.

I’ve built a basic 4 button foot switch using a Teensy LC board which will do MIDI via 5 pin DIN connector and USB MIDI in parallel, so I can use it on either my Stomp or with AmpliTube on my Mac.

I’ve now gone a step further and used a Raspberry Pi to give me USB MIDI thru so I can use USB on the Stomp instead.  Target is to build a second MIDI controller to give me the amp EQ and volume controls in a controller on top of my amp so I can tweak easily during a gig.  

 

 

The Teensy stuff looks like a good shout for USB MIDI with minimal hassle... Would need to be sure the display was OK with running on 3.3V or you'd have to add in a level converter to the plan somewhere.

I love the idea of having a physical amp controls module though.... Have you got any more detail on your build posted up anywhere? 

Share this post


Link to post
Share on other sites
1 hour ago, stoo said:

8 for the footswitches

2 for the nextion TX/RX

1 for the midi TX

1 for the pedal pot

1 for the pedal toeswitch

Funnily enough, I've just about finished up a completely unrelated project with a Wemos D1 Mini in it... Not enough pins available on those, but I think the bigger D1R2 might just be able to squeak it..... hmmmm

The Teensy stuff looks like a good shout for USB MIDI with minimal hassle... Would need to be sure the display was OK with running on 3.3V or you'd have to add in a level converter to the plan somewhere.

I love the idea of having a physical amp controls module though.... Have you got any more detail on your build posted up anywhere? 

Wemos D1 is my go to board for most things, just wish they'd come out with a 5Ghz version!

Share this post


Link to post
Share on other sites
2 hours ago, stoo said:

I love the idea of having a physical amp controls module though.... Have you got any more detail on your build posted up anywhere? 

No, afraid not.  Partly because it isn't built yet, and mainly because I'm awful at documenting stuff.  I'd be embarrassed about my shonky code too!

I have been doing a bit of tinkering, however, and I'm fairly certain I've variously got everything working that I need.  It's a case of sticking it all together to see if it works.  I should make an effort to document it properly.

Broadly speaking I'm thinking along these lines:

The requirement is to be able to use a few different programs on the Stomp in a gig situation - basically amp sims, compression, and very occasionally perhaps some chorus.  I'm putting the Stomp straight into a power amp, so I'd like to be able to tweak the EQ during a gig to account for venue to venue sound differences.  Ideally that would be via MIDI control of the global EQ, but alas that's not currently an option, so it's going to have to be via the amp's EQs.  I'm also going to experiment with the Tilt EQ block a bit, to see if that helps with on-the-fly EQ tweaks.

I think I can get everything for the "head" end on a 2U rack blanking plate, though I haven't confirmed yet.  I'll probably stick in 10 rotary encoders which should give me more than enough for my needs.  Nextion display for seeing the settings, and maybe for saving changes.  

I'll have to store all the parameters I'm changing in non-volatile memory and send them every time I change the program.  

I've already built a footswitch as a proof of concept to give me prog up and prog down, tuner (so I can get that off the Stomp's third foot switch) and a quick way of switching between 0 gain and +20dB on the output block so that I can get enough signal into the power amp when I'm using it.  It's occurred to me that I could also put Tilt or even Bass/Mid/Treble adjustment on the footswitch too, but that might be going too far.

I didn't really want a ring of MIDI cables between Stomp, "head", and footswitch so that's why I looked into the MIDI thru idea, and as with everything (thankfully!) I found someone has already done it.  I'll dig out the links later and post them in this thread.

My main concern at the moment is whether I run the risk of introducing noise with all this hacked together DIY microcontroller based stuff floating around!

Edit: Forgot to say, the Teensy 3.3v pins seem fine with the Nextion with the quick tinker I've had.

Time is the real killer with all this.  Having jumped onto the Nextion learning curve I'm now on a Photoshop learning curve, trying to see whether I can get some reasonable graphics together for visual feedback for volume and tone controls, etc.

I'd really like to get a 3D printer too, to make some decent enclosures for some of my projects, but apart from the cost of getting a reasonable one (I haven't got the patience to go the budget put-it-together-first route) but that's another huge learning curve.
 

 

Edited by Gottastopbuyinggear

Share this post


Link to post
Share on other sites
On 09/12/2019 at 19:11, stoo said:

Yeah - It's a big improvement over the 0.96"OLED, that's for sure... thanks again for the tipoff!

Although with the tiny OLED at least there was no danger I'd put my foot through it!

Slowly getting there......

IMG_20191209_182116.jpg

I’m thinking hard about getting a 3D printer.  @stoo, what material did you use for the case - I’m wondering whether PLA would be strong enough or whether it would have to be ABS?

Share this post


Link to post
Share on other sites
17 minutes ago, Gottastopbuyinggear said:

I’m thinking hard about getting a 3D printer.  @stoo, what material did you use for the case - I’m wondering whether PLA would be strong enough or whether it would have to be ABS?

The first one I did with the tiny screen was done in PLA. The v2 is PETG for the main enclosure, with PLA for the bezel and bottom cover. I tend to be fairly generous with wall widths / perimeter and top and bottom layer count, but both enclosures are way stronger than they need to be. If I hadn't had to split them into multiple sections to fit on the build plate of my printer, they'd have been stronger still.

Maybe I could have got away with using less material if I'd used ABS or nylon, but I can't be bothered building an enclosure for my printers. 

I'm going to get some ASA filament next time to try next time I make an order... From what I can gather it's similar to ABS, but less hassle to print. Mainly for increased UV resistance... Which isn't really a massive concern for the footswitch enclosure!

Share this post


Link to post
Share on other sites

Okay, so here's the prototype for the rack mounted Stomp parameter controller I said I was planning.

IMG_0390.thumb.jpeg.d66cf057ae4ca23938b7e73631c45aeb.jpeg

What I have here is the parameter controller and a foot controller sending MIDI over USB, and a Raspberry Pi running as a USB MIDI Thru box linking everything, including the Stomp, together.

Parameter controller and foot controller are based on a Teensy boards which provide easy USB MIDI capabilities.  Teensy LC currently used, but the parameter controller needs a Teensy 3.2 to provide enough RAM to allow me to support multiple Stomp programs as I've currently run out of memory for the arrays of strings I need for the "labels" for the parameters.  I could work out a more efficient way of doing it, but I think it would still be marginal as there are a few more improvements I could make.

The parameter controller uses rotary encoders to change the values of the Stomp parameters I want to control.  For each Stomp program I have one page for the Amp parameters (typically Gain, Bass, Mids, Treble, Master Volume and Channel Volume) and one for a single stomp, so usually an overdrive.  I've also put a Tilt block in each Stomp program and that's accessible on the Amp page so that I can try making quick overall changes on the fly with one button, or perhaps link that to switches on the foot controller.  Display is via a Nextion, and that also supports buttons for swapping between Amp and Stomp pages, saving of the current parameter settings, or reset of the current settings to those saved.

On power up the controller reads in all parameters from EEPROM, and sends them to the HX Stomp for the currently selected program.  Changing a parameter immediately changes the value on the Stomp, but nothing is "saved" until you explicitly select "Save", whereupon the values are stored permanently on EEPROM.  Obviously when I say save I mean saved in the controller, not the Stomp.  Changing the program on the stomp results in the current in-memory parameter set for the program being sent to the Stomp.  In this way I can tweak the parameters and change back and forth between programs without losing the changes I've made.  If I want to discard the changes I can use "Reset" to replace them with the set stored on EEPROM.

The foot controller is pretty basic at the moment - I've set it to give me tuner on the lower left, program up and down on the right, and the top left toggles a 20dB boost on and off for when I want to use the Stomp to drive a power amp.  I'm planning to replace this with a six switch version with another Nextion display to show what each switch is doing.  

The code all needs some work, and is pretty amateur (monolithic, global variables, etc.), but it's been 25 years since I did any coding in any serious capacity and I've forgotten almost everything I ever knew!

Raspberry Pi MIDI Thru from here: https://neuma.studio/rpi-as-midi-host.html

I used a more recent set of instructions for making the Pi read-only: https://medium.com/@andreas.schallwig/how-to-make-your-raspberry-pi-file-system-read-only-raspbian-stretch-80c0f7be7353

Next steps are the rack mount version and a 3d printed box for the larger foot controller - but that's going to be a while yet.
 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.



×
×
  • Create New...