DIY MIDI controller

Anything not covered elsewhere.
Post Reply
Message
Author
User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

DIY MIDI controller

#1 Post by J_Dunavin »

There is a ton of MIDI stuff out there, lots of examples to follow.
I built this one around the Teensy LC and it interfaces with Freestyler to control my lights.
https://www.pjrc.com/store/teensylc.html
Attachments
IMG_20171022_230800280_HDR.jpg
IMG_20171022_230800280_HDR.jpg (162.03 KiB) Viewed 2061 times
IMG_20170923_242512197.jpg
IMG_20170923_242512197.jpg (158.54 KiB) Viewed 2061 times
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

chrisj360
Posts: 114
Joined: Fri Sep 20, 2013 1:37 pm
Location: Bellingham, WA

Re: DIY MIDI controller

#2 Post by chrisj360 »

Nicely done! Where did you get the knobs & buttons?
2 x 21" T30's with Lab12's
2 x 28" T30's with Lab12's
2 x OTop12 with Deltalite 2512

Think
Posts: 117
Joined: Tue May 09, 2017 5:37 pm
Location: The Neterlands / Holland
Contact:

Re: DIY MIDI controller

#3 Post by Think »

Cool! Looks nicely build.
Why did you make it and what functions do you controll with it?
Is there some introduction to this for newbies where you can point me to?

User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

Re: DIY MIDI controller

#4 Post by J_Dunavin »

Thanks guys!
I built it for the sole purpose of controlling Freestyler DMX software, which can accept MIDI commands. You could also use a similar set up to control DJ software as well. Really this is just a Human Interface Device, so I can mash buttons or turn knobs instead of clicking on a mouse.
Freestyler can map MIDI buttons to specific tasks. For example some of the large push buttons start and stop my ADJ pocket scans, with pre programed sequences or shows. Each show as a set of commands that I sat down and set up beforehand. Like white light - move mirror left, move mirror right, change color to red - move mirror up, etc.
Right now I have the 12 buttons (cheap Chinese Ebay, for $12 :D ) four Linier potentiometers, three rotary potentiometers and one rotary encoder. The linier faders control the flood lights and the rotary encoder changes the flood light colors. Oh, I got the potentiometers and encoder from Newark, but Digikey and Mouser also have them.

You will need to have some Arduino experience. This example was my inspiration:
https://www.instructables.com/id/Arcade ... ontroller/

But I used the code from this example:
https://www.instructables.com/id/Custom ... ontroller/

He has examples for faders, buttons, and an encoder, so I just had to copy from the examples, define the pins on the Teensy and put it all together.
I would be happy to help anyone who would be interested In building one for themselves.
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

jimbo7
Posts: 849
Joined: Fri Dec 28, 2012 10:45 am
Location: St. Louis

Re: DIY MIDI controller

#5 Post by jimbo7 »

SWEET! I want a light setup so bad but I my stuff collects dust nowadays. :( I love home-brew gadgets like this. Are the rotary pots linear? It's a big deal in the guitar world :horse:
BFM builds:
XF212
T24 BP102 24"
2x SLA's 6-5" mids, 9- gt-302's
2x AT 14" MCM 55-2421
TrT 5" MCM 55-2421
AT 18" JBL GTO804
2x OT12 flat array
2x SLA Pro 2-Alpha 6's 2-Goldwoods
2x T39 24" 3012lf
Simplex 10 BP102

CoronaOperator
Posts: 1648
Joined: Wed Mar 25, 2009 7:07 pm
Location: Medicine Hat, Alberta, Canada

Re: DIY MIDI controller

#6 Post by CoronaOperator »

Really cool. Having physical faders is so much better than using a mouse.
This might be a winter project for me.

:clap: :clap:
Built:
17" width 10" driver Autotuba
2 x 29" width dual Lab12 Tuba60
6 x DR250 2510/asd1001
In progress:
2 x DR250 2510/asd1001
For best results, point the loud end of the array towards the audience

User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

Re: DIY MIDI controller

#7 Post by J_Dunavin »

Ya the potentiometers are 10k ohm linier. The microcontroller is just reading the analog voltage from that.

YA physical faders and knobs are so much nicer than having to work a laptop.

Seriously if anyone is interested, I can post a parts list or provide a more detailed how to. It's really straight forward, just a LOT of soldering!
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

User avatar
Tom Smit
Posts: 7457
Joined: Sat Jan 05, 2008 1:24 pm
Location: Sarnia, Ont. Canada

Re: DIY MIDI controller

#8 Post by Tom Smit »

J_Dunavin wrote: if anyone is interested, I can post a parts list or provide a more detailed how to. It's really straight forward, just a LOT of soldering!
That would be cool. 8)
TomS

