Sega Mega DRIVE SYNTH

Good call for us all.

1 Like

Updated my schematic after looking at some basic guides for Arduino switches, adding a 10k resistor on each to send the signal to ground when not “on” so the Arduino pin doesn’t float if I understand correctly.

Hoping this makes sense, I’ll probably put it on a strip board next.

3 Likes

Another thing is I was trying to power the Mega Drive from my Euorack power supply with a 7809 voltage regulator, but the regulator got really hot and the Mega Drive shut off quickly. I checked the voltage out from the 7809 and it was 9v when Mega Drive wasn’t connected but dropped to around 5v when it was. The Mega drive works fine from a 9v mains power supply but not from the Eurorack, does anybody know why?

This is the setup with +12v from the Eurorack power supply, I’ve used this for a bunch of projects:
image

2 Likes

sounds like the mega drive consumes more current than the 7809 can pass. 7809 has a shutdown inside when it gets too hot

however with a big enough heatsink it can possibly work! if it doesn’t have a heatsink, find a big heatsink and some thermal paste to pop between the heatsink and the regulator.

im not sure how much current the mega drive uses but maybe!±!!! maybe maybe

however also! this makes me think that the current consumption of the mega drive may overload the whole power supply for the synth, but I guess the only way you’ll find out is either measure the mega drive current consumption. or just try it and if the synth isnt playing happy then yeah it’ll be because the Sega mega drive is drawing too much current. I dont think itll break anything though

3 Likes

I’m also planning on building one of these. @richy486 that diagram looks mostly right as far as my notes except I believe the ENABLE pins on the multiplexers need to be tied to ground, and I think there are 8 algorithms on that one rotary switch. I downloaded the “POLY WORKING” code for the MIDI CC controller, which I assume means poly for sending the CC commands to every midi channel at once? And there is still a second arduino that should do poly for sending the actual notes with its RX tied to MIDI IN and TX tied to MIDI out?

A few other things I noticed


  • There were a bunch of things that looked like voltage regulators on the stripboard. What are those doing?
  • I wonder why LFO enable is a knob and not a switch? It has a data range of 2 in the genmdm manual.
  • Pitch transposition, Octave Division, and Secondary Amplitude Level (ops 1-4) could be added

I also wonder if there is a way to make serial debug messages to dump and save instruments via a USB connection to the arduino. I’m sure you could print the current values of all the pots, but if the Genesis starts in an unknown state, and it and only sends CC messages when a pot’s position has changed, you would need to somehow read the rest from the Genesis or store it as a diff against a preset instrument. I see there was a data capture mode in genmdm firmware v1.03, but apparently there were bugs and Catskull is only selling carts with v1.02. There are so many parameters, it seems important to be able to save a patch.

1 Like

Thanks so much I’ll try this!

@blah thanks for going over the schematic!

I’ll add this

Ah I didn’t understand why there was two arduinos in the video

Not sure about these

Good point!

For sure! Maybe another multiplexer is needed

This would be cool, might be beyond me though, if you have any ideas about how to do this please share

1 Like

@soldierperil Would you mind sharing what you did to get the other channels sounding? I haven’t found any way yet besides loading a preset instrument with CC9 on each channel (and none of the presets seem to match whatever the settings are for channel 1 when it powers up.) Do you have both arduinos hooked up? If so, how did you wire the TX pins / MIDI out? I haven’t seen anything yet that shows how 2 arduinos’ MIDI outs should be wired together.

EDIT: as far as the serial messages, I am not sure it’s possible to do it the way I was thinking as the MIDI messages are also sent using the serial. More likely would need to keep an array of the last CC value for every parameter on every channel, and make a button to send the contents of that array as CC messages for whatever channel you’re on, which could then be sent into a sequencer to save.

My goal for this project is to have a MIDI CC box I can use for any synth, including the Genesis, so I might end up eventually switching to something like a Beaglebone that has an actual OS and filesystem for loading and storing configurations.

2 Likes

Yes, I have six-note polyphony, but notes sometimes hang forever after they’re released and I’m not sure the Omni CC works just yet. The most glaring of problems is the Algorithm CC knob, or as I like to call it, the Circuit Bend the Sound Into Oblivion knob, which is a rubbish name to put on the label as I’ve got to make room for the negative infinity algorithms it’s materialized from the nethersphere.

