Jump to content

lfo sync button


 Share

Recommended Posts

Hello all,

i build the stepC of the Mbsid (90% finished) and everthing is working. (i will do the report later in an other topic).  

Now i want add a button to control the sync of the Mbsid lfo, just like the lfo waveformbutton.

One button and two leds (off,asn,allnote).

How can i do that?

thanks

chriss

Link to comment
Share on other sites

Hi Chriss,

unfortunately such a modification requires a lot of small changes in different files. A more comfortable solution is not possible due to timing reasons.

So: the LED status has to be saved in a temporary register.

See cs_menu_leds.inc, search for "LFO waveform" -- there are still 3 bits free in TMP5 which could be used.

Once this assignment has been made, you can access to this status register in cs_menu_io_tables.inc (take the last DOUT_ENTRY as example)

In cs_menu_io_tables.inc you also have to call a function when the "sync" button has been pressed (see CS_MENU_BUTTON_LFO_Wav as example)

search for "CS_MENU_BUTTON_LFO_Wav" in cs_menu_buttons.inc --- just copy & paste the function, rename the label to "...LFO_Sync" change the cursor position from 0x01 to 0x04

Best Regards, Thorsten.

Link to comment
Share on other sites

Hello Thorsten,

so half of this little mod works so far, the button does what it should do. But not the leds though.

i changed in cs_menu_leds.inc  the file from

;; TMP5[4..0]: LFO waveform

     call      CS_MENU_MS_GetSIDBase

     call      CS_MENU_Hlp_AddLFOOffset

     swapf      INDF0, W

     andlw      0x07

     call      MIOS_HLP_GetBitORMask

     IFCLR      INDF0, 0, movlw 0x00

     movwf      TMP5

to

;; TMP5[6..0]: LFO waveform

     call      CS_MENU_MS_GetSIDBase

     call      CS_MENU_Hlp_AddLFOOffset

     swapf      INDF0, W

     andlw      0x07

     call      MIOS_HLP_GetBitORMask

     IFCLR      INDF0, 0, movlw 0x00

     movwf      TMP5

is that all?

and in the cs_menu_io_tables.inc

DOUT_ENTRY      TMP5, 0,                        5,      1      ; LFO Sine LED

     DOUT_ENTRY      TMP5, 1,                        5,      0      ; LFO Triangle LED

     DOUT_ENTRY      TMP5, 2,                        4,      7      ; LFO Saw LED

     DOUT_ENTRY      TMP5, 3,                        4,      6      ; LFO Pulse LED

     DOUT_ENTRY      TMP5, 4,                        4,      5      ; LFO Random LED

   DOUT_ENTRY      TMP5, 5,                        4,      4      ; LFO Sync Asn

   DOUT_ENTRY      TMP5, 6,                        4,      3      ; LFO Sync All

thanks

chriss

BTW: Is "Lfo Random" not supported? in the menu the Lcd tells me "off"and the led  does not light.

Link to comment
Share on other sites

Hi Chriss,

Random LFO is one of the new features of the upcoming V1.5

With "andlw 0x07" you've masked out the interesting bits. However, I would recomment following four lines after "movlw TMP5" of the original code:

   btfsc INDF0, LFO_MODE_SYNC

   bsf TMP5, 5

   btfsc INDF0, LFO_MODE_SYNC_ALL

   bsf TMP5, 6

(unfortunately the IFSET macro doesn't work with more than three parameters, therefore btfsc == bit test, skip if clear" has to be used without the macro)

Best Regards, Thorsten.

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