88h88
Posts: 1603
Joined: Mon Jul 04, 2011 10:20 am
Location: Coventry, UK

Re: DIY MIDI controller

#9 Post by 88h88 »

Having basically grown up in arcades in the 80s I'd no doubt blow the budget on something like this by installing full on super duper Sanwa arcade buttons.

Saying that though, they sell light up buttons, I assume with a bit more knowledge (more than I'll ever have) you could make them light up when a particular function is active?
4xOT12s, 2xT39s@22", TTLS@18", 2xT60@18"

User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

Re: DIY MIDI controller

#10 Post by J_Dunavin »

Yup, sure can.
I thought about doing that, but the Teensy I used , like Arduino, only has so many ins and outs. I decided to use all of them as inputs, but there are bigger models that would support that function.
If you have 12 buttons, you would need 24 ports. 12 for inputs, 12 for status LEDs.
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

User avatar
Padde298
Posts: 115
Joined: Thu Jun 29, 2017 5:04 am
Location: Denmark

Re: DIY MIDI controller

#11 Post by Padde298 »

Tom Smit wrote: Tue Oct 31, 2017 12:17 am
J_Dunavin wrote: if anyone is interested, I can post a parts list or provide a more detailed how to. It's really straight forward, just a LOT of soldering!
That would be cool. 8)
+1
More bass, more bass! :chainsaw: :chainsaw:

2 x TAT

User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

Re: DIY MIDI controller

#12 Post by J_Dunavin »

The intractable that I linked in the 1st post will show you the basics of building the controller and how to wire everything up.
There are several ways to accomplish this, but to keep things simple I used the onboard voltage regulator of the Teensy LC to provide voltage and ground for all the switches and potentiometers. ( in this case 3.3vdc out, limited to 100ma of current. Enough for this project ) The Teensy itself is powered though USB.
Note that this Teensy input pins are only 3.3v tolerant, if you were to apply 12v to one side of a pushbutton and wire it up to an input you would damage the Teensy.

In this example all the pushbutton switches are switched ground. I daisy chained a ground from switch to switch, then ran the other side of the switch to a pin on the Teensy. (There are many ways to wire switches to microcontrollers, but in this example, no filters or extra components are required) The Teensy's pins may be assigned to read an analog source or a digital source. The bush buttons are treated as digital sources. off or on.
Here are the ones I used, but ANY momentary pushbutton will work, just make sure it's off (on). It makes the connection when you push the button, some are backwards.
https://www.ebay.com/itm/Arcade-Game-DI ... 1438.l2649


The potentiometers I used from Newark, again any potentiometer would work, as long as it's 10k linear. They don't need to be high power handling or anything fancy, though the nicer ones will "feel" better. The also come with center detents, and some come with switches. I did use some with switches, like your turn the rotary one counterclockwise, then there is a click to turn it off, or rather there is a switch there. I haven't actually found a use for that yet, but it's wired up.
https://www.newark.com/webapp/wcs/store ... reId=10194
slide knob for this potentiometer:
https://www.newark.com/webapp/wcs/store ... reId=10194
https://www.newark.com/bi-technologies- ... dp/69R7554
These will take 3.3vdc, ground, and then the wiper is what gets wired to an analog pin on the Teensy. These could be wired straight in, but you may see the value jump around a bit. A filter capacitor wired to that input pin to ground will help eliminate noise.
https://www.newark.com/webapp/wcs/store ... reId=10194

I'll post my code that I used and make some comments on it later..
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

User avatar
J_Dunavin
Posts: 1260
Joined: Sun Jul 09, 2006 3:13 pm
Location: Appleton WI
Contact:

Re: DIY MIDI controller

#13 Post by J_Dunavin »

Here is the code, i know it looks crazy, but all you need to change is the buttons, faders etc. Everything in Blue is a comment and not part of the code.
For example
Analog fader2(18, Channel_Volume, 2); the number 18 is pin 18 on the Teensy
Digital button2(1, C4+1, 1, velocity) the number 1 after the parentheses is pin one. You may note that the C4+x just counts on, with how many i have hooked up.



/*
This is an example of the "Analog" class of the MIDI_controller library.
Connect 4 faders or potentiometers to A0-A3. These will be MIDI channel volumes of channels 1-4.
Map these in your DAW or DJ software.

If you are using a Teensy, make sure you have the USB type set to MIDI.
If you are using an Arduino Uno or Mega, use the HIDUINO firmware for the ATmega16U2.


Written by tttapa, 21/08/2015
https://github.com/tttapa/MIDI_controller
*/


#include <MIDI_controller.h> // include the library

