Jump to content

linking leds to buttons


cimo
 Share

Recommended Posts

hi all

i ve got a midibox with

12 encoders

32 buttons (12 backlit)

4 faders

4 pots

1 joystick (analog)

no lcd no menu

everything works wonderfully with a slightly modified mb64e but there is no way i can thoseleds light up

i used the test example to check that the dout2 and the leds are ok and they are

i tried everything i could imagine but with no result

obviously i am missing something: where should i modify the code to link the leds to the buttons?

somewhere in the main.asm it says that the first 4 dout are reserved to the ledrings by default but i have no ledrings enabled

any help is appreciated

thanks

simone

Link to comment
Share on other sites

Let me know when you have a solution.

At present, I am just beginning my organ MIDIfication, and have a plan that could benefit from your design to make this work:

I'm wiring the stoptabs on my horseshoe curve to send MIDI events to the MidiTzer. They work OK for individual stop selection up/down ... duh, I think I can understand which stops are on and which are off.

But I wonder, since there are many piston buttons that can be adjusted for pre-configured registrations that will not be displayed by up-down toggle positions (SAMS that are actuated on a true theatre pipe organ) ...

I'd like to install an LED above every stop tab tongue to signify which are selected as "on" when a particular piston has been selected.

Since MidiTzer does not operate true SAMS, I wonder if there's a way to notify an LED that resides above each stoptab to signify it has been chosen as a part of the current registered piston selection.

These would not be displayed when the stop tabs are toggled on or off (their up/down positions are visual enough to indicate they have been selected), but rather by the piston buttons engaged to signify which individual stops comprise the particular registration that otherwise would not be visible.

Any ideas?

pk

Link to comment
Share on other sites

Cimo: you don't need to modify the code, you just only need to use the mk_syx script, or Serge's Editor to send a new setup where the LEDs are mapped to incoming MIDI events. There are a number of different mapping possibilities:


################################################################################
# LED Map: assignes the LED shift registers to the Button Shift
# registers or special values
# Currently following values are supported:
#    0    Default Setting (see Map below)
#    1    Button Shift Register 1 (Button ID #1-#8)
#    2    Button Shift Register 2 (Button ID #9-#16)
#    3    Button Shift Register 3 (F1-F4 and Navigation Buttons: ID #17-#24)
#    4    Button Shift Register 4 (Button ID #25-#32)
#    5    Button Shift Register 5 (Button ID #33-#40)
#    6    Button Shift Register 6 (Button ID #41-#48)
#    7    Button Shift Register 7 (Button ID #49-#56)
#    8    Button Shift Register 8 (Button ID #57-#64)
#    9    Selected Group (1 of 8)
#  10    Selected Bank (1 of 8)
#  11-15  reserved
#  16    MIDI Status received for Button ID #1-#8
#  17    MIDI Status received for Button ID #9-#16
#  18    MIDI Status received for Button ID #17-#24
#  19    MIDI Status received for Button ID #25-#32
#  20    MIDI Status received for Button ID #33-#40
#  21    MIDI Status received for Button ID #41-#48
#  22    MIDI Status received for Button ID #49-#56
#  23    MIDI Status received for Button ID #57-#64
#  24-31  reserved
################################################################################
[LED_MAP]
  LED_SR1 = 1    # (Button ID #1-#8)
  LED_SR2 = 2    # (Button ID #9-#16)
  LED_SR3 = 3    # (F1-F4 and Navigation Buttons: ID #17-#24)
  LED_SR4 = 4    # (Button ID #57-#64)
  LED_SR5 = 5    # (Button ID #25-#32)
  LED_SR6 = 6    # (Button ID #33-#40)
  LED_SR7 = 7    # (Button ID #41-#48)
  LED_SR8 = 8    # (Button ID #49-#56)
[/code]

pk: I don't know the MidiTizer so much, but if it sends any MIDI events in order to notify the states, then you only need to select the right mapping value in order to forward this information to LEDs

Best Regards, Thorsten.

Link to comment
Share on other sites

hi

thanks for the help out there

