i found i have two prefered techniques:
_one where you only generate a clock pulse like usine sync modules. (think it's more cpu efficient)
the pulse is linked to the start inlet of module, set to button mode, to make it simple and test to understand:
(but then have to enter loop length in ms then on module then, with ie a tempo to delay conversion, a bit boring)

_the second use probably a tiny more cpu but allow more things and can dynamically swich clock.
it's controlling directly step or pos input of module, via an absolute way.
when using this technique, the pb is often need math braining to convert clocks in steps.
pb is you generally can have different nb of steps/bar in the module than a step/beat. here is a wiring
that match module desired nb_steps/bar, with a precision (refresh speed ratio) .
as i often use this and wanted several clocks (dividers), i made a simple script i often use to make it easier, here it is:
Code: Select all
/////////////////////////////////////////////////////////////////////////////////////
// PPQ Clocks gen_ 23fx2K10_ generate clocks from PPQ, each next one beeing divided by 2
///////////////////////////////////////////////////////////////////////////////////////
// Enter a nb of max bars, that will correspond to the longest cycle (clock0) ie 4bars
// then clock1 will be clock0/2 ie 2 bars ect.
// to match module enter the nbof steps/bar you want. ie if a line module
// with a 32 step/bar enter 32.
////////////////////////////////////////////////////////////////////////////////////
// parameters declaration
////////////////////////
const NB_CLOCKS = 5; // nb of clocks output to generate.
/////////////////////////////
var PPQIN, STEPSperbar, MaxBars, SUBDIV: Tparameter;
var CLOCKS : Array of Tparameter;
var i: integer;
var PREC: single;
/////////////////////////////////////////////////////////
// initialisation : create parameters
procedure init;
BEGIN
PPQIN := createParam('PPQ IN',PtDataField); setIsOutput(PPQIN,false);
StepsPerBar:= createParam('StepsPerBar',PtDataField); setIsOutput(StepsPerBar,false);
MaxBars := createParam('Max Bars',PtDatafield); setIsOutput(MaxBars,false);
SUBDIV := createParam('SUBDIV',PtDatafield); setIsOutput(SUBDIV,false);
setArrayLength(Clocks,NB_CLOCKS);
for i:=0 to NB_CLOCKS-1 do begin
CLOCKS[i]:= CreateParam('Clock'+IntToStr(i),PtDataField); SetIsInput(Clocks[i],false);
end;
END;//INIT
////////////////////////////////////////////////
// Callback procedure
var A,READSTEP,MODSTEP: integer;
Procedure Callback(N:integer);
BEGIN
If (n=PPQIn) then begin
PREC:= MAXS(1,getValue(SUBDIV));
A:= round(getValue(stepsPerBar));
for i:= 0 to NB_Clocks-1 do begin
READSTEP:= round(getValue(PPQIN)*PREC*(A/4));
MODSTEP:= round((getvalue(maxBars)*(A)*PREC) / power(2,i));
SetValue(Clocks[i],(READSTEP mod MODSTEP)/PREC);
end;
end;
END;//Callback
////////////////////////////////////////////////////
It picks total PPQin, then if enter nb of maxbars and nb of steps per bar (ie want a line steps of 32 steps per bar) of 4bars
for longest loop, it will generate a step clock0 matching, then clock1 will be divided by2 ect (2bars).
can adjust also the reading precision (refresh speed/precision of clock).
i use this and send clocks to busses, then the modules getbuss coresponding can dynamically change with the listbox bus name trick.
quite handy, also here it's only binary, need to find time to make a more modular...
maybe can be useful for ya too
