Jump to content



Recommended Posts

From the readme.txt:


Clockbox V1.0                          © 2005 Thorsten Klose (tk@midibox.org)


This application sends a MIDI clock and outputs a 24ppqn signal at CORE::J14

from 48 to 255 BPM

It is also capable of sending the MIDI song position to sequencers which are

able to parse this message (F2 pos_L pos_H)

The user interface consists of an encoder for BPM selection,

a Stop/Pause/Play/Rev and Fwd button, and a LCD, which displays the

selected BPM and the current song position

The hardware is the same like for MIDIbox SID CS Step A (without the SID module)


A precompiled binary is already part of this package:

  o project.hex (can be loaded into MIOS Studio)

  o project.syx (can be loaded into any SysEx upload tool)

Following tools are required to recompile the code:

  o SDCC v2.5.0

  o gputils

  o perl

The details are described under http://www.ucapps.de/mios_c.html


Required hardware:

  o one MBHP_CORE module

  o one DINX1 module (or just a 74HC595 shift register + pull-up resistors)

  o one rotary encoder

  o 5 buttons

  o 2x16 LCD


Configuration steps:

  o check the "general application settings" in main.h if changes are

    required for your hardware setup (normaly not)

  o check the encoder type in mios_wrapper/mios_tables.inc

    By default, the DETENTED2 type is selected

  o the application can be rebuilt with the "make.bat" file

    (type "make" in a DOS command shell)


Description about the most important files:

  - mios_wrapper\mios_wrapper.asm and mios_wrapper\mios_tables.inc:

    The MIOS wrapper code and MIOS specific configuration tables

  - pic18f452.c: exports PIC18F452 specific SFRs

  - main.c: the main program with all MIOS hooks

  - mclock.c: the MIDI clock handler

There are additional .h files for all .c files which contain

general definitions and the declaration of global functions/variables

These .h files must be included into the program parts which

get use of these globals



Download: http://www.ucapps.de/mios_download.html

Interconnections: http://www.ucapps.de/mios/clockbox.pdf

LCD view:


Btw.: this application includes the basics to create a C based sequencer or arpeggiator!

Have fun! :)

Best Regards, Thorsten.

Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...

This is a very cool little implementation!

Reluctant as I might be to shout "Hey Thorsten! How about adding Impossible Feature X??", would it be difficult to add in the shuffle function from the SEQ?  Whether added by you or by the user.  Because a DIN sync clock with shuffle would rule ...

It would also be nice to be able to put out 48 ppq (Korg) sync and 4 ppq (16 pulses per bar), or optionally to read clock from any of these sources or MIDI and output to any other.

Link to comment
Share on other sites

I will keep this in mind for the case that I feel boring ;-)

Shuffle function: the outgoing clock has to be delayed with the same patterns used in MBSEQ

48ppqn: timer has to be invoked with double frequency, 48ppqn pulse has to be generated on each tick, MIDI clock has to be sent on each second tick

4 ppqn: requires a clock divider

Read clock and convert it: similar to MBSEQ (must work like a PLL (phase locked loop))

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

or you can live life on the wild side and connect two midi outputs-jacks to the single output on the core board :)

i've been using this technique successfully for a while now, but it's not recommended fot all situations and may not work with all midi devices.



Link to comment
Share on other sites

or you can live life on the wild side and connect two midi outputs-jacks to the single output on the core board

i've been using this technique successfully for a while now, but it's not recommended fot all situations and may not work with all midi devices.

Do you think it will work with two laptops each using a 2x2 m-audio usb midi interface?

Link to comment
Share on other sites

  • 2 weeks later...

hmm. i made some nice connections over lan to sync and use 2 pc's and 2 laptops (pc's are just my vst hosts) via ipmidi (nerds.de) and of course some midi cables ;-) but it seems that ipmidi isn't able to send/receive clock data.... :-( now i wanna build the little clockbox to kill that problem ;)

Link to comment
Share on other sites

Hi Bionix,

I did some tests quick with midi over lan yesterday

and midi sync works using tobybear's midibag toolkit and midi yoke.

It seems to work ok...

my test setup:


fruityloops (enable send sync)-> midiyoke -> net2mid


mid2net -> midiyoke -> fruityloops (enable midiyoke as controller)

I used fruitystudio for a quick test but this should also work for other hosts

on the other hand a clockbox is a nice alternative, no network headaches :-)

Link to comment
Share on other sites

The clockbox got a new "multi MIDI Out option" based on an idea of Braintu.

It allows to enable/disable the MIDI clocks of up to 8 MIDI clock slaves (sequencers, drum machines, synths) seperately and in a synchronized manner (clock will be enabled/disabled exactly on the next beat)


Update V1.1:

A "multi clock out" option has been added which supports 8 additional

MIDI Outs. The clocks which are sent can be enabled/disabled with

8 seperate play and stop buttons. Changes will be synchronized to

the beat (1/4 note)

This option is based on an idea of Braintu, his full concept can be

found under http://www.midibox.org/dokuwiki/doku.php?id=midimasterclock

Only the stop/play function has been implemented yet, he will continue

on this project.

Technical details about this option: the 8 MIDI outs are available at

J5 of the core module. This port is normaly used as analog input. In

order to ensure, that no short circuit happens if a user uploads this

application on a MIDIbox which has pots or AIN modules at J5, the

MULTI_CLOCK_OPTION flag in main.h is disabled (0) by default.

It has to be set to 1 to get the MIDI outs working

MIDI events are sent over these outputs with the "bit banging" method.

(see mclock.c, MCLOCK_SendMultiPort)

The enabled MIDI clock channels are displayed with 8 LEDs

There is a special schematic which describes the additional

connections: http://www.ucapps.de/mios/clockbox_multi.pdf


Download: http://www.ucapps.de/mios_download.html

Interconnections: http://www.ucapps.de/mios/clockbox_multi.pdf

Best Regards, Thorsten.

Link to comment
Share on other sites

I think you would need to get TK's approval, selling would be commercial use.

You could always use a multi-port MIDI interface and route midi clock out of your mac/pc. This could be done for a similar price... But a MIDIBox is not so hard if you are willing to spend a little time... So like they say, time is money... You just have to choose which one you will spend ;)

Disclaimer: No guarantees. Mac/PC timing may leave you wishing you had built the ClockBox ;D

Link to comment
Share on other sites

We need an external hardware device.. Not a routed signal from a pc/mac.

Why's that? The end result is the same, with the exception of sharper timing, but beggars can't be choosers ;)

Anyway you could get any device that will generate midi clock and a hardware MIDI router...

The midibox is a Do-It-Yourself project so if you don't have any spare time it's probably not really suited to your needs :(

You should quit your job and become a full-time midibox addict ;)

Edit: this talk should be taken to 'sale requests' forum and not continue in this 'News' thread.

Link to comment
Share on other sites

  • 2 months later...

would it be hard to add a decoder to control a divider/multipler of the BPM per clock output? I guess it doesn't have to go that far, perhaps x4 each way to get turn one beat into a whole note in one direction, and to turn a quarter note into a sixteenth note in the other direction?

Link to comment
Share on other sites

Join the conversation

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

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.


  • Create New...