tatapoum Posted March 22, 2006 Report Share Posted March 22, 2006 I've searched on the website, in the source code, in this forum and in the Wiki too, but I was not able to find how to assign a button and its 3 LEDs to the curve function.Same question about the LFOs sync function (one button and two LEDs).Thank for your help or entry points in the code.ludo Quote Link to comment Share on other sites More sharing options...
TK. Posted March 22, 2006 Report Share Posted March 22, 2006 Hi Ludo,there is no documentation available how to do this, the only info can be found in cs_menu_leds.incIt's not a simple modification, and it's not easy to explain if you never did such changes beforeBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
tatapoum Posted March 22, 2006 Author Report Share Posted March 22, 2006 I never do that before, but I'm motivated to go into the source code (I've etched and soldered my PCB). I've some code skills, so I'm not afraid to do this.Concerning the button, I've found in cs_menu_buttons.inc the following entry : CS_MENU_BUTTON_Env_Curve. Thus this one seems easy to integrate into cs_menu_iotables.inc.Howver, nothing about LFO sync. Maybe this code has to be added (have to check cursor pos and page offset) :CS_MENU_BUTTON_LFO_RS ;; do nothing if button has been depressed IFSET MIOS_PARAMETER2, 0, return ;; else increment OSC setting movlw 0x01 ; cursor pos movwf MIOS_PARAMETER1 movlw 0x00 ; page offset movwf MIOS_PARAMETER2 movlw CS_MENU_LFO ; menu structure goto CS_MENU_ButtonIncThe cs_menu_leds.inc is more tricky to me as it seems to be more low level assembler code. csmenu.inc has also to be modfied ?But am I the first one to add these features ?Thanks,ludo Quote Link to comment Share on other sites More sharing options...
Wilba Posted March 22, 2006 Report Share Posted March 22, 2006 You might be the first - I also will be adding a "Curve" button with three LEDs, but not up to the stage of coding it yet (still constructing the CS!). Quote Link to comment Share on other sites More sharing options...
TK. Posted March 22, 2006 Report Share Posted March 22, 2006 The cs_menu_leds.inc is more tricky to me as it seems to be more low level assembler code. csmenu.inc has also to be modfied ?no, you only need to copy the curve flags into temporary registers, which then can be accessed from the io tableBut am I the first one to add these features ?Chriss did this some time ago, see also http://www.midibox.org/midibox_gallery/chriss8.jpgSo, before re-inventing the wheel, you could ask him.And please: add some step-by-step instructions to the Wiki, so that this information doesn't get lost.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
tatapoum Posted March 22, 2006 Author Report Share Posted March 22, 2006 Thorsten,Thanks to remind me how has already implement these function. I've sent a message to Chriss.And I will put the tips into the Wiki.Cheers,ludo Quote Link to comment Share on other sites More sharing options...
tatapoum Posted March 26, 2006 Author Report Share Posted March 26, 2006 Hello,Chriss give me a big help by proving code. I've uptaded mine and it works.Before the Wiki addition, could you correct me if I'm wrong somewhere ?-------------------------------You have to define a register in app_defines.h a free address which is smaller than < 0x80. This example use the 0x06d address wich takes place of RX Midi LED.Modication on Line 167 CS_MENU_CURVE EQU 0x06d Then you have to put extra code in cs_menu_leds.inc. This has to be inserted in CS_MENU_LED_Update function on Line 194 ;;CS_MENU_CURVE_REGISTER[2..0]: ENV curve call CS_MENU_MS_GetSIDBase movlw CS_SID_ENV_CURVES addwf FSR0L, F movf INDF0, W btfsc CS_MENU_SELECTED_ENV, 0 swapf INDF0, W andlw 0x07 movwf CS_MENU_CURVE Now it's possible in cs_menu_io_tables to assign the buttons and LEDs DIN_ENTRY CS_MENU_BUTTON_Env_Curve, 3, 6 ;(depending on the shiftregister and pins) DOUT_ENTRY CS_MENU_CURVE, 0, 3, 4 ; ATTACK LED (depending on the shiftregister and pins) DOUT_ENTRY CS_MENU_CURVE, 1, 4, 1 ; DECAY LED (depending on the shiftregister and pins) DOUT_ENTRY CS_MENU_CURVE, 2, 3, 3 ; RELEASE LED (depending on the shiftregister and pins)--------------------------Thanks again Chriss and Thorsten for your help,ludo Quote Link to comment Share on other sites More sharing options...
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.