Clock div/mult for trilogy/ansible - beta testing

i’ve been working on a clock division / multiplication implementation for white whale, it’s almost done and testing is looking good so far. i’m implementing it as a generic solution, and my plan is to put it in libavr32 so that it can be easily added to other firmwares as well, orca is next, and then at some later point meadowphysics/kria/ansible, perhaps even a TT operator.

at this point i’d like to get a community input on how it should be integrated into the ww UI. the original idea (sorry, don’t remember who suggested it) was to use the clock knob to set div/mult when an external clock is connected. however the new implementation supports more than a simple div/mult, and i’d like to take advantage of it.


clock div/mult factor - you can use both division and multiplication at the same time. so you could divide by 3 and multiply by 4, for instance. i think being able to do this outweighs the convenience of using the clock knob, but it does mean that div/mult must be set with the grid. i’m thinking perhaps the button left to meta could be used to open the clock preference page in the lower part of the grid, and on that page one row can be used to set division and one row to set multiplication, which will give you a range of 1…16 for each. this will also allow you to play with div/mult live - it reacts well to live changes.


the clock knob - perhaps it could be used for a quick select of one of the “popular” options - /2, /3, /4, *2, *3, *4, 3/2, 3/4 etc etc. if you need something else you can still set it on the clock preference page. but maybe it should be used for a different purpose altogether - what about using both knobs for live input, one for A channel and one for B, for instance?


tap tempo vs following the clock - the new clock implementation is able to follow the master clock even when the master is stopped, giving you the tap tempo ability. the downside to this is that you might actually want it to stop when the master clock stops. i think this should be a selectable option, which could be changed on the clock preference page as well (or perhaps this deserves a dedicated button in the top row). also, when “follow the clock” option is selected and div/mult is set to 1/1 it will follow the clock directly - this is so that ww can be used with swing or irregular clock.


internal clock - i think div/mult should also apply to the internal clock as well, so you can play with div/mult regardless of how ww is clocked. what about tap tempo - should it be possible to use it to set the internal clock rate?


clock output - should it still mirror the external/internal clock? i think it’s more useful to output the divided/multiplied clock here.


some information about the implementation: it’s called synced_clock and it has its own internal clock that keeps running at all time. when an external clock is received it calculates the average and adjusts itself accordingly. the average is calculated based on the last 3 taps - this can be adjusted (could also be a configurable option) - more taps means it will be more stable when used with an unstable external clock, but it will react to changes slower. it does detect if a sudden change occurred, in which case it will recalculate the average immediately after receiving a 2nd tap. i didn’t add double trigger rejection - this could be easily added in the future if needed. clock state and options will be stored in presets.


i’ll post a beta version here hopefully in the next couple of days - if anybody is willing to help me test it it would be greatly appreciated!

14 Likes

making some progress, should be able to post a beta version tomorrow - want to try one more idea…
a couple of short videos:

5 Likes

one thing that is possible with tap tempo now - you can store tempo and other sync information for each pattern individually, and it will update as you switch patterns. works for series too. there should probably also be an option for whether to keep the tempo when switching patterns.

8 Likes

well, let’s give this a try. any help with testing will be greatly appreciated (even more so since reflashing firmware will mean you’ll lose your presets!). it seems to react well to both live changes and switching between and sequencing series of patterns with different tempos and ratios, but clocks are a tricky business…

here is how it works. the sequencer runs on its own clock. there are 2 main modes of operation - tap tempo and direct clock. tap tempo will sync the sequencer clock to the master clock (internal, external or tap tempo set with the grid). direct clock mode will simply make the sequencer follow the external clock directly with no div/mult applied - this is so that whitewhale can be used with irregular clock or if you’re using swing. in this mode it will also stop if the master clock stops, in tap tempo it continues on its own even if the master clock is stopped.

at any point you can start/stop the sequencer - this is 4th button from the right in the top row. when it’s stopped you can select next position and when you start it again it will execute that step first.

the 3rd button from the right in the top row (next to meta) opens the clock settings page. on grid 64 this button is already in use, so instead press meta, hold and then press alt (while i tried to make sure it will work on 64 i have no way to test it - i will be happy to adjust as needed if somebody can help with testing on a 64).

the clock settings page: the top 3 rows have the same function as elsewhere, rows 4 and 5 don’t do anything right now. row 6 sets the divisor and row 7 sets the multiplier.

the bottom row is reserved for controls and options. the rightmost 3 buttons are: tap tempo, direct mode (on when it’s lit), and a duplicated clock start/stop. tap tempo will blink at the current clock rate (with div/mult applied), even if the sequencer itself is stopped. the 2 buttons on the left are options for series mode.

