Go Down

Topic: Making a MIDI merger (Read 2290 times) previous topic - next topic

CptCredible

Feb 16, 2012, 07:39 pm Last Edit: Feb 16, 2012, 07:41 pm by CptCredible Reason: 1
Hello.

I am Daniel and I want to have a midi merger, but they are not cheap, and they are usually too big and heavy for my liking, so I want to make my own.

Because the only microcontroller i know how to program is the Atmega328 with arduino bootloader, and because the atmega328 only has one RX pin I came up with the following solution for receiving potentially simultaneous midi messages and making sure to output them one at a time. This is my idea:



although I didnt illustrate it all the atmegas will share 5V and GND

I would love it if you could tell me that this was a stupid idea and that there is a much easier way to achieve what I want to do.

I even have a handfull of attiny85s lying around, Could i do it with them do you suppose? i.e. can i make it go at 16MHZ and stil have RX and TX pins and a way to set and read the flag?

Thanks for any light you might shed on this.

Daniel

CptCredible


mymaestro

my plan was just to use the Arduino Mega; it has three serial ports.

CptCredible

Did you do it ? and arent those chips a bit of a hassle to solder, I'm not that into leaving my arduino inside finished projects.

mymaestro

I haven't started yet.
I don't mind keeping the Arduino inside the project. I'm not mass-producing anything and I can take the project box apart easily enough.
I'm going to use an old KVM switch - the type for the ancient AT keyboards, since they have the same DIN sockets as MIDI.

CptCredible

Cool, let me know how you get along, i think i'm going to see if i can do it by running software serial in parallel with ordinary serial, not sure it will buffer everything properly though, so i might lose some data.

Andy2No

#6
Apr 16, 2016, 11:36 am Last Edit: Apr 16, 2016, 11:43 am by Andy2No
Hello.

I am Daniel and I want to have a midi merger, but they are not cheap, and they are usually too big and heavy for my liking, so I want to make my own... I came up with the following solution for receiving potentially simultaneous midi messages and making sure to output them one at a time. ...
I would love it if you could tell me that this was a stupid idea and that there is a much easier way to achieve what I want to do.

I even have a handfull of attiny85s lying around, Could i do it with them do you suppose? i.e. can i make it go at 16MHZ and stil have RX and TX pins and a way to set and read the flag?

Thanks for any light you might shed on this.

Daniel
This is an interesting approach, Daniel.  Did you get any further with it?

It hadn't actually occurred to me to use multiple CPUs with a shared flag, but it makes a lot of sense.  Trying to do it in software on a single CPU seems to raise more problems.

Would each CPU run the same code?  I'd prefer to give one priority of the other(s), but it could do that by reading an input pin, with a jumper or similar, I suppose. 

I think prioritising could help - maybe daisy chaining for multiple inputs, otherwise there's a remote chance of a clash, plus there's usually going to be a main stream of data (e.g. from a keyboard or wind controller), and additional streams from things like expression pedals.  Also, you might want to allow for totally locking out the other CPUs during a Sysex data transfer.

I guess the flag could be made to physically time out - e.g. a simple RC circuit that discharges itself in a few milliseconds, if it doesn't get reset by a CPU saying it's finished with it - e.g. with transistors to charge and discharge the capacitor quickly, to set and reset the flag, and a resistor to discharge it slowly to time out, as a safeguard against locking up, for some reason.  Normally, a CPU could pulse the base of the Set transistor, but could hold it for Sysex transfers.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy