TK.

Clockbox

83 posts in this topic

From the readme.txt:

[tt]

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

===============================================================================

[/tt]

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

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

LCD view:

clockbox_lcd.gif

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

Have fun! :)

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Btw.: this application includes the basics to create a C based sequencer or arpeggiator

As usual, TK, your timing is perfect, pardon the pun.  I've been looking into building a simple 16 step sequencer with some borrowed MIOS code recently.

I've started a new thread to discuss it.

Share this post


Link to post
Share on other sites

Fine - so just call your functions from MCLOCK_Tick() in mclock.c - it contains all events you need to control a sequencer (Start/Stop/Pause/Clock) :)

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

Is it possible to have two midi outs using the LTC module to sync two Laptops to the midiclock box?

Share this post


Link to post
Share on other sites
Is it possible to have two midi outs using the LTC module to sync two Laptops to the midiclock box?

Yes, no problem ;D

Share this post


Link to post
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.

cheers,

michel

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

i don't see why not - give it a try!

i would imagine that the biggest concern in your case might be midi-data drop-outs. let us know how it works out for you.

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
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:

pc1

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

pc2

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 :-)

Share this post


Link to post
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)

[tt]

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

[/tt]

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

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

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

Awesome, thanks TK and braintu!

I've been watching that project in the german forums, I was wondering what was going on ;)

Share this post


Link to post
Share on other sites

hey, that's a great implementation! i'm quite impressed.

regards,

michel

Share this post


Link to post
Share on other sites

Yeah! Very cool and useful guys.. And could someone build a custom clockbox for a private order for selling it...we really need one..but we can buld it because we don't have any experience..

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

We need an external hardware device.. Not a routed signal from a pc/mac. And what's the worst we don't have any time at all to spend=) So we have to spend money you see.. So

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks then.. :'( We'll try to find another solution.. We have no time at all to build it..because it is needed for a work which couldn't be delayed at all.. so that's a pity... :(

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

From my point of view this project is finished, it was just a toy, and I don't use it by myself...

However, this project is open source, maybe somebody else feels motivated to program such a feature?

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

Hi Ziggy,

I will post an example tomorrow (only tempo division),

do you need the features from v1.1? (eg MTC support)

using the v1.0 makes it a bit easier to code  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now