Midi Controller using MIDIcontroller library (first project ever, plz help :) )

Status
Not open for further replies.

Gripporillat

Well-known member
Hi everyone,

first of all, I'm absolutely new to this, this is my first teensy project, even my first microcontroller project ever. The last time I tried coding was php4 so I'm kind of new to coding as well :)

My final goal is to build a simple but kind of huge Midi controller. (71 analog and 31 digital inputs) I'd like to use the MIDIcontroller library because it seems very easy to use. I couldn't figure out yet how to do multiplexing with this library and I hope you can help me with that but first of all I did a little testing to check if I'm capable to build a very simple controller.

This is my circuit:

test2.jpg

And this is my Code:

Code:
#include "MIDIcontroller.h"
byte MIDIchannel = 1;
const int buttonPin = 0; 

const int potPin = A9;

// MOMENTARY buttons are the default. LATCH or TRIGGER may also be set
MIDIbutton button1(buttonPin, 0, MOMENTARY);          
MIDIpot myPot(potPin, 1);

void setup(){
}

void loop(){
  button1.send();
  myPot.send();
}

First of all: IT WORKS! YEAH! But I'm experiencing a little bug: I'm using a slide potentiometer and the lowest value I get from it is 1, not 0. Can anyone tell me why?

Thx in advance!
 
More questions:

As I said, I want to build a Midi controller with 71 analog and 31 digital Inputs.

- Can a single teensy 3.5 properly handle this? Even if the User pushes multiple buttons at once and/or moves 10 slide potentiometers at once?
- Is the MIDIcontroller library the right choice for this project? Is it fast enough?
- Can I use the 3.3V pin of the teensy to power all this or will I need an additional power supply?
- I guess I should use external pullup resistors for the digital inputs. What kind of resistors should I use?
- What would be the best choice for the potentiometers? 5k?10k?50k?

Thx again!
Robert
 
I personally don't see the need for a library for MIDI controllers beyond built-in calls. While they can handle common issues like debounce and pot smoothing you are a bit limited with support if they don't work as you expect.

Q1: why won't pot zero?

Either your voltage divider is not being pulled all the way to ground or the software is failing to go to zero as part of its smoothing mechanism...

Q2: Can a T3.5 control large numbers of pots and buttons?

It's plenty fast enough but you need multiplexing to connect all the signals and that is not really a beginner project even if you are using existing code.

Q3: will this library work?

His features list does not include multiplexing, so I think not.

Q4: Can Teensy power it diectly?

Short answer is 'no'. If you have that many pots each with a small current maintaining the output voltage you need more current that USB can be counted on to provide.

Q5: should I use external pullups?

There are a number of ways to multiplex switches... it's possible to use the internal pullup on the pin reading the multiplexed input but many/most schemes rely on external pullups to speed up changes as you cycle thru all those inputs.

Q6: What size pot?

10K ohm is standard but 5K pots are sometimes recommended to bring the voltage at the pin to its new reading faster when cycling thru so many. Smaller values mean more power being used.
 
10K is a pretty commonly used value for pots. With 3.3V, each pot will consume 0.33 mA. If you use 71 of them (and mux chips to get access to all those signals), the total current needed for the pots will be about 24 mA. The 3.3V power on any 32 bit Teensy board can easily give you 24 mA.
 
Yeah.. I didn't bother with the math as it sounded like all those the mux and pots would require a power supply but I guess not.
 
Status
Not open for further replies.
Back
Top