How many teensy 4 can be connected together?

frankzappa

Well-known member
Hello!

I’m doing an electronic drum project where I have a teensy 4 inside a drum doing all the sensor processing and MIDI triggering. It sends out midi through a usb cable to a pc that triggers all sounds.

I’m wondering if it’s possible to have multiple of these drums connected in series with a usb cable from one drum to the next and have the last one send out all midi data to the computer to trigger sounds?

How many can be connected? I guess one usb cable will only be able to power a few of these.

I’m not very good at programming and have not much knowledge about how to actually accomplish this, I’m just wondering if it’s possible or if you have to run a cable to a usb hub from every teensy.
 
Some might suggest its a waste of processing power but usbHost is a possibility where Teensy 1 plugs into PC, then Teensy2 plugs into Teensy1's usbHost port then Teensy3 plugs into Teensy2's usbHost port and so on.
Don't know how far you will get down the line before the PC runs out of host power. Would need to add up how much current each one draws and factor in Voltage drop. I seriously doubt that you would get half way.

Far better to think of a 10 port powered UsbHub. Maximum cable length might be an issue as dumkits can spread out a little. Are Usb cables robust enough for the job?

Mentally shuffling the building blocks, why not One Teensy with cables running to individual sensors so you can use more robust and longer cables? Provided that the Sensor - Teensy pathway IS workable.
 
It would be A LOT less cables if you can connect them in series. It’s sort of a big deal in edrumming to get rid of the cables.

How long cables can you use? The laptop is usually a meter from the closest drum. The cables between the drums can be pretty short, from teensy to teensy probably less than 1m. I’m guessing total cable length maybe 4m.


This drum I’ve made is pretty advanced and has 10 sensors that max out the teensy 4 adc’s. The other drums will also have multiple sensors, not as many but they will have the ability to plug in electronic cymbals. Again, reduces amount of cables massively. In stead of every drum having one cable that goes all the way into one point at one side of the drum kit there would only be short cables about 1-3 feet long.

What do you mean it would be a waste of processing power?
 
Theoretically, with powered USB hubs, up to 127 other Teensy boards could connect to the USB host port on a Teensy 4.1.

But if your goal is to just send MIDI events to a PC (implied but unclear from your question), you could just connect all those hubs to your PC and plug every Teensy into them.


Was this a stupid question?

Stupid, no, not really. But lacking in the 3 factors that matter for asking tech questions, yeah, pretty much. Those 3 factors are:

#1 - Make a good first impression, best by showing effort you've already made. People like helping and answering for those who make an effort. I wouldn't say you made a bad 1st impression, more like neutral.

#2 - Give context about your project. People who understand your needs & goals can help much more. This was the main issue.

#3 - Share details. People who want to help, and understand your needs, are only able to help if your question has specific info. For example, you mentioned drums and triggering sounds, but no specific info, not even which software you might use or even whether it would run on Mac, Windows or Linux.

Even just a photo or links to the specific gear you own or plan to use could have given detail, shown some idea of what you're trying to do, and demonstrated effort. It really doesn't take much, but it does take something more specific than posted here.

So not a stupid question (and fwiw, utter beginner questions demonstrating a sincere but failing effort are often the ones that get a lot of replies), but a low-context & narrowly focused tech question. Imagine if you were to read this question. You don't know what the project is really about, there's no detail about which gear is used, so what sort answer would you write? Reality is, almost everyone passes over this sort of question and moves on to putting their effort into questions where they can understand what's needed, where enough detail is present to be able to answer.
 
I’ve been making this project for about 2 years, so a lot of effort has gone into it and I have learned to program from scratch with no prior knowledge to do it. It is not some half assed attempt.

I have learned a lot of stuff about c++ but the stuff under the hood of the teensy I have no clue where to even look. This where you guys are experts.

Here is a video showing some features of this drum:

https://m.youtube.com/watch?v=sIsUxxaar3Q

I also have a position sensing feature where it detects where you hit on the drum head. Uses multilateration. It is not shown in the video.

The robust detection of the different articulations like this drum has is something no other drum in the world has. This was not easy to do and it’s a 40+ year old problem solved.

Anyway, hopefully you can see some dedication and effort from my part but you must understand that I don’t even know where to begin when we are talking about communication between devices or internal code. Stuff that is probably very easy for you guys.

To answer some of your questions the PC (windows or mac) will have some kind of app that controls different settings on the teensy (I have no clue how to do it but I will look into juce which is apparantly a framework to make programs like that). The teensies will send midi but also sensor data so you can visually see what is going on so you can easily set parameters. The sensor data can be sent maybe 10 times per millisecond or between sensor reads. The teensies will also have to recieve data from the computer to control different parameters.

Anyway maybe I should just hire someone to do this for me. I don’t even know where to start.