On top of all that, the whole affair seems really unstable, requiring the code to be reuploaded when things inevitably go wrong, which I’d say would be a trick of the Nano’s limited memory if I knew what the hell I was talking about. :upside_down_face:

As it happens, it’s got to reuploaded again, as the knobs have stopped working.

Basically what you did, only with FL Studio sent directly to GenMDM.

Yes I do, have a look:


Working polyphony, semi-functional omni CC.

Sounds like a dream. Do post detailed steps if you happen to construct such a monster. Unrelated, but it’d be lovely to have a midi controller that could switch between C64 Mssiah app and Cynthcart configurations.

2 Likes

Do the arduinos work individually? I wonder about that connection from TX on the Juha arduino to RX on the main code arduino. I do see a piece of code in the main sketch that looks like it does wait for stuff coming on over Serial and write it, but I am not familiar enough yet to truly understand how that works.

As far as CC Omni, I think the code in the main sketch is setup not to do omni by default unless the omni pin on the rotary switch is HIGH, which it won’t be if you don’t have the rotary switch hooked up yet. You could probably fudge the if statements in updateMuxButtons() to just force it to do omni, and check that it’s sending CC messages for every channel when you change them.

The FM algorithm does severely change the sound. I have just been picking one to stick with. Tweaking that in the middle of a song, who knows what’s gonna happen.

Way worse than any FM algorithm, more like cartridge tilting without the actual tilting. Curse of luck though, I finally got my knobs working and Omni, along with the Algorithm select, is now working perfectly.

Presto code reupload-o!

2021-01-31 (1)

Just a normal Algo select now. Good thing, too. I’d almost given up on the whole project. But if the algorithm glitch happens again, I’ll be sure to record it for you all. I should have done in the first place. It’s the kind of sound that makes you worried your DIY midi controller is about to brick your Sega.

Perfect for stingers.

Now to build the thing!

2 Likes

Updated my schematic with these additions, thanks @blah !

  • Replaced LFO Enable and Ampitude Mod with switches, not sure if these will work on a multiplexer connected to an analog pin.
  • Added second Arduino for Poly mode based on juha’s code and @soldierperil 's picture, thanks!
  • Connected each multiplexer’s Enable pin to ground.
  • Removed Algorithm Switch 1 and 2 from the main Adruino because the code just says “Algorithm ??”
  • Added Algorithm Switch 1 and 2 to the Poly Arduino, i think these are the unlabelled toggle switches on the front panel of LMNC’s machine.

I haven’t added any additional controls yet, trying to get it to the stage LMNC has it.

Does this make sense?

1 Like

@richy486 I think C0-C7 are all taken by the algorithm switch, there are 8 algorithms to choose from. I don’t believe the multiplexers can share analog and digital components, so that may be why LFO enable etc are knobs.

@soldierperil what did you have to do in Juha’s arduino code to rig it to send poly notes without having switches hooked up etc? I can’t get mine to send any notes at all. I hooked it up like yours with the TX pin → RX on the CC arduino. I know my input circuit is right because it passes through notes successfully if I wire the MIDI input jack directly to RX on the CC arduino, so it must be something to do with the MIDI splitter arduino


The Arduino ports have built-in optional pullups, so if you connect the switches to ground instead of VCC you can get rid of those (requires code changes, obviously). See the section on INPUT_PULLUP here:

3 Likes

My only change was making five channels six. It should be on poly mode by default with the pins LOW, but you can route voltage to the pins to test out the different modes and see if that gets you anything.

Double check your connections and reupload the code just to be sure it took. Always a chance it could just be a bad jumper cable. I made sure to test the midi splitting before I routed the MIDI data to the CC Arduino. Just keep in mind all but the first of the FM channels on the Megadrive default to silence without any CC.

1 Like

Wowwww I am dumb. It only listens on MIDI channel 1. My controller keyboard is always set to CH2. No wonder. Works perfectly with pins 2/3 sent to GND. I do notice it drops stuff like BEND though, which would be nice to have. I wonder if there’s a way to listen for that as well as the note data.

@richy486 I’m not sure the 74HC14N is needed either. It seems to work fine with the input circuit with the optocoupler into the poly arduino and the output circuit hooked up to the main arduino.

