Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 18 of 18

Thread: Extensive MIDI controller feasibility

  1. #1

    Extensive MIDI controller feasibility

    Hi, I'm a bit of an amateur in this field but I'm looking for some guidance. I'm currently building a MIDI controller that consists of roughly 60 potentiometers. I plan to use teensy boards due to price and practicality but I have a few questions about the logistics.
    Note: I will be using this controller within MaxMSP.

    1. Due to there being a large number of connections & knobs I'll need to use multiple (Hopefully 2) boards, is this possible to having two seperate teensy boards running simultaneously on the same computer & software and if so are there any complications from doing so?

    2. The teensy boards have both analog and digital pins, as I'll need to use every possible input/pin and theres are a select amount of digital and analog pins on the board, am I able to connect the potentiometers to the analog and the digital pins and treat them the same when programming?

    3. In most tutorials I've seen that the board has been programmed before soldering the connections to the actual board. Is this necessary or will it be possible to programme the board, solder let's say 8 connections to the board as a test and then continue to solder the remaining connections and edit the programming afterwards to account for the extra connections.

    Apologies if these are incredibly obvious but I'm somewhat new to this and would like to know where I stand with the project so any help would be much appreciated.

  2. #2
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,112
    1) There are some minor complications getting unique names to display to the USB device manager but nothing too challenging.

    2) Analog enabled PINS can also act as digital but you need to refer to the pin-out diagrams for each Teensy type to see which are able to do what.
    Multiplexers can increase the number of switches or potentiometer/voltage sensors by time-sharing the analog PIN... but the cost is greatly increased complexity and it's not a novice thing

    3) Get a Teensy with bread-board pins pre-soldered and you don't have to worry about such things... but to your question you can solder more later.

  3. #3
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,112
    Quote Originally Posted by gwk21 View Post
    ...1. Due to there being a large number of connections & knobs I'll need to use multiple (Hopefully 2) boards, is this possible to having two seperate teensy boards running simultaneously on the same computer & software and if so are there any complications from doing so?...
    They would appear as two separate controllers... which is fine if they are but would be a bit odd if they're in the same box... multiplexing would solve this with one Teensy as one controller but don't expect you'll be able to kludge something together if you have little electronics or programming experience. Don't make it your first project or you will likely fail... if past experience of noob postings here is any indication.

  4. #4
    Hi oddson thanks for the speedy response.

    That's good to know that using two boards shouldn't be a problem.

    Well I'm all for keeping complexity to a minimum and costs down so if considering the pin-outs for a teensy 2.0 board what do I need to refer to exactly to know if simply connecting potentiometers to these pins (the same as the digital pins) will be successful?

    And yes I am considering the bread-board option although I'm trying to further my soldering skills so I was up for making some more permanent connections.

    Thanks again for the help.

  5. #5
    And yes I understand about it being a bit odd but it's not a problem if they appear as two seperate controllers as each knob will be assigned to an individual function within MaxMSP

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,112
    T2 has only 12 analog inputs... 3.5 has 27 (two more the 3.6? that was news to me).

    Some of the pins on 3.x are not available from the breadboard friendly pins... I think 21 are for T3.5 or T3.6
    Last edited by oddson; 02-16-2017 at 05:31 PM.

  7. #7
    Hmm well I'm assuming i'll be wanting the digital inputs for the potentiometers so not having many analog inputs isn't a problem?

  8. #8
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,112
    Potentiometers are analog signals

    https://www.pjrc.com/teensy/tutorial4.html

  9. #9
    You need analog inputs to read the outputs of a potentiometer, unless you want the pot to act as a switch. If you look at the reference pictures, they colour code what pins can be used as what.

    You can use two teensys, and even pass the commands from one to the other so you have a single connections to your PC; or you can mutliplex in a variety of ways. It depends on your priorities/ capabilities.

    Most people build on breadboard first, then move to a more permanent soloution. Nothing wrong with that approach.

  10. #10
    Ah okay of course. Well I do have a few switch controls so that will be fine for the digital inputs. However in that case, maybe I should consider using two 3.5 boards as oddson suggested if they have 27 analog inputs each. If i were to do so then unless I want to use 3 boards (60 potentiometers) which I don't I may have to change some of the potentiometers to switch controls in order to keep it to two boards?

    Yeah I figure the multiplex method is ideal but perhaps out of my reach at my current ability.

  11. #11
    of course I'd love to hear possible solutions on how best to do this if there are better alternatives. I've already committed to building this with the parameters i've mentioned so failure is not really an option. Anymore help & suggestions would be greatly appreciated

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,169
    With so many analog signals, you might check out the ResponsiveAnalogRead library. It post-processes the analog data to reduce minor fluctuations, which can really help reduce unnecessary MIDI communication.

  13. #13
    Ah I'll definitely check it out, that's really helpful thanks!

  14. #14
    PaulStoffregen, any idea on the best way to approach this project? AFter this discussion I'm now having to consider reducing the number of potentiometers and switching to 2 x teensy 3.5's.

  15. #15
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,112
    For 60 pots with MUX and a single 3.5 board you could use 6x 8-ch. MUX and there would be enough PINs to do the balance directly.

    Or just to 8 x 8 MUX as then the code is the same for all of them... Then any Teensy would do as you would need analog for each group of 8 when wired as in Paul's example: https://www.pjrc.com/teensy/td_midi.html#manyinputs

    Seriously though... don't jump right in until you can program all the basic parts of Teensy ... run through all the tutorials and maybe build a small MIDI controller just to get your feet wet.

    You could make the three-Teensy version and then replace the brains with a single Teensy and MUXs at a later date. But still don't skip the part where you learn what Teensy is and how to make it do basic things first.

  16. #16
    Thats very helpful thank you for the information, i'm going to have to look into this further but this definitely put me in the right direction. Yeah I plan on doing so, this is a university project so I'm working to a deadline unfortunately and perhaps naively committed to incorporating this method but I'm willing to learn and give it a go.

  17. #17
    Senior Member MickMad's Avatar
    Join Date
    Feb 2013
    Location
    Italy
    Posts
    162
    Hi there,

    I know what I'm going to say might sound a bit complicated for a beginner, but as someone else already mentioned, you have the option of MULTIPLEXING.

    That is, you can use a multiplexer to reduce the number of pins needed to control a lot of peripherals, such as buttons and potentiometers, just like your case.

    A multiplexer is a digitally controlled switch; it has 1 common pin, 2^n i/o pins, and n control pins. For example, a 8 channel multiplexer act as a SP8T switch (single pole, 8 throws) that connects one of the 8 channels pins to the common pin. You select which channel to activate by "writing" the channels'n number in bits on the control pins. For example, to select channel 2 I'd write 010 on the 3 control pins of the 8 bit multiplexer we were talking of before.

    As you can see, you could use 3 digital pins + 1 analog pin to control 8 potentiometers, for example. Take a 16 bit multiplexer and you can connect 16 potentiometers on the SAME analog pin and use 4 digital pins to select which potentiometer to read.

    There's plenty and plenty of resources online on how to connect a mux to a Teensy/Arduino/everything; I will link you an old project of mine where I use this technique to read 16 force sensing resistors using a mulitplexer.

    https://hackaday.io/project/1601-diy...ller-mpc-style

    this is the schematic of the connections for the FSRs to the mux:
    https://cdn.hackaday.io/images/7782381412372851988.png

    in your case I think you can drop R17 and R18 and just connect the common pin of the mux to one analog pin.

    You can use a similar layout for switches, just connect the output of the mux to a digital pin rather than an analog one.

    One last thing:
    You seem to need more than 16 inputs on your board. Well, you can just use MORE multiplexers in parallel you could share the control pins with all the multiplexers, while connecting each mux's common pin to a separate analog or digital pin on the Teensy. E.g.: you want 32 pots and 32 buttons? Then you would need 4 16 bit mulitplexers, two of them are connected to two analog pins (for the 32 pots), two of them are connected to two digital pins (for the switches). In total, you would need 2 analog inputs + 2 digital inputs + 4 digital outputs (the control pins can be shared). Sounds way better than needing 60 pins, right?

  18. #18
    Hi MickMad,

    Thanks so much for the in depth response. I'd definitely prefer to use this multiplexing method as it would save on costs and sounds rather interesting (Your old project looks great by the way!). I'm going to buy a 3.5 board today and start wiring next week in the mean time i'll further look into multiplexing and hopefully it's not too difficult!

    Thanks again, the guidance really is appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •