MIDI send/receive project feasibility with a Nano and an Uno

Greetings!

I've yet to put fingers to keys or pencil to graph paper, but I'm essentially planning on daisy-chaining two and half(-ish) of Amanda Ghassaei's MIDI projects on Instructables.com together, namely Send and Receive MIDI with Arduino and Arduino Audio Output.

I know MIDI is serial, so if I let a Nano handle the sending and receiving portions, could the received MIDI data from an external MIDI controller feeding the Nano then be sent to a single digital input on the Uno before it's output through D0-D7 as each appropriate bit into a DAC IC like the TLC7528CN? Or would I be better off forgoing two separate combinations of Arduino-based μcontrollers and getting a larger, single one, like a Mega?

The end game is to test or troubleshoot analog synthesizer circuitry, with the Arduino(s) interfacing between a MIDI controller and said synth ccts.

Thanks very much in advance!

Can you post a rough schematic showing how you propose to connect these as well as power sources.

1 Like

Don't use D0 and D1 on an UNO, and similar, for the project I/O. They are used by the PC - USB connection and very useful for debugging and status reports..

2 Likes

Sure.

midi_cv_module-hardware_block_diagram.pdf (62.8 KB)

Apologies about the gaudy schematic. I've never worked with DAC ICs, so I'm unsure how best to proceed. Am I correct in assuming that the TLC7528CN could effectively replace the resistor ladder, op-amp buffer, and low-pass filter in Ghassaei's original cct., but not the second op-amp or DC offset adjustment?

Also, have never really worked with microcontrollers before this in any real capacity, so I'm clueless as to whether 10 V into the Uno would be enough to handle the Nano and everything else downstream of it.

Actually it came out good enough to show what you are doing without spending a lot of time looking up the parts. Some simple things for arduinos. Yes a DAC (Digital to Analog Converter) can replace the first block and there are many inexpensive audio amplifiers that will replace the second block.
Rule #1 A Power Supply the Arduino is not!
Rule #2. Never connect anything inductive to an arduino pin.
Never put a voltage on a pin that is greater than VCC (usually 5V or 3V3.
The chip is limited to about 200mA max, and I like to limit the ports to 10mA max although they are rated from 10mA to 40 mA depending on the part.
Always power down when changing parts unless you have spares as you will probably need them. The key is you appear to be somewhat knowledgeable in analog, that is generally true in digital. The difference is analog depends on the value, digital depends on if it is High (1) or Low (0). The main rule is to have FUN!

No it wouldn't.

Tha circuit is an attempt at a R/2R digital to analogue converter. Sadly it is actually rubbish. You can't get the resistors accurate enough for this to work.
There are a lot of circuits like this on the internet and they are all wrong.

Go back and do some real research.

Also there is not enough memory on an Arduino for more than about 3 seconds of sound.

So single words would work but anything longer would simply not fit.

MIDI sends by serial not the sound but a code that defines what note to play by a number from 0 to 127, and at what volume to play it again with a number fro 0 to 127. Finally is a code that says if this is a note on and note off message. This is basically what happens but is vastly simplified. So it is not the sort of thing an Arduino can handle.

1 Like

I knew her cct. used an R/2R ladder, and she professed it wasn't the cleanest sounding, but surely it's at least semi-functional, no?

Right, so what you're saying is not even the most powerful Arduino could handle MIDI words because they're 10 bits? Status, channel, velocity, channel aftertouch, note on/off, etc.? An ESP32 might work, but what would you suggest?

The least significant bits are a waste of time putting in. If you have only 1% resistors then you can only get usefully 6 bits of resolution. The rest is noise. So yes it will function but not very well. The problem is one of monotonicity

From Digital to analog converter - wikipedia

Monotonicity
The ability of a DAC's analog output to move only in the direction that the digital input moves (i.e., if the input increases, the output doesn't dip before asserting the correct output.) This characteristic is very important for DACs used as a low-frequency signal source or as a digitally programmable trim element.

So yes it will function, to some extent.

No I am not saying that. I am saying that a MIDI message and a sound are two different things. The fact that they both can use a serial interface to transport them does not make them the same thing. Which is the impression I got from your post.

So it would be possible to generate a waveform from the Arduino using a look up table, but these sounds would be static. That is they would have a fixed, none changing waveform. Note on / off are easy enough but other things like after touch are subtle effects, not always implemented in professional sound generators.

Then there are things like envelopes, where the volume of the note produced changes over time to give a bit of variety in the note. Finally there are the full blown synthesisers of many types you can implement that have their own characteristic range of sound. On top of all this are effects like echo, reverberation and tremolo. This is a big field.

I have used a more powerful processor for this sort of thing, like an Raspberry Pi Pico 2040, and a Teensey 4.1, and there are many examples of implementing synthesisers on line.

I have been exploring the use of the new Arduino Uno R4 Minima and WiFi to do some simple waveform generation lately.
Like turning a Game of Life into a series of tones, see this video.

Your circuit after the resistor ladder looks suspect. What are these 922 amplifiers? Do they have a real part number? First off you have no power supply decoupling on the chips, and second I doubt you can get the full voltage swing out of them. That is there will be a maximum and minimum voltage they will output, no matter what the input is.

Also the volume control pot, apart from having the wrong schematic symbol, will affect the DC level of the signal, causing distortion of the signal because the whole thing is DC coupled. So that bit of the circuit needs work on it.

As it seems you are just getting into MIDI then I suggest you use an Arduino Micro or Leonardo and just handle the MIDI messages with that an put them out to a MIDI sound synthesisers, like the Adafruit Music Maker FeatherWing.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.