hi ,
i’ve finished and tested this function ,following the TK’s advise.
i’ve done it synced with the begenning of the pattern (first step)
how it works :
- press the F(x) buton that you have assigned to the half tempo function
the pattern will go at bpm/2 as soon as the first step will be reached.
- press again theF(x) buton ,the bpm will return to normal speed as soon as the first step will be reached.
Note: the bpm outputed to MIDI out won’t be changed ,so if you have delay, arp or LFO synced to the seq BPM on the gear controled by the seq ,they will run at the same speed in the two state.
you need to modify :
- the “app.defines” file, add this atthe end of the file:
HALF_BPM EQU 0x360
2.the “seq_butons.inc” file , add this to the F(x) buton you choose (the F2 buton here)
;; --------------------------------------------------------------------------
;;Â F2 button — implement your favourite function here!
;; --------------------------------------------------------------------------
SEQ_BUTTON_F2
IFSET MIOS_PARAMETER2, 0, return
SET_BSR SEQ_BASE
btg HALF_BPM, 1
bsf HALF_BPM, 2
return
- the “eq_core.inc” file ,search for this part :“increment reference counters (if “first clk” flag not set)”, and add this:
;; ------------------------------------------------------------------
;; increment reference counters (if “first clk” flag not set)
;; ------------------------------------------------------------------
SEQ_CORE_Clk_Reference
;; increment tick counter
incf SEQ_CLK_TICK_CTR, F, BANKED
bz SEQ_CORE_Clk_Reference_ResetT
movlw (4*6)-1 ; we are working with 4 times resolution
IFSET HALF_BPM, 0, movlw (2*4*6)-1Â Â Â ; we are working with 4 times resolution and BPM/2 ********************
IFLEQ SEQ_CLK_TICK_CTR, BANKED, rgoto SEQ_CORE_Clk_Reference_NoOv
SEQ_CORE_Clk_Reference_ResetT
;; clear tick counter
clrf SEQ_CLK_TICK_CTR, BANKED
;; if step display update enabled, request display update
btfsc CS_STAT, CS_STAT_STEP_DISPLAY_UPDATE
bsf CS_STAT, CS_STAT_DISPLAY_UPDATE_REQ
  ;; handle BPM change request  ******************************************************************
IFCLR HALF_BPM, 2, rgoto SEQ_CORE_Clk_Reference_NoBPMC****************************************
movlw 16-1*****************************************************************************
IFNEQ SEQ_CLK_STEP_CTR, BANKED, rgoto SEQ_CORE_Clk_Reference_NoBPMC***********************
  bcf HALF_BPM, 2******************************************************************************
  bcf HALF_BPM, 0******************************************************************************
  btfsc HALF_BPM, 1*****************************************************************************
  btg HALF_BPM, 0*******************************************************************************
SEQ_CORE_Clk_Reference_NoBPMC******************************************************************
 Â
;; increment step counter
incf SEQ_CLK_STEP_CTR, F, BANKED
movlw 16-1
IFLEQ SEQ_CLK_STEP_CTR, BANKED, rgoto SEQ_CORE_Clk_Reference_NoOv
SEQ_CORE_Clk_Reference_ResetS
;; clear step counter
clrf SEQ_CLK_STEP_CTR, BANKED
SEQ_CORE_Clk_Reference_NoOv
here you just have to insert the line followed by the little cross.
i’m sure TK could do better ,and i can’t say if this function have any influence on the realtime behaviour of the SEQ ,but in this state ,it works fine (i haven’t noticed any bugs..)
if some one want to program a display update to see when this function is enabled…