Jump to content
stoo

Build your own MIDI controller. (I did!)

Recommended Posts

On 24/11/2019 at 15:31, stoo said:

The main differences from the last one are most obviously the Nextion touchscreen (as recommended by @EBS_freak ) and expression pedal input.

I’d not come across Nextion before, but I’ve done some reading and ordered a 3.2 inch version to have a play with over Christmas, hopefully.

I also have a MIDI controller for the HX Stomp in mind, but for controlling EQ during a gig so that I don’t have to bend down and start messing around with the controls on the stomp itself.  It’s a pity the global EQ isn’t controllable via MIDI.

Share this post


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

You could get away with very little soldering, but I don't think you could avoid it totally...

For what you're describing, you wouldn't need to make a circuit board - you could just get a screw terminal IO shield for the Arduino - something like this one - https://www.amazon.co.uk/gp/product/B01LOMZCSW

That said, the footswitches and MIDI socket are very unlikely to come with wires already attached, and you'll also need to find a way to get the resistor connected between your Arduino 5V output and the MIDI socket 5V input...

Soldering wires to the tags on the footswitches and MIDI socket is about as easy as it gets for soldering - poke the wire through the hole, bend the wire at the tag so it holds itself in place,  rest the solder on the bare wire and then melt it with the iron. 

The resistor is a little more tricky as you end up needing 4 hands to hold the wire, the resistor, the solder and the iron. You can get a gadget to make that easier  - the one I've got is this one -

https://www.amazon.co.uk/Silverline-633830-Helping-Magnifying-Workpiece/dp/B000O3RJFC/ref=sr_1_5?crid=AO13L9JCRYXD&keywords=helping+hand&qid=1575844763&sprefix=helping+ha%2Caps%2C152&sr=8-5 

It's not great, but not much point spending more if this is likely to be a one off project.

 

One possible alternative to the soldering iron might be solder seal heatshrink connectors... I've not used them personally, but saw them used in a youtube vid a while back. You'd still need a hot air gun or mini gas torch though.... (I presume you wouldn't be able to just use a fag lighter like you can with normal heatshrink?)

https://www.amazon.co.uk/Connectors-Waterproof-Connector-Electrical-Retardant/dp/B07QZZM4GQ/ref=sr_1_3_sspa?keywords=solder+heat+shrink&qid=1575844168&sr=8-3-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEzNVRRRlBSSU5JUjRDJmVuY3J5cHRlZElkPUEwMjMyNTc1RUM3SVNQMUxKTTJSJmVuY3J5cHRlZEFkSWQ9QTAyNjk5OTYxNUxITkwzM1M2Wk01JndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

I think they'd be fine for the resistor, but might not work for the footswitch / midi socket tags. You could trim one end of the heatshrink down a bit so the solder is near the end and then slide that over the tag (assuming it'd fit) but whether it would shrink enough to seal a flat tag well.... I just don't know.

 

You can definitely use a normal 9V pedal power supply instead of USB if you prefer.... Just add a suitable socket to the VIN and GND pins on the Arduino and it'll run off anything between 7 and 12V DC. I've been using these - https://www.amazon.co.uk/gp/product/B00O9YT6MG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 and they seem to work OK.... Again, needs soldering though.

 

One possible alternative I've just thought of would be to use a larger format arduino like a Uno which can accept shield adaptors... 

Something like this - https://www.amazon.co.uk/Ocamo-Musical-Breakout-Instrument-Interface/dp/B07Z7LJ3K4/ref=sr_1_7?keywords=arduino%2Bmidi%2Bshield&qid=1575846038&sr=8-7&th=1

would piggyback on top of the Arduino Uno and save you some work. As an added bonus, the Uno comes with a DC power socket already on the board so you'd pretty much just be soldering the footswitch wires... aaah no hang on... just seen in the description of that MIDI shield that it comes with the MIDI connectors unsoldered. Bummer!

 

Thanks @stoo, that’s all really helpful info. I think I need to come to terms with the fact that I need to do some soldering! Thank you for sharing your knowledge, it's much appreciated. 

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, Gottastopbuyinggear said:

32?!   I have enough trouble with 8...

F9A89960-DAD7-44E3-BE0E-1189B4863D38.thumb.jpeg.91a105b624604f02c6a136a3934609f5.jpeg

