Jump to content

GameBoy Sync


bill

Recommended Posts

Hello,

I've been very interested in sync24 feature in the clockbox program.

I'm a chiptuner, and play a lot with gameboys and the LSDJ program. http://www.littlesounddj.com/lsd/

LSDJ provide a sync feature, similar to sync24, with the difference that the gameboy do not wait for pulses,

but bytes (so 24 bytes per quarter notes)

sync24-to-lsdj.gif

gb-link.gif

In clockBox, you just have to change the SR_Service_Prepare() func so it send 8 pulses (or 11111111 )

void SR_Service_Prepare(void) __wparam
{
  // this function is called each millisecond
  // we are using it to output the MIDI clock at Pin D.4 for 1 mS
  if( mclock_pin_state.CLK_REQ ) {
    mclock_pin_state.CLK_REQ = 0;
    //Send 8 pulse, so LSDJ can read a byte !
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
    PORTDbits.RD4 = 1;    PORTDbits.RD4 = 0;
  } else {
    PORTDbits.RD4 = 0;
  }
}

As simple, and it works GREAT !!!  8)

About the sync 24 :

On the clockbox example, pulsewidth is 1ms long,

I've read somewhere that the pulse length sould be at least 2ms, so any device could read it (some beatbox are expecting this, so maybe you have to change the original code a bit to fit your hardware)

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...