Teensy 3.2 USB MIDI Controller Coding Assistance *Willing to Pay*

Status
Not open for further replies.
Hello All,

I am new to coding and know nothing, so I am reaching out for assistance with my project.

The purpose of my project is to control an effects plugin in Cubase and Logic by mapping MIDI through USB.

I have built a device that connects 20 encoder pots (16 connected through two 8-input multiplexers, 4 direct) and 12 buttons (8 connected through an 8-input multiplexer, 4 direct). All of this is connected to a Teensy 3.2. The encoders should be able to increase and decrease parameters in my audio programs and the buttons should be able to turn on and off parameters in my audio programs. There wouldn't be any special coding required for the components.

I would be willing to pay someone via Paypal to provide the full coding for my project, given that it works correctly. Is anyone willing to assist me with this?


I have attached a picture of my midi controller face and the corresponding connections below.

Controller Template.jpg

Digital Multiplexer to Teensy 3.2 Pin 8
D0 – DYN TO CHANNEL OUT
D1 – EQ TO DYNAMIC S/C
D2 – SPLIT EQ
D3 – HIGH FREQ BELL
D4 – EQ BYPASS
D5 – PHASE
D6 – LOW FREQ BELL
D7 – BYPASS PLUGIN

Extra Digital Buttons
Teensy 3.2 Pin 9 – GATE ON/OFF
Teensy 3.2 Pin 10 – COMP FAST ATTACK
Teensy 3.2 Pin 11 – DYN BYPASS
Teensy 3.2 Pin 12 – GATE FAST ATTACK

Analog Multiplexer A to Teensy 3.2 Pin 18
A0 – HIGH MID FREQ Q
A1 – LOW MID FREQ HZ
A2 – LOW MID FREQ GAIN
A3 – LOW MID FREQ Q
A4 – LOW FREQ GAIN
A5 – OUTPUT LEVEL GAIN
A6 – INPUT LEVEL GAIN
A7 – LOW FREQ HZ

Analog Multiplexer B to Teensy 3.2 Pin 19
B0 – GATE RANGE
B1 – GATE RELEASE
B2 – HIGH FREQ ROLL OFF FILTER
B3 – HIGH FREQ HZ
B4 – HIGH MID FREQ HZ
B5 – LOW FREQ ROLL OFF FILTER
B6 – HIGH FRQ GAIN
B7 – HIGH MID FREQ GAIN

Extra Analog Encoders
Teensy 3.2 Pin 22 – COMP THRESHOLD
Teensy 3.2 Pin 21 – COMP RATIO
Teensy 3.2 Pin 20 – COMP RELEASE
Teensy 3.2 Pin 23 – GATE THRESHOLD
 
I've been thinking of doing something quite like that. The software isn't difficult.

Do you have schematics?
Looks like LEDs are present? Where are they connected?
Are the buttons momentary contact, or latching?
What multiplexers are being used, what pins are being used for selectors?
 
Last edited:
I don't have schematics, though I am designing a PCB board to simplify connecting everything. (I will attach a pic of how the micro controller will connect to the components.
I don't plan on using LEDs just yet, maybe down the line on the next prototype.
The buttons are meant to be on/off. (Push to turn on and push again to turn off). Im not sure what that is considered.
I've actually simplified my design using a Teensy 3.5. That way all my components can be directly connected instead of using multiplexers. Plus, its cheaper overall.

unnamed.png
 
I’m confused by ‘digital encoder pot’, but will assume you mean pot. Not to be confused with rotary encoder, (aka quadrature encoder) which uses more pins.

Eliminating the muxes simplifies coding a bit, but mixes are simple, too.
You probably should use the 3.3v pin to drive the pots.
 
I am using 360 degree rotary encoders. 3 pins are being used. Ground connection, VCC connection, and output.

uxcell 360 Degree Rotary Encoder Code Switch Digital Potentiometer EC16 5 Pins 20 Digits D-Shaft
 
That's not how rotary encoders work. They need two I/O ports, and power or ground. And another port if they also have a pushbutton.

Neither your mux idea, nor your muxless idea, will work with rotary encoders.
 
@bryangold42
The teensy 3.5 has enough pins to add 20 rotary encoders, 12 buttons and many LEDs, if they are Neopixels or other "smart LEDs", all without any additional hardware. Plus, you will have some UART pins left to make a MIDI port, which will need the usual optocoupler, etc.
Have you considered the pads 40 to 57 on the underside of Teensy 3.5?
If you want to use many LEDs, there is https://www.pjrc.com/teensy/td_libs_OctoWS2811.html
For the buttons: https://www.pjrc.com/teensy/td_libs_Bounce.html
To connect encoders: https://www.pjrc.com/teensy/td_libs_Encoder.html
For MIDI: https://www.pjrc.com/teensy/td_libs_MIDI.html
 
Yes, 3.5 has more I/O than I thought.
Still, I would use pots for this, as an encoder’s position cannot be determined visually. Also, look at the image in the original post. Each knob is marked with a min and max value.

Encoders have their uses, but this isn’t one.
 
Oh, with pots it is even much easier. T3.5 has enough analog inputs for 20 pots and enough digital inpus for the buttons. Just use Pots in the range of 10k to 47k to make reading the ADC faster and easier.
 
