To read MIDI-clock on an Arduino one needs a galvanic separation by an opto coupler. I used a GNY17-2. Use of other ICs (6N137, 6N138 or 4N28) are also possible and the schematics can easily be found on the web.
Parts list
-Resistor 220 Ohm
-Resistor 100 kOhm
-Diode
-opto coupler IC GNY17-2
-5-pole DIN female connector (180°)
-MIDI cable
-MIDI sync master (here: Roland TR-505)
-Arduino (here: Arduino Mega. For this demo also Arduinos with less input and output channels will work)
Schematics
The resistor connected to the MIDI jack is 220 Ohm, the other resistor is 100 kOhm.
As MIDI clock genarator a Roland TR-505 was used.
As LED I used the SMD-LED on the arduino board. You may also connect one to PIN13 (don´t forget the resistor to ground).
For a first attempt to sync the sequencer to MIDI-clock I used the software template of littlescale. Changes were so far only made in the Sync() function.
Software
The following code lets a LED light for the first half of a bar, while it is off for the second half of the bar. Please note that the delay() function was avoided and only clock_step was used for syncronization.
that's very interesting !
ReplyDeletethere is not that much many projects like that on the web.
you're in my bookmarks !
Thanks, the code is not perfect at the moment, but I will improve it when I have time...
ReplyDeleteHow about a GIANT sequencer/drum computer?
ReplyDeleteA wall of lets say 20x20 cm plexiglas cubes with leds behind them and touch sensors.
8x5 for kick, snare, hats, toms, whatever.
I know what i'm gonna make this summer ;)
Thanks for the code mate.