I have a project which will require me to have my arduino listening (via an analog input) for 5 volt pulses at 15ms at the beginning of each MIDI step. Is this just a simple analogread for voltage at 5 volts (1023)?
I then have to turn this into a MIDI clock msg, which will be sent out the MIDI port....
(via an analog input)
It makes much more sense to read it from a digital input.
I guess I assumed that it had to be an analog input. That, and I'm probably out of digital inputs.
You can use all the analogue pins as digital pins input and output. Just refer to them as pin 14 for A0, pin 15 for A1 and so on. Roy you can simply use A0, A1 etc.
I'm finally getting back to this after being side-tracked on the TFT part of my project. Anyway, So do you think I need anything like resistors (220ohm?) to guard against any bad voltage spikes? In theory, there shouldn't be anything over 5v coming from my Korg.
If you want to protect it from spikes you have to use a cap.
The korg you're referring to, is monotron/monotribe/volca ? They send 5v pulses, but who knows? The best way
is to use 2 diodes, a cap and a resistor. Check it on grumpy mike's page.
Anyways i'm not sure what you're trying to do. But i suppose you're making a sequencer and sync it to korg master analog clock...
Then you want to send midi clock messages with the tempo of the korg clock? Just remember one thing, midi clock is 24ppqn. And the analog clock generally is 1ppqn
It depends on the length of the line but if you are worried:-
the analog master clock I have sends a 5v pulse at the beginning of each step (16 step sequencer), so in theory it should be sending 4ppqn. So I see what you're saying about trying to convert it to MIDI clock (24ppqn). I've written the code to take a given tempo and send midi clock from that, so maybe I could use that to some degree.
I need to confirm what my master clock sends first (in terms of how many ppqn).