creatorlars Posted October 10, 2007 Report Posted October 10, 2007 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? Quote
stryd_one Posted October 10, 2007 Report Posted October 10, 2007 just solder the jack to the same leads of the button, right? ;) Quote
creatorlars Posted October 10, 2007 Author Report Posted October 10, 2007 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 beginningMaybe this should be in the MIOS forum. Quote
bugfight Posted October 11, 2007 Report Posted October 11, 2007 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 beginningMaybe this should be in the MIOS forum.i'm prolly not the guy to tell you how... but here's my takethe 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. Quote
creatorlars Posted October 11, 2007 Author Report Posted October 11, 2007 great! thanks for your help. i'll be sure to post my results when i get around to this. Quote
stryd_one Posted October 15, 2007 Report Posted October 15, 2007 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.9fTimer1 - 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) Quote
TK. Posted October 16, 2007 Report Posted October 16, 2007 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. Quote
creatorlars Posted October 18, 2007 Author Report Posted October 18, 2007 Great! Thanks, TK. I will post my results. I am wrapping up other projects, so I won't begin my SEQ for a couple weeks, but it will happen fast. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.