Jump to content

MBSEQ Footswitch Inputs?


creatorlars
 Share

Recommended Posts

As I understand it, it's not really a native control -- but how involved would it be to add footswitch input(s) for the MBSEQ? 

For my own purposes, having one footswitch for transport (step to play, step to stop, double-step to rewind to beginning) would be all I need -- but, of course, having 2-3 footswitch inputs, assignable to any parameter in the firmware, would be ideal.  If it's not too difficult to develop, I'll be glad to help code it.

Setting a single footswitch input to a single button (like "Play") would I assume, be easy... just solder the jack to the same leads of the button, right?

Link to comment
Share on other sites

Sweet, that's what I thought.

How easy of a source code hack would it be to add footswitch functionality such as what I described for play/stop/rewind to beginning?  I imagine this would be a piece of cake... just connecting the footswitch jack to an extra DIN pin and writing new function(s) that would call the already-in-place transport functions?  But I want to make sure I'm not getting in over my head here.

I guess it would be three cases?

-when pedal is pressed...

--if transport is playing, stop

--if not, play

--if less than .5 sec since last press, stop and rewind to beginning

Maybe this should be in the MIOS forum.

Link to comment
Share on other sites

How easy of a source code hack would it be to add footswitch functionality such as what I described for play/stop/rewind to beginning?  I imagine this would be a piece of cake... just connecting the footswitch jack to an extra DIN pin and writing new function(s) that would call the already-in-place transport functions? 

that's the basic idea, not too difficult but not quite a piece of cake.

I guess it would be three cases?

-when pedal is pressed...

--if transport is playing, stop

--if not, play

--if less than .5 sec since last press, stop and rewind to beginning

Maybe this should be in the MIOS forum.

i'm prolly not the guy to tell you how... but here's my take

the only trick will be the timer.

you will need a few vars to make this happen, at least

  -a counter (say dblclick_cnt reset on 1st click)

  -a var (say dblclick_chk) to indicate you are looking for a second click (because counter will loop)

you will need a timer to inc the counter (may be a mios func you can reuse)

on click,

  if dblclick_chk AND (counter < DBL_CLICK_DELAY)

      set dblclick_chk false

      call dblclickfunc

  else

      set dblclick_cnt = 0

      set dblcick_chk = true

      call clickfunc

(on double-click the click function will be called on the 1st click, of course)

another switch function i've found useful is the long press. (if switch is held down for a while)

suggest you post in assembly programming forum (search first though)

just ask about double click, doesn't matter that it's a footswitch,

that's just a switch like any other in code land.

Link to comment
Share on other sites

you will need a timer to inc the counter (may be a mios func you can reuse)

All that advice was bang-on as usual bud.

As for the timer, you could use TIMER0 if you don't have AINs and are using MIOS >= 1.9f, but I'd probably increment it with SR_Prepare, which ticks every 1ms.

FYI:

Timer0 - 100ns - AIN Sampling. Available as a counter after MIOS 1.9f

Timer1 - 1ms - SRIO, Message and DIN Debounce counters, GP counter.

Timer2 - Buh? Seems to be pretty much unused.... IIRC the PWM peripheral uses it, but that thing's still a mystery until someone needs it badly enough ;)

Timer3 - * - User Timer (Calls USER_TIMER) (I read that ~6.5ms is the default, but you can/should set it)

Link to comment
Share on other sites

The easiest way is to add the code which handles the delay into an existing timer hook.

Normaly I'm using the SRIO hooks (USER_SR_Service_Prepare or USER_SR_Service_Finish) for this, as they are called each mS independent from the other timers. Even the names indicate, that they are used for SR operations, you can also use them for other tasks w/o conflicts.

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...