Raspberry Pi running QLC+, Teensy board for the footswitches and code to send MIDI over USB to QLC.  Only running 4 RGB lights from it, with a few sets of fades and chases set up in QLC, either free running with tap tempo, or set to change when hitting the tap button.

What I really need now is a 3D printer to make some decent cases, but the learning curve has put me off so far.

 

Yeah - a lot of it is for instant access so that you don’t have to keep scrolling through patterns. I’ve got a fair few lights on the go too (having said that, I’ve never got the luxury of time to set them up on most gigs).

I’m offloading to DMXis to do the heavy lifting rather than programming patterns directly onto the arduino - it’s a lot simpler doing it that way rather than getting the computer out to flash a chip every time you make a change. I may revisit QLC - May be easier to cart around a Pi than a computer!

Your project looks great, keep up with the development!

Share this post


Link to post
Share on other sites
11 hours ago, Gottastopbuyinggear said:

I’d not come across Nextion before, but I’ve done some reading and ordered a 3.2 inch version to have a play with over Christmas, hopefully.

I also have a MIDI controller for the HX Stomp in mind, but for controlling EQ during a gig so that I don’t have to bend down and start messing around with the controls on the stomp itself.  It’s a pity the global EQ isn’t controllable via MIDI.

The Nextion is great - it enables some really pretty UIs that would be otherwise be beyond the realms of the lowly arduino. The Windows software is a bit ugh... but stick with it. Once you have defined your screens and you are back into just targeting changes via the Arduino, it’s pretty slick... and certainly gives the impression that your project is more pro.

The touchscreen isn’t amazing by modern standards - don’t expect the feel of a modern mobile phone... but for simple presses and the like, it’s very, very effective.

Share this post


Link to post
Share on other sites
4 hours ago, EBS_freak said:

Yeah - a lot of it is for instant access so that you don’t have to keep scrolling through patterns. I’ve got a fair few lights on the go too (having said that, I’ve never got the luxury of time to set them up on most gigs).

I’m offloading to DMXis to do the heavy lifting rather than programming patterns directly onto the arduino - it’s a lot simpler doing it that way rather than getting the computer out to flash a chip every time you make a change. I may revisit QLC - May be easier to cart around a Pi than a computer!

Your project looks great, keep up with the development!

QLC is doing the sequencing - the arduino is just triggering either sequences or scenes via MIDI, and doing tap tempo via MIDI.  For someone who hadn't even heard of DMX before I found QLC fairly easy to get to grips with for basic stuff.

To be honest I've only used this a couple of times this year.  Quite a lot of pubs have their own lights, and it's just another thing to set up and pack away afterwards, plus I'm already doing most of the work with the PA (we're long overdue a chat to address the fact that some of the band are a bit shy when it comes to helping with setting up anything other than their own gear).  Having said that, even with four RGB lights I think we can create a much better (and infinitely more subtle) effect than with the standard pub fayre of random over the top patterns changing every second.

4 hours ago, EBS_freak said:

The Nextion is great - it enables some really pretty UIs that would be otherwise be beyond the realms of the lowly arduino. The Windows software is a bit ugh... but stick with it. Once you have defined your screens and you are back into just targeting changes via the Arduino, it’s pretty slick... and certainly gives the impression that your project is more pro.

The touchscreen isn’t amazing by modern standards - don’t expect the feel of a modern mobile phone... but for simple presses and the like, it’s very, very effective.

I saw that they were resistive touch so have an idea what to expect.  I'm planning to use rotary encoders for setting values, so it's probably only on/off switches and navigation buttons I'd use touch for.

Any suggestions for good resources for getting started with configuring the device?

Share this post


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

QLC is doing the sequencing - the arduino is just triggering either sequences or scenes via MIDI, and doing tap tempo via MIDI.  For someone who hadn't even heard of DMX before I found QLC fairly easy to get to grips with for basic stuff.

To be honest I've only used this a couple of times this year.  Quite a lot of pubs have their own lights, and it's just another thing to set up and pack away afterwards, plus I'm already doing most of the work with the PA (we're long overdue a chat to address the fact that some of the band are a bit shy when it comes to helping with setting up anything other than their own gear).  Having said that, even with four RGB lights I think we can create a much better (and infinitely more subtle) effect than with the standard pub fayre of random over the top patterns changing every second.

