Tap and bpm

Hi,
I’m trying to control the BPM to send to a drum machine
so I tap a midi controlled foot pedal which triggers a drum vst tempo based on the foot tapping.

the problem I have is if the tempo tap read from the pedal is wrong it throws the drum machine

I did the following

// Called when the tempo is changed
On TempoChanged(newBPM : double)
  Print(newBPM)
  SetWidgetLabel(TempoLabel,Round(newBPM))
    //if newBPM < 40
    //then
    //    mybpm = newBPM * 2
    //end
    //if newBPM > 190
    //then
    //   mybpm = newBPM /2
    //end
  //if mybpm < 60 then mybpm = 60 end
  //if mybpm > 190 then mybpm = 190 end
  //SetBPM(mybpm)
  //Print(mybpm)
  EnablePlayhead(True) 
End

there problem is the tempo change sets the bpm, which retriggers the tempo change.
can anyone think of a way to do this?
Thanks
Damian

I think that is working as designed.

yes I know, I’m looking for another way to do this
what I need is to detect that the tap tempo has changed but not to react to the setBMP as a tempo change or it loops back again
or a completely different way to do this
any help gratefully received
thanks

I dont understand this, if you tap the tempo and tap it wrong, of course it will be wrong. But why should it throw the drum machine ? Only starting or restarting the playhead is supposed to start the drum machine.

So if you don’t like the drum machine to be started when the tempo change, why did you program a GPScript that does exactly that ?

ok its getting too complicated,
I want to tap a midi pedal that gets the tap tempo bpm
If its tapped to slow or too fast to have some scripting to correct it in a fixed range and then set the bpm base on this corrected tempo
how can I do this ?
thanks
Damian

Do you mean something like in this example? If you tap below 70, it sets tempo to 70bpm, and if you tap above 140 it sets tempo to 140bpm.

On TempoChanged(newBPM : double) 
    If newBPM < 70 or newBPM > 140 then 
      If newBPM < 70 then SetBPM(70)
      Else SetBPM(140)
      End
    End
End

Yes you can do this, but I don’t think it makes sense. Did you see that there are different tap tempo algorithms to improve tapping operations? You cannot really correct an incorrectly tapped tempo by clipping it. I think it would even be better not to take an out of range tempo into account than to clip it… but it’s me…

1 Like

thanks I’ll give it a go

oh no where are the different algorithms?

3 Likes