Jump to content

Recommended Posts

Posted

Hello everyone and happy new year!

I haven't posted for over a year, but I'm back on the midibox train. I have built a midibox 64 that I will use to trigger samples using foot pedals. I want to use cheap piano pedals that I already have. That being said, they are normally closed switches. I have already cracked one open and modified it to normally open, but I was wondering if there is an easy way to switch the button behaviour in MIOS for some of the buttons? If I have to, I'll modify them, but I'd rather leave them alone.

Thanks

Justin

Posted

Hi Justin,

welcome back! :)

You only need to invert the button value at the beginning of the USER_DIN_NotifyToggle hook, this could be done with "comf MIOS_PARAMETER2, F" - if only a certain number of buttons should be inverted, you need to check the button number in MIOS_PARAMETER1 before

Best Regards, Thorsten.

Posted

Hey TK,

Thanks for your quick reply. I did as you suggested and I think it works properly - I just wondered if you'd check my work in case I messed up in the ASM!

This is my USER_DIN_NotifyToggle

	movlw 	0x12 			;; load 18 into the WREG
	cpfsgt  MIOS_PARAMETER1		;; Compare the button num to 18 skip if it is > 18
	goto    MB64_BUTTON_Handler	;; if less than don't complement
	comf 	MIOS_PARAMETER2, F	;; if greater than complement
	goto	MB64_BUTTON_Handler	;;

I want to invert all the buttons greater than 18.

I was worried about the WREG - do I need to put the button number back in it after the compare?.

Sorry if my ASM is ugly - it's been a long time....

Thanks Justin

Posted

Hi Justin,

do I need to put the button number back in it after the compare?

some applications require this (not sure if this is the case for MB64), so just add a "movf MIOS_PARAMETER1, W" before branching to the handler.

Sorry if my ASM is ugly - it's been a long time....

it looks very compact :)

Best Regards, Thorsten.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...