I saw that they were resistive touch so have an idea what to expect.  I'm planning to use rotary encoders for setting values, so it's probably only on/off switches and navigation buttons I'd use touch for.

Any suggestions for good resources for getting started with configuring the device?

Yeah - you're doing the same with QLC with what I'm doing with DMXis. When I started, I was sequencing all within the Arduino... but then timing based stuff begins to get quite difficult, especially when trying to factor in multiple fades, moving heads etc... and as you probably know, arduino being procedural based, makes it quite difficult to get things to do different things at the same time... whilst keeping code manageable.

You hit the nail on the head - automatic lights are pretty vomit inducing. Slow fades, black outs... even the odd retina burn is defo more classy.

Rotary encoders are nice feature... the only downside, is that you are using I/O pins. Depending what you want to achieve and how often you need to achieve it... and depending how many stomp buttons and I/O you have, the Nextion is manageable.

As far as Nextion tutorials are concerned, I found this guy's to be pretty comprehensive - check out InterlinkKnight on YouTube.

Here's the first in the series. Work through them and you should be alright.

 

Share this post


Link to post
Share on other sites

Must admit without some pointers, the Nextion can be a bit of a beast as I didn't find it immediately intuitive.

And then when I'd got to grips with it - with many hours of frustration, I found this series of tutorials. Sod's law.

Share this post


Link to post
Share on other sites

For my first go at it, I followed through his tutorial - https://nextion.ca/portfolio-items/nextion-iteadlib-and-mega-step-by-step/ which covered enough of the basics to adapt into whatever I needed. I tend to prefer text guides over videos for the step-by-step stuff though. https://github.com/itead/ITEADLIB_Arduino_Nextion/tree/master/examples was handy too..

If you're using a Nano rather than a Mega you'll have to bear in mind that the Serial situation will be different - presumably you'd need to set up a softwareserial instance, or have a quick way of disconnecting the nextion screen serial from the TX/RX pins while you're uploading sketches.

Also not sure if a nano can power the screen directly... the Mega has enough spare juice that it's OK to hook it to the 5v pin, but I suspect the power circuitry in a nano is a bit different...

Share this post


Link to post
Share on other sites

Hey Stoo - how are you powering your setup? Are you doing a 9v off a pedal board and dropping it down to 5v?

Ah just read back and reminded myself. You're coming off USB power. Do you use external power - or would you consider a daisy chain split off your Stomp power.

Let me quickly draw you something up.

Edited by EBS_freak

Share this post


Link to post
Share on other sites
Just now, EBS_freak said:

Hey Stoo - how are you powering your setup? Are you doing a 9v off a pedal board and dropping it down to 5v?

I'm extending the Mega's USB and barrel jacks to the rear panel so it can either run from a USB charger or power bank, or a pedal power supply into the barrel jack... Mega can cope with 7-12V input so I'm expecting it to be OK.... although I haven't actually tested it yet.... Maybe I should.....

 

Okay - now I've tested it... Brief moment of panic when nothing fired up using the PSU from one of my Zoom pedals... tried another one.... nothing.... then checked the polarity. D'oh! Bodged up a polarity crossover cable to test and it works just fine.

Luckily I wasn't planning on having the Megas own USB port + power jack exposed anyway, so will be easy to sort when I make the cable between the Mega and the enclosure back panel.

Share this post


Link to post
Share on other sites

7805 regulator with a couple of caps will drop your voltage so you can run at 9v off pedal board power supply of daisy chain off stomp power supply.

37B8E89B-1FC3-415F-A600-47DE715893DF.jpeg

Share this post


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

I'm extending the Mega's USB and barrel jacks to the rear panel so it can either run from a USB charger or power bank, or a pedal power supply into the barrel jack... Mega can cope with 7-12V input so I'm expecting it to be OK.... although I haven't actually tested it yet.... Maybe I should.....

 

Okay - now I've tested it... Brief moment of panic when nothing fired up using the PSU from one of my Zoom pedals... tried another one.... nothing.... then checked the polarity. D'oh! Bodged up a polarity crossover cable to test and it works just fine.

Luckily I wasn't planning on having the Megas own USB port + power jack exposed anyway, so will be easy to sort when I make the cable between the Mega and the enclosure back panel.