What I really wanted with this thread is to know if this is even possible to do and if someone could steer me in the right direction when it comes to learning this stuff.
 
Honestly, that demo vid blew me right out of the water.

It seems that first, you need to establish comms with juce so dig in discover what it needs as a pathway.
 
Honestly, that demo vid blew me right out of the water.

It seems that first, you need to establish comms with juce so dig in discover what it needs as a pathway.

Thanks, I have gotten great reactions from people so far which is encouraging when you have been working hard on something. The difficulty is really to differentiate the cross sticks from the rest. So far this is the only drum in the world that can do it without any extra mechanical parts outside of the drum. There is one drum that has a touch sensor inside but then that’s the only thing you can play if your hand is on the drum.

Also the velocity response is very even across the whole drum without any hot spots or amplitude cold zones. Usually electronic drums will have hot spots where the sensors are.

I’m still working on the position sensing which is the final feature I will add. After that I was planning to look into juce.

It does seem to be the next logical step.
 
Thanks, I have gotten great reactions from people so far which is encouraging when you have been working hard on something. The difficulty is really to differentiate the cross sticks from the rest. So far this is the only drum in the world that can do it without any extra mechanical parts outside of the drum. There is one drum that has a touch sensor inside but then that’s the only thing you can play if your hand is on the drum.

Also the velocity response is very even across the whole drum without any hot spots or amplitude cold zones. Usually electronic drums will have hot spots where the sensors are.

I’m still working on the position sensing which is the final feature I will add. After that I was planning to look into juce.

It does seem to be the next logical step.

I did some googling about electronic drums to see how they work, and I still don't know much, but it looks like you have done a lot of good work on the project. If you haven't already put multiple drums together, it might be wise to do it the simplest way first, which I guess means USB hubs, and don't worry how many cables, to see how it goes with data transmission and processing. When you know how much data you really need, you can make product design decisions. I don't know if it's fast enough, but T4 supports CAN, and I see some people are doing MIDI over CAN.
 
I did some googling about electronic drums to see how they work, and I still don't know much, but it looks like you have done a lot of good work on the project. If you haven't already put multiple drums together, it might be wise to do it the simplest way first, which I guess means USB hubs, and don't worry how many cables, to see how it goes with data transmission and processing. When you know how much data you really need, you can make product design decisions. I don't know if it's fast enough, but T4 supports CAN, and I see some people are doing MIDI over CAN.

That sounds logical. This is great info, I will look into CAN bus. I know that the edrumin which is a teensy based drum module uses something called HID to send data for the monitoring of waveforms and such.
 
That sounds logical. This is great info, I will look into CAN bus. I know that the edrumin which is a teensy based drum module uses something called HID to send data for the monitoring of waveforms and such.

HID is part of the USB specification. There are people on this forum, Paul and others, who know a lot about USB and HID, so if you go that direction or CAN, you should be able to get help here. I thought of CAN because it might be cheaper and simpler to create a CAN bus connecting drums than to "daisy-chain" devices on USB, if that is even possible. There can be collisions on CAN bus, and I don't know if that makes it unacceptable for your use. I think it would be a good idea for you to estimate the bandwidth you need. If it's well within the CAN spec, then CAN could work. You should probably estimate what you need both with and without the diagnostic data you mentioned for further test and development. When you try to make a commercial product, there are always tradeoffs between cost and capability. Here is a link regarding HID. https://www.usb.org/hid
 
HID is part of the USB specification. There are people on this forum, Paul and others, who know a lot about USB and HID, so if you go that direction or CAN, you should be able to get help here. I thought of CAN because it might be cheaper and simpler to create a CAN bus connecting drums than to "daisy-chain" devices on USB, if that is even possible. There can be collisions on CAN bus, and I don't know if that makes it unacceptable for your use. I think it would be a good idea for you to estimate the bandwidth you need. If it's well within the CAN spec, then CAN could work. You should probably estimate what you need both with and without the diagnostic data you mentioned for further test and development. When you try to make a commercial product, there are always tradeoffs between cost and capability. Here is a link regarding HID. https://www.usb.org/hid

I will start with just having one drum interfacing with an app on the PC and go from there.

Thanks for that link, I think hid is the way to go. You just saved me a ton of time.
 
I'm not a drummer so what I suggest may be just wrong:

Say you have 5 drums. Build each like you did with the single drum. Then under the middle drum, install a hub. So two left drums wire to under the center drum, so do the two right drums. Center drum also wires to the same hub. Then this hub must be connected to your PC.
 
I'm not a drummer so what I suggest may be just wrong:

Say you have 5 drums. Build each like you did with the single drum. Then under the middle drum, install a hub. So two left drums wire to under the center drum, so do the two right drums. Center drum also wires to the same hub. Then this hub must be connected to your PC.

Yes that is a good suggestion :)
 
Back
Top