Jump to content

controling specific button type LEDS with midi events


analogue_mo
 Share

Recommended Posts

Hello everybody,

Altough I don't consider myself as a newbie anymore (I'm building my 2nd MB =) ), this is my first post in the forum...

I'm building a simple customized midi controller for a MAX5 application that I've been developing. Its kind of a FX processor with 9 FX to choose from, and it features the possibility of recording and playng a 6 second sound sample.

I'm using the midibox64 project as the source for this controller:

-core stuffed with PIC18f452

-1 DIN (2xShift Registers)

-1 DOUT (2xShift Registers)

each FX has its own button and LED(9)....the buttons are set to onOnly mode and I've changed their behaviour so that when one FX button is pushed it gets illuminated while all other FX button LEDS go off.

This was done according to an article that I found a while ago here in the forum (sorry!I dont have the link anymore....)

The way to achieve this was to modifie "src/mb64_buttons.inc".......

Here´s the code for sharing purposes (so that this help request can help others as well):

MB64_BUTTON_OnOnly

;; when on: send button value defined in dump

;; when off: send nothing

BRA_IFSET TMP1, 0, ACCESS, MB64_BUTTON_NotifyChangeEnd

SET_BSR MB64_BUTTON_VALUES_SR0

setf MB64_BUTTON_VALUES_SR0

SET_BSR MB64_BUTTON_VALUES_SR0+1

setf MB64_BUTTON_VALUES_SR0+1

rcall MB64_BUTTON_Hlp_SaveStat

rgoto MB64_BUTTON_Send

I'm also using one button to record and one to play the recorded sample, when the user pushes REC the app starts recording for 6 seconds.

now MY QUESTION IS:

Is it possible to maintain the REC button LED litten while the apllication records, and turn it off when the apllication stops recording? this way the user will be able to identify the recording action of the app...

In order to do this I've set the recording button to Toggle, this way, when the user pushes the button it gets litten and the midibox sends a NoteON to the app so that it starts recording....then after the 6 second Record buffer is filled it stops recording and sends a NoteOff message to the midibox (same value as the previous received noteON message).....the thing is that this noteOFF message doesnt turn OFF the rec button LED.........

according to other forum articles, I probably would be able to achieve this by using one extra ShiftR for the REC button and one extra ShiftR for the LED of the REC button, this way all other buttons behaviours would stay unchanged....

then I would have to configure my "LED Map" table in mk_syx.ini like:

[LED_MAP]

   LED_SR1 = 1    # (Button ID #1-#8)     "<---used for FX selection(OnOnly buttons)"

   LED_SR2 = 2    # (Button ID #9-#16)    "<---used for FX selection(OnOnly buttons)"

   LED_SR3 = 18    # (MIDI Status received for Button ID #17-#24) 

   ......................

explanation:

LED_SR3 is the extra SR for the REC button,

Button ID #17-#24 is the group that represents the extra SR used for the REC button LED

finally I would have to change the APP so that when it receives a NoteON message (telling it to begin recording) it would have to reply a NoteOn message to the midibox to turn ON the REC btn LED, and a NoteOff message when recording buffer is filled(after 6 seconds of recording).

Altough I'm pretty sure that this would work, I want to know if I can set this specific behaviour to TOGGLE button types only, as I changed the behaviour of the ONONLY buttons before......

here are the links for the articles that I've been dwelling with in the last coupple of weeks, but unfortunelly with no success....

http://www.midibox.org/forum/index.php/topic,6157.15.html

http://www.midibox.org/forum/index.php/topic,9504.0.html

http://www.midibox.org/forum/index.php/topic,5034.0.html

http://www.midibox.org/forum/index.php/topic,10970.0.html

http://www.midibox.org/forum/index.php/topic,6733.0.html

http://www.ucapps.de/mios_c_set_dout.html

Sorry for the complete status report but I figured that Is better to be specific and save time in the future(I´m not very good with explanations, thats why this is my first post). So, after all the hardcore explaining here´s the short version:

Is there anyway in midibox64 that I can set the TOGGLE button LEDS exclusive reaction based on received midi events???

Thanks to TK and all supporters for making my mad scientist childhood fantasy a reality, my room will never be the same but who cares??? ;D

Best regards................Mo

Link to comment
Share on other sites

Sorry for the complete status report but I figured that Is better to be specific and save time in the future

Right you are! :) Now we just have to wait for a MB64 expert to come along :)

Is there anyway in midibox64 that I can set the TOGGLE button LEDS exclusive reaction based on received midi events???

Short answer: Yes, but I don't know how.

Link to comment
Share on other sites

Ahh no sweat man. Well 'keeping it active' is usually known as 'bumping' the thread. There's nothing wrong with that, but if you do it too soon it can be considered impolite. Kinda like "are we there yet are we there yet?' :D

Takes a while to learn the netiquette, but generally if you relate a situation to it's real-life parallel like that, you'll be on the money.

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...