Doh I’m on a slow day. Yeah forgot the Mega got onboard. Yeah - my next comment is to take into account most pedal supplies are centre negative!

Anyway, I’ll leave the above for anybody looking to drop voltage and use a standard psu for a nano (or similar)

  • Like 1

Share this post


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

Doh I’m on a slow day. Yeah forgot the Mega got onboard. Yeah - my next comment is to take into account most pedal supplies are centre negative!

Anyway, I’ll leave the above for anybody looking to drop voltage and use a standard psu for a nano (or similar)

You had me worried for a minute there.... It looks like it works.... What am I missing!?!  Is it about to blow up?! Hehe...

Share this post


Link to post
Share on other sites

Ha! That's a good point though. Whats the actual rating on the Mega in terms of powering external devices...? I guess if it doesn't stop... then jobs a goodun... I guess?

Share this post


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

Ha! That's a good point though. Whats the actual rating on the Mega in terms of powering external devices...? I guess if it doesn't stop... then jobs a goodun... I guess?

Yeah pretty much... there's a 500mA polyfuse on the USB input, and the Nextion recommends a 500mA supply. I've not measured what it actually draws from the Mega,  but my USB ammeter shows 90mA draw with just the Mega, going up to 200mA draw with the Nextion hanging off it as well..... so I'm not particularly worried.

The AMS1117 reg is supposed to be good for 1A out, so even more to play with when running via 9V... although I suppose as I'm using the barrel jack instead of Vin then the diode will steal some of that.... 

 

Share this post


Link to post
Share on other sites
On 10/12/2019 at 15:35, stoo said:

Yeah pretty much... there's a 500mA polyfuse on the USB input, and the Nextion recommends a 500mA supply. I've not measured what it actually draws from the Mega,  but my USB ammeter shows 90mA draw with just the Mega, going up to 200mA draw with the Nextion hanging off it as well..... so I'm not particularly worried.

The AMS1117 reg is supposed to be good for 1A out, so even more to play with when running via 9V... although I suppose as I'm using the barrel jack instead of Vin then the diode will steal some of that.... 

 

If you do measure, upload a pic where every pixel is illuminated white. I’m guessing that will give you an idea of real world draw - although I’m not sure what processing can be instructed to get an idea of a Nextion under load. Hmm.

Sounds like you got plenty in the bag anyway - so as you say, nothing to worry about.

In fact, I wouldn’t even bother testing it... plenty within tolerance.

Edited by EBS_freak

Share this post


Link to post
Share on other sites
On 10/09/2019 at 14:50, TheRockinRoadie said:

Thanks everyone for your replies :)

I've had a busy few weeks but will now re-visit the MIDI controller.

I have since rebuilt my Windows 8 PC with Windows 10, so will try downloading the (seemingly endless) CH340G drivers and try again.  I've also obtained another lead to check in case the lead is duff.

I've just set the enclosure up in the milling machine to drill the holes, and i'll start wiring the switches this afternoon.

Turns out my neighbour has a genuine Arduino Nano, so he's offer to loan me his if all else fails, and i'll then order a genuine one for myself.

I'll keep you all posted :)

 

 

I'm really pleased to say that mine now works - turned out i just had a dud nano!  The prototype works and i already have the enclosure built up and wired, so at the weekend i'll move the Nano into this and should be good to go!

Share this post


Link to post
Share on other sites
4 hours ago, TheRockinRoadie said:

I'm really pleased to say that mine now works - turned out i just had a dud nano!  The prototype works and i already have the enclosure built up and wired, so at the weekend i'll move the Nano into this and should be good to go!

Nice one!

Share this post


Link to post
Share on other sites

  Got this via PM, but may as well reply here in case it's of use to anyone else

46 minutes ago, themorb said:

Hi Sto

I find your project really great!!
Yes, you are right as regard the 0.96 oled display: too little.
My pedalboard was already finished (just switches and led) tillI I saw some features of yours!
Multipage and bigger screen.

My question: how did you embed the nextion display (as regard the code)  to arduino?
Cause the touchscreen I find mostly data sending Nextion>>>to>>>Arduino.
Could You help me please ?
Nice Day
 
 

Hiya,

The way I did it has data going both ways between Nextion and Arduino...

I wanted to setup the Nextion so that I didn't need to upload a new HMI file whenever I wanted to change the footswitch functions - I have the USB from the Arduino accessible from the back of my controller, but to reflash the Nextion, I would need to remove it from the unit.

