[sdiy] DIY MIDI clock to sync pulses

Seb Francis seb at burnit.co.uk
Wed Aug 16 00:59:06 CEST 2006


Hi Louis,

Louis van Dompselaar wrote:
> Hi
>
> Can any recommend me a simple midi clock to sync pulses circuit,
> preferably PIC based?
>

You can very easily adapt the Box-O-Trix code ...

Look at the "MIDI TO TRIGGER sub-circuit" here:
http://burnit.co.uk/sdiy/index.php?page=boxotrix&subpage=schematic
This is your basic circuit (this one shows 2 gate outs).  No crystal 
needed with a PIC16F688

Get the source code from here:
http://burnit.co.uk/sdiy/index.php?page=boxotrix&subpage=code
Look in main.asm
You need to insert a very small amount of code into subroutine 
"ProcessMIDI_System"

e.g. something like ...

; Test for MIDI clock (=0xF8)
movfw MTEMP1
sublw 0x08
btfss STATUS,Z
goto NextTest

; Toggle gate 1
movlw 4
xorwf PORTC

NextTest
; Test for MIDI start (=0xFA)
movfw MTEMP1
sublw 0x0A
btfss STATUS,Z
return

; Set gate 1 low (or whatever you want the starting state to be)
bcf PORTC

return

And you will want to disable the note on messages changing the state of 
this gate output - look in ProcessMIDI_Note* and just comment out the 
lines that change PORTC.

Hope the above code is correct .. I've been programming dsPICs recently 
so my 16F* assembly may be a bit confused ;)

Seb





More information about the Synth-diy mailing list