Skip to main content

Midi Moose improvements: Clock outputs


Midi moose, revision 2

One night I was jamming with my synthesizers. Digitakt was generating beats and sending midi to Acid Moose. I also added modular synth to the mix but getting it in sync with the rest of the gear was cumbersome. I had to connect midi to my midi2cv module, program a midi track with steady 16th notes and use the gate signal as a clock. I started wondering why isn't it as easy as syncing a midi device to Digitakt? I pretty soon realized it can be! I already have an arduino doing other midi stuff inside my midi thru magic box and it had plenty of io pins free! Drill a hole for the connector, solder some wires and write some code and the modular will be in sync with midi! Original Midi Moose post is available here: http://noiseembedded.blogspot.com/2019/04/midi-moose-midi-thru-with-twist.html

If it's worth doing it's worth overdoing!

As there was plenty of io pins free and I have plenty of gear to sync I decided to add more than one clock output. I could also sync the pocket operator po-32 drum machine and SQ-1 sequencer with this. I started drilling the plastic box and managed to fit 6 outputs before it started looking too crowded. 6 was also nice number because I wanted to add some buffering to the outputs and many buffer chips happen to have 6 buffers.

The output circuit

New buffer board
I had some cd4050 hex buffer ICs and decided to try those out. It's not perfect for this task but adding more complex buffers would have required more space and the box was already out of circuit board space and full of wires. I could have probably managed to get a way with just driving the outputs directly with the atmega microcontroller but it felt risky. I took a small piece of strip board, soldered the buffer ic and 1k resistors for each output. Then soldered microcontroller pins to the extra board and outputs to the new output jacks. It became a horrible ball of wires and I hope I will never ever need to open the box again. But it works!
Horrible ball of wires! I hope I will never need to open this can of worms again.

Arduino from command line

I love arduino and I hate arduino. It's the only embedded platform with proper user community and support. Readymade code exists for pretty much everything and there's always a blog post or discussion board thread available when needed.

Arduino IDE is definitely an easy way for a newcomer to enter the world of embedded hacking but for a professional software engineer it's really annoying. The normal practice of dumping all code into one .ino file is so painful, there's no way to add unit tests, etc. It's of course possible to move parts of the code into a library but managing libraries is a mess too.

Luckily there's now an arduino command line tool available. It's still in alpha level but seems to work just fine. Now i'm able to initiate new projects, configure libraries, compile and build the code from my favorite programming environment, the unix command line. I can also split the code into multiple files any way I like and add more tools if needed. For this project I also wrote some unit tests with GTest and configured CMake to build the tests. It would have been cool to integrate arduino_cli also into the same CMake setup but I didn't bother finding out how to do it. I already have some other ideas in mind and wanted to move on as soon as possible.

The Software. Too many options!

I made a simple dev board setup with midi input and one clock output to develop the software.

Analog circuits are simple. The moment you have the schematic ready the feature set is fixed. But if the board happens to have a microcontroller the amount of possibilities explodes. It's all too easy to get carried away with adding all kinds of complexity to the software and make the device almost unusable.

The principle is simple. Midi clock master sends 96 clock messages per quarter note so all we have to do is count those messages and toggle an output pin high or low based on the count.

Unfortunately the traditional clock pulse interfaces are not as strictly standardized as midi clock is. What notes the outputs should send? Many devices expect 16th note clock pulse, some have a config option and some don't. I also figured out that it would be easy to implement a simple integrated clock divider. I first thought it might be a good idea to have a dedicated output for each clock division. After some thinking I figured out I will need more 16th outputs than half note outputs so it might be better to make it dynamically configurable. Updating the atmega firmware to change the output settings felt too difficult so I decided to make it configurable over midi.

I ended up with a solution where each output is configurable with midi CC messages. Settings are stored in EEPROM so configuration will stay the same over resets. Time will tell what setup I will be needing the most. Now it's anyway trivial to change. I might even modulate the clock division with digitakt for some odd polyrhythmic stuff!

Anyway, now my little midi box is even more useful. Code and schematic is available in https://github.com/tvainio/midimoose if you are interested. Time to do some complex patching!

Comments

Popular posts from this blog

Waldorf Blofeld Encoder Fix

Waldorf Blofeld is amazing little digital synth with almost endless possibilities. Unfortunately the rotary encoders seem to start skipping and failing sooner or later. After couple of years of light use my unit started failing too and it became very annoying to use.  First Try I first tried to open one encoder and clean it from inside. It worked ok but these components aren't really meant to be opened and closed again and I never managed to put it back together properly. Encoder shaft was loose and wobbly and it would have failed again soon because the encoder wasn't tightly closed. Proper Fix Luckily it's possible to fix it properly as long as you know how to solder. Current price for the full set of encoders is less than 7 euros. I ordered new Bourns encoders from Mouser: 1 pcs of  https://www.mouser.fi/ProductDetail/652-PEC16-4220FN0024  for the main encoder, this one has detents so it "clicks" when you turn it. 6 pcs of  https://www.mouser.fi/ProductDetail/65

Sunday Soldering: Akai Rhythm Wolf Drum Machine modifications

Sunday Soldering: Akai Rhythm Wolf Drum Machine modifications Akai Rhythm wolf is a cheap analog drum machine. It has a nice old school lo-fi sound but unfortunately Akai left out some quite useful features from the standard setup. Today I decided to modify my unit to better suit my needs. Here are the added mods: Added a resistor to the outer legs of the 'Howl' pot to make the range more useful. By default it's pretty much a switch between clean and a completely destroyed signal. I used 33k. Probably even smaller value would do. Added 3.5mm individual output jacks for all drums. The PCB has nicely marked spots where the individual signals are available but it's actually easier to take them from the volume potentiometers directly. The middle leg gives the signal after the potentiometer so volume also affects the individual outputs. It might have been a better idea to take it before the pot so that it would be possible to silence the signal from the main

Uraltone Mixer and Spring Reverb (and some synth literature...)

DIY kits and literature Bjooks and DIY kits Every now and then I had seen pictures of the beautiful and super interesting Push Turn Move book by Kim Bjørn:  https://www.pushturnmove.com/ . Unfortunately it's not available as an eBook and the price has been too high for me because of the shipping costs. Some time ago Bjørn launched the Kickstarter campaign for his third book Pedal Crush . All the buzz it generated in social media led me once again to the Push Turn Move web page. This time I was delighted to find our local DIY music electronics store Uraltone in the reseller list. Of course I had to buy both of the already published "Bjooks" immediately and while at it I decided to buy some Uraltone eurorack DIY kits too. I have wanted a spring reverb since the days I got my first electric guitar and another mixer in my eurorack wouldn't harm. After a short bike ride to Uraltone I had my back bag full of reading and soldering! Support your local! Uralkit Spring