const static byte Channel_Volume = 0x7; // controller number 7 is defined as Channel Volume in the MIDI implementation.
const static size_t analogAverage = 8; // Use the average of 8 samples to get smooth transitions and prevent noise
const static byte velocity = 127; // the maximum velocity, since MIDI uses a 7-bit number for velocity.
const static int latchTime = 3000; // the amount of time (in ms) the note is held on. Read documentation or see source code for more information.
const static byte C4 = 60; // note number 60 is defined as middle C in the MIDI implementation.
const static byte E0 = 16; // note number 60 is defined as middle C in the MIDI implementation, so 16 is E0
const byte Channel = 1; // MIDI channel 1
const byte Controller = 0x14; // MIDI controller number
const int speedMultiply = 1; // no change in speed of the encoder

//________________________________________________________________________________________________________________________________

//DigitalLatch switch1(26, E0, 1, velocity, latchTime); // Create a new member of the class 'Digital', called 'button1', on pin 2, that sends MIDI messages with note 'C4' (60) on channel 1, with velocity 127).
DigitalLatch switch2(14, E0+1, 1, velocity, latchTime);
DigitalLatch switch3(15, E0+2, 1, velocity, latchTime);
DigitalLatch switch4(16, E0+3, 1, velocity, latchTime);
Analog fader1(17, Channel_Volume, 1); // Create a new instance of the class 'Analog, called 'fader1', on pin A0, that sends MIDI messages with controller 7 (channel volume) on channel 1.
Analog fader2(18, Channel_Volume, 2);
Analog fader3(19, Channel_Volume, 3);
Analog fader4(20, Channel_Volume, 4);
Analog fader5(21, Channel_Volume, 5);
Analog fader6(22, Channel_Volume, 6);
Analog fader7(23, Channel_Volume, 7);
Digital button1(0, C4, 1, velocity); // Create a new instance of the class 'Digital', called 'button1', on pin 2, that sends MIDI messages with note 'C4' (60) on channel 1, with velocity 127).
Digital button2(1, C4+1, 1, velocity); // C4 + 1 = C#4
Digital button3(4, C4+2, 1, velocity); // C4 + 2 = D4
Digital button4(5, C4+3, 1, velocity);
Digital button5(6, C4+4, 1, velocity);
Digital button6(7, C4+5, 1, velocity);
Digital button7(8, C4+6, 1, velocity);
Digital button8(9, C4+7, 1, velocity);
Digital button9(10, C4+8, 1, velocity);
Digital button10(11, C4+9, 1, velocity);
Digital button11(12, C4+10, 1, velocity);
Digital button12(24, C4+11, 1, velocity);
Digital button13(25, C4+12, 1, velocity);
Digital button14(26, C4+13, 1, velocity);
RotaryEncoder enc(3, 2, Controller, Channel, speedMultiply, NORMAL_ENCODER, POS1_NEG127); // Create a new instance of the class 'RotaryEncoder', called 'enc', on pin 2 and 3, controller number 0x14, on channel1, no change in speed (speed is multiplied by 1), it's used as a Jog wheel, and the sign mode is set to two's complement.

//________________________________________________________________________________________________________________________________

void setup(){

USBMidiController.blink(LED_BUILTIN); // flash the built-in LED (pin 13 on most boards) on every message
USBMidiController.setDelay(15); // wait 15 ms after each message not to flood the connection
USBMidiController.begin(); // Initialise the USB MIDI connection
delay(1000); // Wait a second...
fader1.average(analogAverage); // Use the average of 8 samples to get smooth transitions and prevent noise
fader2.average(analogAverage);
fader3.average(analogAverage);
fader4.average(analogAverage);
fader5.average(analogAverage);
fader6.average(analogAverage);
fader7.average(analogAverage);


}

//________________________________________________________________________________________________________________________________

void loop(){
//switch1.refresh(); // refresh the switch (check whether the input has changed since last time, if so, send it over MIDI)
switch2.refresh();
switch3.refresh();
switch4.refresh();
fader1.refresh(); // refresh the fader (check whether the input has changed since last time, if so, send it over MIDI)
fader2.refresh();
fader3.refresh();
fader4.refresh();
fader5.refresh();
fader6.refresh();
fader7.refresh();
button1.refresh(); // refresh the button (check whether the input has changed since last time, if so, send it over MIDI)
button2.refresh();
button3.refresh();
button4.refresh();
button5.refresh();
button6.refresh();
button7.refresh();
button8.refresh();
button9.refresh();
button10.refresh();
button11.refresh();
button12.refresh();
button13.refresh();
button14.refresh();
enc.refresh();
}




If anyone is remotely interested in making their own midi controller i would be happy to help.
2 - OTop8
2 - T39
8 - DR200
2 - DR250
9 - T24
6 - T45
1 - Auto Tuba

Post Reply