DIY controllers

I’ve experienced reading analog inputs that the value read continued to change, one bit up, one down, which resulted in a continuous stream of midi control values ; the program was intended to send only a midi controller value when its value changed, which it continuously did, because of the noise.

So in your case the getValue does some sort of averaging? Averaging is what resolved the issue for me.

3 Likes

nah nah that was to display for the lcd that i removed now (wanted more buttons).

The lib really just handles all of this. I might post the code later if you are interested. This lib is still pretty new, and is a huge abstraction compared to what i have used in the past. What can i say, its really good.

3 Likes

This is the (not quite finished, still need to assign cc values that i need) code. Its pretty basic. I cant imagine ever wanting to go back to doing it the old way, it would just feel like banging rocks together.


//===============================================================================
//  Header Files
//===============================================================================
#include <Control_Surface.h> // Include the Control Surface library

// Instantiate a Serial MIDI interface at the default MIDI baud rate.
//USBDebugMIDI_Interface midi = {115200};

// Select the serial port to use.
auto &serial = Serial;
// Instantiate a Serial MIDI interface at the default MIDI baud rate.
SerialMIDI_Interface<decltype(serial)> midi = {serial, MIDI_BAUD};

AnalogMultiplex<4> fader_mux = {
  A0,      // Analog input pin
  {2,3,4}  // Address pins S0, S1, S2
};

AnalogMultiplex<4> pot_mux = {
  A1,      // Analog input pin
  {2,3,4}  // Address pins S0, S1, S2
};

using namespace MIDI_Notes;

CCPotentiometer faderArray[] = {
  {A3,               {102, CHANNEL_1}},
  {A2,               {103, CHANNEL_1}},
  {fader_mux.pin(7), {104, CHANNEL_1}},
  {fader_mux.pin(3), {105, CHANNEL_1}},
  {fader_mux.pin(0), {106, CHANNEL_1}},
  {fader_mux.pin(1), {107, CHANNEL_1}},
  {fader_mux.pin(2), {108, CHANNEL_1}},
  {fader_mux.pin(4), {109, CHANNEL_1}},
  {fader_mux.pin(6), {110, CHANNEL_1}},
  {fader_mux.pin(5), {111, CHANNEL_1}},
};

CCPotentiometer potArray[] = {
  {pot_mux.pin(1), {20, CHANNEL_1}},
  {pot_mux.pin(0), {21, CHANNEL_1}},
  {pot_mux.pin(3), {22, CHANNEL_1}},
  {A4,             {23, CHANNEL_1}},
  {A5,             {24, CHANNEL_1}},
  {pot_mux.pin(2), {25, CHANNEL_1}},
  {pot_mux.pin(4), {26, CHANNEL_1}},
  {pot_mux.pin(6), {27, CHANNEL_1}},
  {pot_mux.pin(7), {28, CHANNEL_1}},
  {pot_mux.pin(5), {29, CHANNEL_1}},
};

// Instantiate a CCIncrementDecrementButtons object
CCIncrementDecrementButtons buttons = {
  {5, 6},      // Button pins: 5 increments, 6 decrements
  30,         // Increment/Decrement CC address
  1,         // Multiplier
  31,       // Reset note address
};

// Instantiate a CCButton object
CCButton button = {
  // Push button on pin 7:
  7,
  // General Purpose Controller #1 on MIDI channel 1:
  {MIDI_CC::General_Purpose_Controller_1, CHANNEL_1},
};

void setup()
{
  Control_Surface.begin(); // Initialize the Control Surface
}

void loop()
{
  Control_Surface.loop();
}

3 Likes

Quoting https://github.com/tttapa/Control-Surface this is what I was looking for: All digital inputs are **debounced** , and all analog inputs are filtered using **digital filters and hysteresis** .

5 Likes

Yes, this is what i meant when i said the lib “handles all of this” :slight_smile:. There are several things that you will notice are quality of life improvements over just debouncing logic. The hysteresis makes for buttery smooth transitions from state to state.

3 Likes

I’ve seen some people try to use old videotape magenetic tape as a makeshift ribbon potentiometer (a la korg monotron or the stylophone). Might be worth looking into.
Found a link with an (extensive) writeup.
http://www.ooooo.be/devices/ribbon4/ribbon4.htm

3 Likes

Its ugly and i hate the case i made for it, but it works. Learned a lot from this. Im about sharing the failures as well as the successes.

Things i would do different:

  1. Get the tools you need. I did most of this with a drill and box cutter. Its a miracle i was able to get this i think.
  2. Space the faders out. I dont think this will have enough clearance for fader knobs.
  3. I built this up as separate control modules both hooked up to a “brain” module. I really should have planned where these would fit in the box better.
  4. The knobs ended up shorter than i needed when i thread them through the box. Should either expose more of the pot, or deal with it.

Things that went right:

  1. It does what it is supposed to.
  2. Is powered and can be reprogrammed with the USB cable.
  3. Uses a single arduino nano and 2 8-channel multiplexers. One goal was to keep the costs down in this way.
  4. The knobs were when i ordered the wrong type when i was sourcing pots for sam’s modules. So i got a use outta them.
11 Likes

Nice going. On to v2!

4 Likes

I love using old cigar boxes as little project boxes for things like this. Although this might still be a bit too big. Saves a lot of time.

3 Likes

nah it fit everything rather well. any smaller and it would prolly be too crampt.

1 Like

Cigar boxes must be getting rare these days.

4 Likes

I know of a local workshop that still has boxes and boxes of em, so that helps. But i suppose they are falling out of favor.

1 Like

That looks really uncomfortable to sit on. Be careful with that, dude!

3 Likes

lol im sorta bummed i spent the week+ on something thats mushed. At the same time, it was basically just for the learning exp so really when you think about it that way, nothing was lost.

3 Likes

you had said there were things you didn’t like about it , so I guess you have kinda forced the rebuild .

3 Likes

My butt seems to have forced my hand.

3 Likes

??? has someone hidden this thread from me ??? never seen it but its the kind f stuff I have done a bit of and quite like :wink:

We built a 24ch Input desk to QLC+ using an old Zero88 Level 12 Lighting desk… It worked but got put on a shelf after we killed the DC-DC converter… One I need to get back to…

Good work!

Rob

4 Likes

I dont want to be the “butt” of any jokes now that the cat is out of the bag.

2 Likes

I think I found the ultimate in controller coolness.

It even has an emergency power button !

There is more here:

4 Likes

Darn. For a second there I thought he was going to turn it into a midi or CV controller when he said the USB dongle was musical, but it must be admitted that CNC is pretty cool too.

1 Like