So... the Arduino looks up which page it's currently set to, and then updates the labels on the Nextion to match.

Each of the footswitch labels is 2x NexText covered by 1x NexHotspot so I could have 2 lines of text acting as one button. If you only need one line of text, then a NexButton is simpler... and I used those for the Page Up / Page Down buttons.

The functions (on the Arduino) attached to each of these buttons look up which action they need to trigger depending on 

-footswitch#

-current menu page#

-press type (short/long/double)

and then sends that action to the MIDI port.

It's probably a bit of a clumsy implementation but it seems to work pretty well.

If you want to look through my code and see what I've done, it's all up at https://github.com/stoonoon/hxsMidiSwitchTouch - I haven't commented it as thoroughly as I did for the earlier version, but hopefully it'll be of use... happy to answer questions if I can.

Cheers,

Stoo

  • Thanks 1

Share this post


Link to post
Share on other sites
On 19/01/2020 at 10:50, stoo said:

  Got this via PM, but may as well reply here in case it's of use to anyone else

Hiya,

The way I did it has data going both ways between Nextion and Arduino...

I wanted to setup the Nextion so that I didn't need to upload a new HMI file whenever I wanted to change the footswitch functions - I have the USB from the Arduino accessible from the back of my controller, but to reflash the Nextion, I would need to remove it from the unit.

So... the Arduino looks up which page it's currently set to, and then updates the labels on the Nextion to match.

Each of the footswitch labels is 2x NexText covered by 1x NexHotspot so I could have 2 lines of text acting as one button. If you only need one line of text, then a NexButton is simpler... and I used those for the Page Up / Page Down buttons.

The functions (on the Arduino) attached to each of these buttons look up which action they need to trigger depending on 

-footswitch#

-current menu page#

-press type (short/long/double)

and then sends that action to the MIDI port.

It's probably a bit of a clumsy implementation but it seems to work pretty well.

If you want to look through my code and see what I've done, it's all up at https://github.com/stoonoon/hxsMidiSwitchTouch - I haven't commented it as thoroughly as I did for the earlier version, but hopefully it'll be of use... happy to answer questions if I can.

Cheers,

Stoo

Hi Stoo 
I didn't check you swap to arduino mega. Now the challenge :
Do you belive it is possible to realize this controller fitting your code on Nano ( with Nextion but without Expression Pedal)?

The final .ino file :Just  copying and pasting ....: 01_includes 02_globals (in this order)? I get a lot of errors (simulating a Mega board)

What about single_double_long file? Do I past it into the ino?

What about the booting page on nextion?

Thx for your time

Edited by themorb

Share this post


Link to post
Share on other sites
10 minutes ago, themorb said:

Hi Stoo 
I didn't check you swap to arduino mega. Now the challenge :
Do you belive it is possible to realize this controller fitting your code on Nano ( with Nextion but without Expression Pedal)?

The final .ino file :Just  copying and pasting ....: 01_includes 02_globals (in this order)? I get a lot of errors (simulating a Mega board)

What about single_double_long file? Do I past it into the ino?

What about the booting page on nextion?

Thx for your time

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

Share this post


Link to post
Share on other sites

Hey @stoo - was thinking about this project again thinking about easy to implement small little improvements. Playing with my Kemper, (which annoys me due to the lack of scribble strips on the foot pedal) I thought... aha, you could assign LED colours/state colours (maybe for FX type etc) using ws2812b pixels - at a cost of only one pin because the strip is addressable. Cheap, easy to implement... and if you are going down the programmable route anyway, gives you an easy at a glance colour coded status.

Anyway, just a thought. There's plenty of pixel libraries out there which would get you up and running in minutes. 

Share this post


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

Hey @stoo - was thinking about this project again thinking about easy to implement small little improvements. Playing with my Kemper, (which annoys me due to the lack of scribble strips on the foot pedal) I thought... aha, you could assign LED colours/state colours (maybe for FX type etc) using ws2812b pixels - at a cost of only one pin because the strip is addressable. Cheap, easy to implement... and if you are going down the programmable route anyway, gives you an easy at a glance colour coded status.

Anyway, just a thought. There's plenty of pixel libraries out there which would get you up and running in minutes. 

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! 

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...