Oh, with pots it is even much easier. T3.5 has enough analog inputs for 20 pots and enough digital inpus for the buttons. Just use Pots in the range of 10k to 47k to make reading the ADC faster and easier.

Yes, and that's exactly what I thought when he first switched from 3.2 with muxes to 3.5. The confusion came up when he mentioned encoders.
 
The code in this post could be merged with the standard features of my Many buttons and knobs example to provide the feature set you indicated you want.

https://forum.pjrc.com/threads/4717...ing-Teensy-LC!?p=169003&viewfull=1#post169003

It's for a 16 channel MUX but removing the S3 control for an 8 channel mux like the one you've indicated should be pretty easy.

But it is foolish to think you can build this and load up code that someone else wrote, without access to the hardware it is for, and have it work properly as soon as you load the code... you are likely to make mistakes building and they are likely to make mistakes coding that they cannot find without having the hardware to test it on.

If you're willing to learn the basics of Teensy/Arduino (if you don't already know them) then I'm willing to try to merge the code together for you to test. But you will have to take ownership of the project. I'll take no money but I make no promises.

You should realize the physical build can become challenging if there is no PCB to handle all that wiring. It may seem simple to wire up 20 pots correctly but you can make a mess of it or just add a lot of noise to the system by having wires everywhere.

Large MIDI controller projects tend to come up here quite a lot but few are ever completed as it seems many would-be builders bite off more than they can chew.
 
Hey Oddson,

Since I've been given advice, I redid my design. I am using a Teensy 3.5 to connect 12 buttons and 20 (KY-040) 360 rotary encoders.
Each component is connected to ground, while VCC is connected to all of the rotary encoders.
Each CLK and DT pins from the rotary encoders are connected directly to the Teensy and one pin from each button is connected directly to the Teensy.

All of this is meant to work through the Teeny's Micro USB as a USB/MIDI device to control a plugin effect in Cubase (audio software).

I was hoping that the code would be simple enough, since the buttons are on/off and the rotary encoders are increase/decrease.

If you have a code you think might work, please copy and paste into this thread so I can just add the pins I am using from the Teensy.

It would be very much appreciated. Thank you!
 
...Since I've been given advice, I redid my design. I am using a Teensy 3.5 to connect 12 buttons and 20 (KY-040) 360 rotary encoders.
Sorry... I can offer code for pots but not for encoders.

The voltage coming off a pot as a voltage divider is dead simple to use as proxy for the physical position of a pot.

Encoders have lots of advantages but simplicity for programming is not one of them.

I think there are a couple of MIDI library's for Teensy that support encoders and MUX without having to know how to program either. Good luck with your project.
 
Encoders have advantages in some situations. For instance, when it will be used for multiple functions, or selecting from a variable length list, or where the value doesn’t matter (like a volume control), and where the value is displayed (like a car radio tuner.)

But for a control panel where each knob has a single function, and each knob has a fixed minimum and maximum, and where the panel is marked with values and knobs have pointers, pots are more appropriate. And simpler.
 
Hey Tele Player,

I believe the link you sent is for pots with limited turns. I need knobs without limits. I need to be able to keep turning without it stopping.

I understand that the picture I originally posted in post #1 shows set parameters. Please ignore that.

Does that mean I do need to use 360 rotary encoders?
 
Pots always have limited turns, most are less than 360 degrees, and some are 10 turn and more, for special applications requiring fine adjustment.

Digital pots is a misnomer sometimes used to refer to rotary encoders.

If you really really want endless turns, you do need rotary encoders. I tried to dissuade you since encoders don’t seem appropriate for the description in your first post.
 
I'm not going to get directly involved in your project, but I might add another USB MIDI example for use of rotary encoders.

First, I would like to ask, have you run *any* of the USB MIDI examples yet? In Arduino, they're accessed by clicking File > Examples > Teensy > USB_MIDI. The Buttons example is an excellent starting point.

Before diving into encoders, I would also like to echo the advice that pots connected to the analog pins may are probably more appropriate for your needs. They're also easier to use and examples are readily available.

But so far, relatively little has been done on example code for using encoders with MIDI. If you haven't used the other examples yet, please do that first, so you gain some experience with how the examples work. Then let's talk about what a useful rotary encoder example program might do....
 
Echoing the others about encoders...

Very few midi controllers that I have seen have encoders. When you turn the controller on, what value should each be encoder be set to? 0, mid, max? If each click of the encoder increments the value by 1, and max is 127, you'll be cranking that encoder for a while to get it to max. A pot on the other hand has none of these problems.

Also, not to be rude, but if you want to pay someone to build you a midi controller, why not just buy one? There are scads of them, of all different shapes, sizes, and capabilities. Midi controllers are great as a learning experience, but not great to pay someone to build if you care about bang for your buck.
 
Some controllers have encoders. Example: Arturia Minilab.

There are tricks to writing code for encoders to change the increment based on the speed at which you turn.

Finally, if the goal was as described in the original post, I could see making a dedicated MIDI controller for a specific device. But, for the pictured device, I wouldn’t use encoders.
 
Status
Not open for further replies.
Back
Top