Pages: [1]   Go Down
Author Topic: MIDI "analog" sync: 5 volt pulses  (Read 805 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

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....
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33301
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
(via an analog input)
Why??
It makes much more sense to read it from a digital input.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess I assumed that it had to be an analog input.  That, and I'm probably out of digital inputs.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33301
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

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. 
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 138
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33301
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It depends on the length of the line but if you are worried:-
http://www.thebox.myzen.co.uk/Tutorial/Protection.html
http://www.digikey.com/us/en/techzone/microcontroller/resources/articles/protecting-inputs-in-digital-electronics.html
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks guys.

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). 
Logged

Pages: [1]   Go Up
Jump to: