Anushri clock: midi (24 ppqn) IN -> euro (4 ppqn) OUT

Hey folks -

I’ve got Anushri at the heart of my eurorack, acting as a primary voice and as a midi-to-cv/gate/clock module. It works really well for this… but there’s one bit I can’t figure out: I’m sending Anushri a MIDI clock at 24 ppqn, but would like the clock OUT to put out 4 ppqn to interface more nicely with some eurorack modules. Ideally clock IN would be able to take 4 pulses as well, but I’m more concerned about the output right now.

Simply changing the ppqn system setting (via hold+drum) to 4 ppqn won’t work, as that will change the way midi is interpreted (the drums will go too fast). I’d like to take MIDI at 24 and put out 4 at the same time.

I’ve been poking around `` trying to mess with `clock_division` and `clock_internal_rate_compensation` values, but I haven’t found the secret sauce yet. I’m also not entirely sure what `clock_internal_rate_compensation` really does.

I’ve got my own fork on github and have been running the firmware with a handful of modifications. So I’d be quite happy with a solution that would “break” some functionality for others, as I could just run it myself. Anything that would accomplish the behavior described.

Anyone have any suggestions? Is this even possible? It seems like it’s programmed to have one global clock… but I’d love to just intercept the MIDI clock as soon as it hits the system, reduce it to only produce one clock event every 6 midi-clock events, and run the global clock off of that reduced rate. Seems doable conceptually… Thoughts?

This seems like a useful thing in general… I think that the ppqn setting should just affect the clock in and out jacks leaving the MIDI ins and outs sending and receiving at 24 ppqn if it’s doable. It doesn’t really make sense to change the MIDI timing resolution, because AFAIK it always runs at 24ppqn. I’m guessing it only changes as a side effect rather than deliberately.
I’m afraid I can’t help you, I just find it an interesting topic and would find this mod useful if you ever get it working. In fact, I would vote to include it in the main branch.

> t doesn’t really make sense to change the MIDI timing resolution, because AFAIK it always runs at 24ppqn

The point is to allow you to create sequences with a different step resolution. Trade-off between sequence duration vs resolution…

Change to always use 24 ppqn when the clock comes from the external MIDI:

Before line 340, add this:

uint8_t clock_pulses_per_step = midi_generated ? 6 : system_settings.clock_ppqn();

Then replace line 340 by:

if (clock_counter_ >= clock_pulses_per_step) {

To force the clock output to match the sequencer’s clock, move the line clock_pulse_ = 8; inside the “if (clock_counter_)” block

So just to be sure I understand, making these two changes will achieve bpm123’s desired behavior of accepting 24ppqn via MIDI and spitting 4ppqn out the clock out jack if that division is chosen in the resolution settings?


For what you’d want to do (spit 2ppqn), the ::Clock method would look like this

Also, set clock_out_counter_ to 0 in StartClock();

And declare it in the VoiceController class.

Thanks for the help! More clarification for a n00b who still barely understands what’s going on:

>Then replace line 340 by:
if (clock_counter_ >= clock_pulses_per_step) {

So this should replace lines 340 thru 342 ?

if (clock_counter_ >= clock_divisions[system_settings.clock_ppqn()]) {
clock_counter_ = 0;

And again, I apologize for my ignorance but I have no idea what I’d have to do for this:

>Also, set clock_out_counter_ to 0 in StartClock();
And declare it in the VoiceController class.

I have posted the exact code modifications.

To add a new static variable in the class:

Add a line “static uint8_t clock_out_counter_;” there

Add a line “uint8_t VoiceController::clock_out_counter_;” there

Got it! Thanks!


I’m considering building 1 (or 2) of these for a drummer. He recently borrowed an SH-101 for a live performance, entering sequences and triggering it via drum-trigger(piezo) > Alesis I/O (midi) > Kenton Pro-Solo (gate)
The setup is expensive and clumbsy (but sounds good) and the Anushri seems like a great replacement. The only thing i’m a litte worried about is the 4/8/24 ppqn clock instead of a single gate on the SH-101 to step the sequencer.
It appears you were discussing firmware modifications above? Would it be possible/doable to get the Anushri to step on a single gate trigger or midi note input? In the latter case a drum trigger via Alesis I/O would have us in business.


@chaosmoon: Pretty sure 4 ppqn IS one step per pulse? I think the sequencer and drum machine run at 16 steps per ‘bar’ (assuming 4/4), in other words each crotchet has 4 steps, so 4 ppqn would be what you’d want.