let’s talk about patterns and series. each pattern stores not only its own div/mult factor but also its own tempo. if you have the master clock active it will always adjust the current pattern’s tempo (say, if you’re using the internal clock as your master clock, since it never stops). but: if you insert a dummy cable into the clock input, or if you plug your clock source but stop it you can now use the grid itself to set the tap tempo. this means you can select different rate for different patterns. or you could copy a pattern to another one and just change division or multiplication.

when you switch between patterns and there is no master clock supplied the tempo will change to whatever the new pattern uses (it will still do this even if your master clock is ticking - but in this case the pattern will adjust its rate after 2-3 taps anyway…). if you now go into series mode it will update the clock as it switches between patterns - this can be used for some really wild sequencing, especially if you have random selection from multiple patterns!

you might not want to use individual settings though when running in series mode - this is what the remaining 2 options on the clock settings page control. bottom row, 2 leftmost buttons select whether to keep tempo and whether to keep div/mult ratio when switching to the next pattern. when you switch out of series mode it will go to whatever the pattern has regardless of these settings - in single pattern mode the pattern tempo settings always take precedence. pattern and series settings are stored with presets.

look at this wall of text - it’s not that complicated, really! here is the hex file, give it a try!

whitewhale.hex (135.9 KB)

7 Likes

I’d love to try this out, but I’m still waiting for somebody to sell me a WW :slight_smile:

Awesome work! I’ll try to flash mine and play with it a bit later this week. Out of curiosity, is this branch up on Github somewhere?

1 Like

Great work! Will install tonight and see what magic lies within.

1 Like

not yet, i’ll post it tonight!


@emenel if you on MW check out https://www.muffwiggler.com/forum/viewtopic.php?t=177432


one thing i forgot to mention - WW.SYNC remote command will also work as tap tempo, so you could feed it triggers from TT and it will sync to that. what i haven’t considered is also making it work in direct clock mode - i’ll add that.

1 Like

Thanks! I just messaged that seller.

1 Like

OK, installed. I’m not sure I entirely get the series mode switches, and will need to read that again. Should I be able to override the external clock by turning off the mode key (2nd from right bottom row) and on the tap tempo key? I’m getting a wonderful trill/glitch effect tapping when it’s off, and I have an external clock connected. Ah, just re-read and saw that the external clock needs to be stopped. Need to play some more, but so far so good :slight_smile:

1 Like

yeah, basically if it’s in tap tempo mode (direct clock is disabled) it will use any incoming clock to calculate tap tempo, be it the internal clock, the clock input, the tap tempo button or WW.SYNC - so yeah, you can use it to create these glitchy effects by syncing it to, say, an external clock but then injecting random clocks with the tap tempo button. you can see an example of that at the end of the 2nd instagram above.

and yeah, if you just want to use tap tempo either insert a dummy cable into the clock input or stop the external clock.

so cool i’ve been watching on instagram
this may be obvious or perhaps im missing it but can each row div/mult separately?

you mean each CV/trigger track? unfortunately no, that would be a much more major undertaking (and would need a significant UI change).

1 Like

i’ve pushed the code to github, here is the branch: https://github.com/scanner-darkly/whitewhale/tree/clockdivmult

once testing is complete my plan is to move synced_clock to libavr32, so this is not PR ready yet.

1 Like

I’ll try to test it today. Thanks for the work ! It sounds like a major improvement.

1 Like

great scanner!!! thanks so much,
downloading

1 Like

I really like this feature!

You might have mentioned that tap tempo only works if there’s a dummy cable in the clock input, but I missed it somehow, and then eventually realized how it worked.

1 Like

yeah, the alternative to that would be to disable the internal clock unless you have direct clock enabled but this would be more confusing as by default it’s in tap tempo mode, so it would be stopped until you enable the direct mode.

the easiest way to think about it - in direct mode it follows the clock exactly, whether internal or external, and the button is ignored. in tap tempo mode any incoming clock - internal/external/the button - will be used to calculate the tempo. if you only want to set it with the button you have to disable both internal and external clock by inserting a dummy cable (or stopping the external clock if it’s connected).

Well, then I guess I couldn’t see how to get it out of direct mode. But inserting a cable makes the button work, so I’m happy.

1 Like

if inserting a cable made it work it means you were already in direct clock mode - otherwise the button would be ignored. i should clarify the statement above - if you’re not using an external clock direct mode has no effect (since the internal clock is always regular anyway). perhaps the mode button can be dimmed in this case?

the UI can be tweaked to be more intuitive - just needs the right compromise between that and providing most flexibility.