Can I use an arduino mini to make a simple midi controller?

Bricksnbeatles

Member known well
I’m looking to make something to control my bass whammy similar to a molten voltage “one trick pony” but a little bit different.
It would have two momentary footswitches which would select the midi program change commands in four groupings of program change commands: Bank 1 (1-21), Bank 2 (22-42), Bank 3 (43-63), and Bank 4 (64-84)

Footswitch 1Footswitch 2
Clickscroll down in bankScroll up in bank
Hold (3 sec)toggle between banks 1+2 & banks 3+4toggle between banks 1&2 or between banks 3&4

It seems like an arduino mini would be capable of doing this, but before i start diving down the arduino rabbit hole I want to see if any of you have thoughts on A) if this is something that can be done with an arduino and B) is the Arduino mini is powerful enough for this sort of thing (I would assume so— it doesn’t seem like it would be too intensive to run)

Otherwise what else might be worth looking into to start learning how to do this? I’ve heard of arduino alternatives that may be more or less capable of this, but I don’t know their names or how they differ from arduino.

I’m sure I could learn to program this relatively easily once I know if the hardware is capable of that.
 
Arduino is definitely capable, and you could take your end result to a standalone ATMEGA328P microcontroller without the need for the rest of the module.

I'm pretty sure at least one of the Jackson Audio pedals uses an Arduino Nano for the MIDI capability.

 
I hadn’t even thought of the possibility of not needing the full arduino board in the box— putting the end result on a smaller purpose-designed board with an atmega238 would certainly offer a great space saving.
I guess now I just need to order the arduino stuff and get to learning!
 
I hadn’t even thought of the possibility of not needing the full arduino board in the box— putting the end result on a smaller purpose-designed board with an atmega238 would certainly offer a great space saving.
I guess now I just need to order the arduino stuff and get to learning!
Tayda has a few options for Arduino boards fyi
 
Hell you could probably even nail it down with a just an attiny85 (edit: from a quick search thatseems super difficult but not impossible).

A nano (or just your own board for a 328p) would be more than enough.

Here's a short/long press tutorial:

 
Last edited:
Hell you could probably even nail it down with a just an attiny85 (edit: from a quick search thatseems super difficult but not impossible).

A nano (or just your own board for a 328p) would be more than enough.

Here's a short/long press tutorial:

Yeah, the attiny85 seemed to not be capable of everything I’d need of it, but the 328p is more than powerful enough.
Thanks for the tutorial!
 
In this case, I could use an arduino uno instead (which would probably be better for future experimentation with) for the prototyping before putting in on a board I design to accommodate a 328p, right? As I understand, theres nothing the nano/mini can do that the uno can’t also do— they’re just simplified for cost/size compared to the uno, right?
 
In this case, I could use an arduino uno instead (which would probably be better for future experimentation with) for the prototyping before putting in on a board I design to accommodate a 328p, right? As I understand, theres nothing the nano/mini can do that the uno can’t also do— they’re just simplified for cost/size compared to the uno, right?

The one nice advantage the uno has is that you can use it to program an atmega328p and then take it out of the arduino. You can technically program an external one with a nano as well (http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/) but it’s not as easy as popping the IC out.
 
Just picked up an uno that should be here on Thursday. I’ll start messing around with that, but I think I should be able to use an attiny84, as I’ve figured out that the molten voltage one trick pony modules simply use a flashed attiny85, a pair of resistors, and a cap. the only thing that seems to hold back the attiny85 from working for my intended purposes is the number of pins, and the attiny84 has up to 8 analog hardware inputs which is well more than I need.

Probably won’t get to delve too deep into learning the ways of the arduino or altec chips until the first week of July, as I’m currently absolutely swamped between the American Sign Language class and the writing class I’m taking this summer— both of which are at their mid-points as of today, with 3 more weeks to go.
 
Ahh good point, I hadn't even considered using the Arduino itself as the programmer. I always dump to HEX and write them to the ATMEGA with a dedicated USB programmer.

I forgot until I looked up what the differences were hahaha! I haven't used an uno in a long time, and do the same as you to program em
 
I'm putting together a little set of helper classes to make writing code for basic pedal related activities a little quicker and easier. I have classes for switches, LEDs, relays, and IO pins.

For example, the switch class has built in debouncing and can detect short and long presses. It handles all of the underlying hardware calls (data direction register, enabling/disabling pullup resistor, etc).

Since I write AVR code so rarely I find myself always having to go back and reference my old code to refresh my memory on pin/port/bit operations. This allows me to work with a much more intuitive set of functions and put something together in just a few seconds.

Right now I'm focusing on AVR but I'll be putting together an Arduino version as well. It's really nothing you can't find elsewhere, especially in the Arduino libraries, but this puts everything I commonly use together in a nice simple little package.

For example:
Code:
// Configure Footswitch on Pin 3 (PB4)
Button footswitch(IOPin(&PORTB, PB4, &PINB, PINB4, &DDRB));

// Configure LED on Pin 2 (PB3)
LED led(IOPin(&PORTB, PB0, &PINB, PINB0, &DDRB));

// Configure Relay on Pin 7 (PB2), Default to Open, Do not invert coil polarity
Relay relay(IOPin(&PORTB, PB2, &PINB, PINB2, &DDRB), OPEN, FALSE);

while (1)
{
    footswitch.Update();
    
    if (footswitch.OnPress())
    {
        led.Toggle();
        relay.Toggle();
    }    
}

Instead of:

Code:
DDRB &= ~(1 << PB4);    // INPUT - Footswitch
PORTB |= (1 << PB4);    // Enable pull-up resistor

DDRB |= (1 << PB3);    // OUTPUT - LED
DDRB |= (1 << PB2);    // OUTPUT - Relay

uint8_t lastState;
uint8_t currentState;

while (1)
{
    currentState = (PINB & (1 << PINB4));

    if ((!currentState) && (lastState))
    {
        lastState = currentState;
        PORTB ^= (1 << PB3);    // Toggle LED
        PORTB ^= (1 << PB2);    // Toggle Relay
    }
}
 
I'll post it once everything is smoothed out and working together nicely.

Right now it's just a matter of naming all of the functions in a uniform manner so it looks pretty. I wrote each part as I needed it so there was much less "careful planning" and a bit more "guns blazing".
 
I should add, I'm no expert C++ programmer by any means.

I don't conform to any particular coding standard or leverage the more recent/advanced C++ features. My code ends up looking like C with classes.

Of course, if you know the difference you probably don't need my library. :ROFLMAO:
 
I don't conform to any particular coding standard or leverage the more recent/advanced C++ features. My code ends up looking like C with classes.

I don’t know much about C or C++, so I don’t know what any of that means, but I’m sure that’s an A++ joke 😄
 
Back
Top