but maybe i didn t make it clear enough that i am stuck at a earlier point: i can t make those leds light up with my customised MB64e application

i see some flickering while i move pots and that means that ledrings are still enabled: but i have disabled them in main.asm

i have encoders on the first 3 DIN

buttons on DIN 4 5 6 7

leds on DOUT 1 2 (they are backlit buttons on DIN 4 and 5)

and 12 pots

everything just works fine but i can t link those leds to the buttons (i am sure 100% there is no hardware/connection problem)

i was thinking about moving to a mbhp_lc since i am going to use it with Ableton Live5 but i want to learn how to setup the leds on MB64e

i also "decided2 today to upload a corrupted application and now the PIC has just gone crazy i can t even upload MIOS anymore hop i can reburn and reset the poor thing, it s time to make my own burner

anyway here a little extract from the main.asm

#define LEDRINGS_SR_ENC1_16_CATHODES_1 0 ; first shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC1_16_CATHODES_2 0 ; second shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC1_16_ANODES_1 0 ; first shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC1_16_ANODES_2 0 ; second shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC17_32_CATHODES_1 0 ; first shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC17_32_CATHODES_2 0 ; second shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC17_32_ANODES_1 0 ; first shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC17_32_ANODES_2 0 ; second shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC33_48_CATHODES_1 0 ; first shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC33_48_CATHODES_2 0 ; second shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC33_48_ANODES_1 0 ; first shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC33_48_ANODES_2 0 ; second shift register with anodes of the first 16 LED rings

;

#define LEDRINGS_SR_ENC49_64_CATHODES_1 0 ; first shift register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC49_64_CATHODES_2 0 ; second register with cathodes of the first 16 LED rings

#define LEDRINGS_SR_ENC49_64_ANODES_1 0 ; first shift register with anodes of the first 16 LED rings

#define LEDRINGS_SR_ENC49_64_ANODES_2 0 ; second shift register with anodes of the first 16 LED rings

#define DEFAULT_DIN_SR_PIN_01_08 4

#define DEFAULT_DIN_SR_PIN_09_16 5

#define DEFAULT_DIN_SR_PIN_17_24 6

#define DEFAULT_DIN_SR_PIN_25_32 7

#define DEFAULT_DOUT_SR_PIN_01_08 1

#define DEFAULT_DOUT_SR_PIN_09_16 2

hey Paul i have to admit i don t have an idea of  how those pistons look like and i just imagine your organ like a huge machine with a big smoking chimeney on top.;-)

anyway good luck with your project !!

Link to comment
Share on other sites

as you can imagine i compiled and uploaded the same thing 100000 times and i am uploading the main.hex file and i compile it before and there are no errors .. i was wondering if there is any change in mb64e_leds.ini (i only changed the number of connected pins) i have to do .. i am just lost and i am sure i am lost in a glass of water (free translation from Italian) :-)

cheers

Link to comment
Share on other sites

No, you don't need to change the code, you have to change the configuration, and upload it via SysEx

For this we have the mk_syx script and - alternatively - Serge's Editor.

See also my answer above.

Look into the mk_syx package, file: pic18f/midibox64e.ini

Best Regards, Thorsten.

Link to comment
Share on other sites

FIAT LUX !!!!

.. that was it, thanks Thorsten i only need to resolder a few connections in order to link the proper leds to the buttons but it s all working now ..

... i am using those famous RJS backlit buttons and they are very nice buttons indeed but they are not good for triggering samples since they can easily double trigger or not trigger at all.I know there is a parameter for low quality buttons i will try with that but i can t consider low quality buttons something i paid about 4 euros !!!

They are great for activating effects, solo, mute etc

Thanks again to George and Thorsten for the support

Simone

Link to comment
Share on other sites

I think that the debouncing parameter will help, just insert following code below the USER_Init label in main.asm:


        movlw 8
        call    MIOS_SRIO_DebounceSet
[/code]

(the spaces before the instructions are important)

W/ MB64E this works only properly in conjunction with MIOS V1.9c

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 years later...

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