2 Likes

@blah Thanks so much!

  • Checking the manual, you are quite right that there are 8 algorithms and not 6. Updated to 1P8T switch.
  • I moved the LFO Enable to a digital pin instead because it’s a boolean and sent the unused multiplexer pin to ground (does that make sense to do?)
  • Removed the 74HC14N and connecting the Midi out to the 6N136 Optocoupler directly, removing the 220r resistor.
  • Also marked the Amplitude Mod pins to use a pot with CV even though they are boolean, more like LMNC’s design.

@fredrik Thanks so much as well!
Looks like the Controller.cpp code already sets the button to INPUT_PULLUP in and checking the Notes and Volts video again it seems like the Multiplexer button’s don’t need the pull up resistor either. I updated the “Push Button” and “Toggle Switch” are the off modes ok to be floating (is that the right word?) for both of these?

Updated the schematic again:

I also put the schematic here and added the small updates to the code here.

2 Likes

Also just a silly question, the pots should all be 10k right?

Pots should all be 10K linear. I understand why some of these are knobs now that I have this partially together: it saves a digital multiplexer. I’m probably going to add it anyway since I want switches. Does anyone know if there’s a limit for the number of multiplexers you can use with an arduino?

I also tried to hook up my algorithm rotary switch but it doesn’t seem to do anything. It’s supposed to have the center pole connected to 5V right? I tried 5V and GND but it didn’t change anything. I might try just hooking it up to another arduino directly and writing a quick program to make sure it’s actually working. It passes the continuity tests on my multimeter


Also, what type of switches are the ones hooked up to the poly arduino?

2 Likes

The rotary switch is shown has having +5 V on the center pin with 10k pulldown resistors on the outer pins. So the multiplexer should see +5 V on the pin corresponding to which position is selected and 0 V on the others. Except


I note the orange buttons are shown as SPSTs connecting to ground when closed and floating when open, with no pullup resistors, and the green pots are shown as connecting to ground at one end and nothing at the other, with no voltage source, so I assume the Arduino pin connecting to the multiplexer signal pin has its pullup resistor enabled — otherwise those buttons and pots don’t make sense to my eyes. Is that right? But it seems to me that would play havoc with the rotary switch and its pulldown resistors. If the Arduino pullup is enabled then it seems to me the rotary switch center should connect to ground and there should be no pulldowns, and then what you’d read would be reversed: 0 V for the selected position and +5 V for the others.

TLDR; Yes theres limits, but it might be fine depending.

I was able to run several multiplexers on a single arduino pretty simply. There are limits of course.

Basically, since the multiplexers are taking multiple inputs and tossing them serially one by one, that does slow down what you can do when reading/writing. In a lot of applications this doesnt matter, but the more you add, the slower it gets.

The other consideration are pins. The multiplexer chip i use is an 8 channel analog mux/demux. Thats what im using in this explanation, YMMV. It lets you use it in both directions, works for both analog and digital signals.

Pins 9-11: You need three pins of the arduino for the address select (shared by all multiplexers, as a bus). These are usually using the arduino’s digital pins, since the analog can be used for either analog or digital, but are less common on the board.

Pin 3: The output -MUST- be attached to the same type of pin on your arduino as the component you wish to multiplex. So, an analog component like a potentiometer needs an analog pin on your arduino, but a digital component like a momentary button switch can be digital pins.

Pins 6-8 go to ground.
Pin 16 goes to your power so the chip gets, uh powered.
The rest of the pins (1,2,4,5,12,13,14,15) are inputs.

Because you use 3 pins for an ADDR select, that means for a given address bus, you can theoretically support up to 8 different chips:

000
001
010
011
100
101
110
111

These 8 multiplexers each can share those same 3 pins you use for addressing. Assuming you attach the outputs of the mux to analog pins of an arduino nano, that would use up all 8 of your analog pins. This will still leave you plenty of digital pins.

Now, i have never connected 8 multiplexers to an arduino nano, but its theoretically possible sure. Just know that what you might run into is a problem with the sampling rate of the ADC given it would only be able to sample so frequently. The more you add, the less “smooth” the changes will be. If thats fine in your application, then cool.

PINOUT OF THE CD74HC4051 / 74HC4051:

3 Likes