moxi Posted May 27, 2005 Report Share Posted May 27, 2005 hi ,the purpose of this function is to lets you exchange the pattern in the edit buffer with any of the 3 others .the function act immediatly, i havn't find the way to make it synced with the first step (i will do other tests later).you have to save your pattern 1 (the one that you can édit in realtime) first if you have done any change that you want to keep .this function work in any mode (but it has not been tested in song mode) so you can swap the pattern even if you are in edit mode.i'm a beginner ,so there is surely a way to do it more simply or more efficient ,but the idea is here now....the function work fine (no bugs in my test) but have to be tested by other people , especially to see if there is any problem with the realtime handling .consider that for the while this function is for composing rather than for live tweaking, even if i havn't noticed any problem...how it works:- go in pattern mode with the dedicated buton- press the F(x) buton that is assigned to the function (you can release it )- select the pattern group (2, 3 ou 4) that you want to put in the edit pattern group(1) - the edit pattern group(1) now contain the pattern previously stored in the group 2, 3, ou 4(depending of your choice)each time you want to swap agin two groups ,you have to first press the F(x) buton.now you can edit the pattern : no more need to go through the pattern bank with the datawheel to select another group,then another one..now you can mute and unmute 4 tracks at once (set e.g. the tracks 4-8 muted , the tracks 1-4 unmuted ,swap the pattern ,and as the mute and unmute status stay attached to the track ,the function will act as if you press 8 buton at once!!)the needed change:1.in file "app-defines.h", after the line "SEQ_MORPH_MAX_VALUE EQU 0x165 ; used by "seq_morph.inc""(line 292), add this code :SEQ_SWAP_PATTERN_GRP EQU 0x166 ; used by "seq_menu_pattern" - selected group SEQ_SWAP_PATTERN0     EQU 0x167 ; used by "seq_menu_pattern" - store edit patternSEQ_MODE_SWAP     EQU 0x168    ;used to set the "swap mode" 2.in file "cs_m_pattern.inc" , at the end of file you will find the function "CS_M_PATTERN_ValueChanged" ,you have to add this code:;; --------------------------------------------------------------------------;; This hook is called when the menu parameter value has been changed;; --------------------------------------------------------------------------CS_M_PATTERN_ValueChanged ;; change to a new pattern ;; 7th bit cleared: CS_MENU_PARAMETER_L = pattern number + 1 ;; 7th bit set:   CS_MENU_PARAMETER_L = 0 decf CS_MENU_PARAMETER_L, W movf CS_MENU_PARAMETER_L, F skpnz movlw 0x80 movwf TMP1 BIFSET SEQ_MODE_SWAP, 1, BANKED, rgoto CS_M_PATTERN_ValueSwapped_2 ************ BIFSET SEQ_MODE_SWAP, 0, BANKED, rgoto CS_M_PATTERN_ValueSwapped  **************** lfsr FSR0, SEQ_PATTERN0 movf CS_MENU_CURSOR_POS, W movff TMP1, PLUSW0 call SEQ_CORE_ChangePattern rgoto UPDATE_LEDs CS_M_PATTERN_ValueSwapped ************ movff SEQ_PATTERN0, SEQ_SWAP_PATTERN0 ; SEQ_PATTERN0 sauvé dans SEQ_SWAP_PATTERN0******** lfsr FSR0, SEQ_PATTERN0 ************ movf SEQ_SWAP_PATTERN_GRP, W ************ movff PLUSW0, INDF0 ; SEQ_PATTERN0 chargé avec SEQ_PATTERNx ************** bsf SEQ_MODE_SWAP, 1, BANKED ************ call SEQ_CORE_ChangePattern *************CS_M_PATTERN_ValueSwapped_2 ************ lfsr FSR0, SEQ_PATTERN0 ************ movf SEQ_SWAP_PATTERN_GRP, W ************ movff SEQ_SWAP_PATTERN0, PLUSW0 ; SEQ_PATTERN0 chargé avec SEQ_PATTERNx ************ bcf SEQ_MODE_SWAP, 1, BANKED *********** bcf SEQ_MODE_SWAP, 0, BANKED *********** call SEQ_CORE_ChangePattern **********UPDATE_LEDs ;; update LEDs rgoto CS_M_PATTERN_UpdateGPLEDs;; ==========================================================================you have to insert the line followed by the little cross3.in "seq_butons.inc" , in the part " Select Track 1/2/3/4" , add this ;; --------------------------------------------------------------------------;; Select Track 1/2/3/4;; --------------------------------------------------------------------------SEQ_BUTTON_Track1 movlw 0 rgoto SEQ_BUTTON_Trackx_ContSEQ_BUTTON_Track2 movlw 1 rgoto SEQ_BUTTON_Trackx_ContSEQ_BUTTON_Track3 movlw 2 rgoto SEQ_BUTTON_Trackx_ContSEQ_BUTTON_Track4 movlw 3;; rgoto SEQ_BUTTON_Trackx_ContSEQ_BUTTON_Trackx_Cont movwf MIOS_PARAMETER1 SET_BSR SEQ_BASE BIFCLR SEQ_MODE_SWAP,0 ,BANKED, rgoto NO_SWAP********************************* movff MIOS_PARAMETER1, SEQ_SWAP_PATTERN_GRP*********************************** call CS_M_PATTERN_ValueChanged*************************************************NO_SWAP *****************************************************************you have to insert the line followed by the little cross.4.still in seq_buton.inc" , at the F(x) buton part ,replace the previous function by this one :;; --------------------------------------------------------------------------;; F1 button --- implement your favourite function here!;; --------------------------------------------------------------------------SEQ_BUTTON_F1 ;; do nothing if button has been depressed IFSET MIOS_PARAMETER2, 0, return SET_BSR SEQ_BASE bsf SEQ_MODE_SWAP, 0, BANKED return i've try to do the function without mod in tracks butons , but without success , there is a lot of things i still doesn't understand ,so i think someone can do this in a better way.... Quote Link to comment Share on other sites More sharing options...
moxi Posted May 31, 2005 Author Report Share Posted May 31, 2005 flop? Quote Link to comment Share on other sites More sharing options...
illogik Posted May 31, 2005 Report Share Posted May 31, 2005 i can't help you with coding but i like.... ;Dkeep up the good work! Quote Link to comment Share on other sites More sharing options...
moxi Posted May 31, 2005 Author Report Share Posted May 31, 2005 great! did you test it ?i'm now tryin to work with the already done registers ( like seq_group) and to achieve it using only the existing "seq_pattern" and "seq_next_pattern" reg ,to avoid to allocate more memory (memory that T.K. will probably fill with his own code in the future update).. 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.