Jump to content

Curve parameter and LFO sync


tatapoum
 Share

Recommended Posts

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

Link to comment
Share on other sites

Hi Ludo,

there is no documentation available how to do this, the only info can be found in cs_menu_leds.inc

It's not a simple modification, and it's not easy to explain if you never did such changes before

Best Regards, Thorsten.

Link to comment
Share on other sites

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_ButtonInc

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 ?

But am I the first one to add these features ?

Thanks,

ludo

Link to comment
Share on other sites

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 table

But am I the first one to add these features ?

Chriss did this some time ago, see also http://www.midibox.org/midibox_gallery/chriss8.jpg

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

Link to comment
Share on other sites

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

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