[sdiy] MIDI to Arpeggio clock

Matthew Smith matt at smiffytech.com
Sat May 2 04:20:05 CEST 2009


Quoth Jason Proctor at 2009-05-02 11:14...
> arpeggiator clock inputs - the ones that use 1/4" jacks - are usually 
> designed to interface to pre-MIDI stuff and are based on 16th notes 
> rather than 24ppqn as such. so the conversion process listens for the 
> MIDI start command, then sends 1 clock pulse for every 6 MIDI clock 
> messages.

If pulse duration isn't an issue (unit clocks on rising or falling edge)
code would be as simple as having the UART receive interrupt doing this:

* Set a counter to zero
* Read UART
* is it 0xF8? (go back to sleep if not.)
* (It is 0xF8) increment counter.
* Is counter value 3? (ignore if not.)
* (Counter value is 3) set counter value to 0, toggle output pin.

(In case anyone wonders why Jason says 6 and I say 3, pulse consists of
an on and an off.)

That will give you a 50% duty cycle 16th note square-ish wave, all in
just a few lines of interrupt service routine.


-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business:      http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn:      http://www.linkedin.com/in/smiffy
Skype:         msmiffy
Twitter:       @smiffytech



More information about the Synth-diy mailing list