Subversion Repositories svn.mios

Rev

Rev 194 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
73 tk 1
; $Id: setup_mbseq_tk.asm 285 2008-04-23 20:31:07Z tk $
194 tk 2
    LIST R=DEC
73 tk 3
;
4
; Default setup File for MIDIbox SEQ V2
5
;
6
; Detailed infos for customization can be found at http://www.ucapps.de/midibox_seq_options.html
7
;
8
; define the size of the display which is connected to the core:
9
;    0: 2x16
10
;    1: 2x20
11
;    2: 2x40
12
;    3: 2 * 2x40
13
#define DEFAULT_LCD_SIZE 3
14
;
15
; Address of BankStick which stores the patterns
16
; use 0-7 to select the CS address
17
; or use -1 to deactivate the BankStick (in this case only one internal pattern is available)
18
#define DEFAULT_BANKSTICK_PATTERN_CS 0
19
;
20
; Address of BankStick which stores the song
21
; use 0-7 to select the CS address
22
; if the same address is used like for the patterns, a 64k EEPROM has to be used (24LC512)
23
; use -1 to deactivate the BankStick (in this case the song mode doesn't work)
24
#define DEFAULT_BANKSTICK_SONG_CS 0
25
;
26
; Max. length of the DIN/DOUT shift register chain (1-16)
27
#define DEFAULT_NUMBER_SR   10
28
;
29
; Number of connected pots - allowed values: 1-64
30
#define DEFAULT_NUMBER_POTS  0
31
;
32
; Are multiplexers (AINX4 modules) connected? -> set this value to 1
33
; No multiplexer connected -> set this value to 0, allowed number of pots in this case: 1-8
34
#define DEFAULT_MUX_ENABLED  0
35
;
36
; debounce counter (see the function description of MIOS_SRIO_DebounceSet)
37
; Use 0 for high-quality buttons, use higher values for low-quality buttons
38
#define DEFAULT_SRIO_DEBOUNCE_CTR 32
39
;
40
; For MIDI activity monitor: define the DOUT pins for the Rx and Tx LED
41
#define DEFAULT_MIDI_MONITOR_ENABLED 1  ; if 1, the Tx/Rx LEDs are enabled
42
#define DEFAULT_MIDI_RX_LED 0x0f    ; DOUT SR#2, pin D0
43
#define DEFAULT_MIDI_TX_LED 0x20    ; DOUT SR#5, pin D7
44
;
45
; The beat indicator LED has to be assigned to a DOUT pin here:
46
#define DEFAULT_BEAT_INDICATOR_LED 0x07 ; DOUT SR#1, pin D0
47
;
48
; Some menus are provide the possibility to use 16 "general purpose" buttons
49
; Define the two shift registers which are assigned to this function here:
50
; (valid numbers: 1-16)
51
#define DEFAULT_GP_DIN_SR0  7   ; first GP DIN shift register assigned to SR#7
52
#define DEFAULT_GP_DIN_SR1  10  ; second GP DIN shift register assigned to SR#10
53
;
54
; above these buttons LEDs should be mounted to visualize the played MIDI events,
55
; but also the current sequencer position, the selected pattern, the menu, etc.
56
; Define the two shift registers which are assigned to this function here:  
57
; (valid numbers: 1-16)
58
#define DEFAULT_GP_DOUT_SR0 3   ; first GP DOUT shift register assigned to SR#3
59
#define DEFAULT_GP_DOUT_SR1 4   ; second GP DOUT shift register assigned to SR#4
60
;
61
; set this value to 1 if each track has its own set of 16 LEDs to display the 
62
; unmuted steps and the current sequencer position
63
#define DEFAULT_TRACK_LEDS_ENABLED 0
64
; define the DOUT pins to which the cathodes of these LEDs are connected
65
#define DEFAULT_TRACK_LEDS_1_CATHODE 0x27   ; Track 1 and GP LEDs
66
#define DEFAULT_TRACK_LEDS_2_CATHODE 0x26   ; Track 2
67
#define DEFAULT_TRACK_LEDS_3_CATHODE 0x25   ; Track 3
68
#define DEFAULT_TRACK_LEDS_4_CATHODE 0x24   ; Track 4
69
; (the anodes are connected to the shift registers which are defined by DEFAULT_GP_DOUT_SRx)
70
;
71
; Datawheel for menu navigation/data entry connected or not?
72
; A datawheel can replace the left/right buttons!
73
; if -1: datawheel not connected
74
; if 0: encoder #0 assigned to datawheel function
75
; values > 0 not allowed in the MIDIboxSEQ application
76
; don't forget to define the pins of the datawheel in MIOS_ENC_PIN_TABLE
77
; (-> mios_tables.inc or setup_*.asm, first entry)
78
#define DEFAULT_ENC_DATAWHEEL   0
79
;
80
; the speed value for the datawheel (#0) which is used when the "FAST" button is activated:
81
#define DEFAULT_DATAWHEEL_SPEED_VALUE 3
82
;
83
; the speed value for the additional encoders (#1-#16) which is used when the "FAST" button is activated:
84
#define DEFAULT_ENC_SPEED_VALUE 3
85
 
86
;; Behaviour of FAST button:
87
;; 0: button pressed: fast encoders, button depressed: slow encoders
88
;; 1: fast mode toggled when button pressed
89
#define DEFAULT_BEHAVIOUR_BUTTON_FAST   1
90
;; The same for the "ALL" button (if flag set, all step parameters will be changed with a single encoder)
91
#define DEFAULT_BEHAVIOUR_BUTTON_ALL    1
92
;; the same for the solo button (if flag set, the current selected track will be played solo)
93
#define DEFAULT_BEHAVIOUR_BUTTON_SOLO   1
94
;; the same for the metronome button
95
#define DEFAULT_BEHAVIOUR_BUTTON_METRON 1
96
;; the same for the scrub button
97
#define DEFAULT_BEHAVIOUR_BUTTON_SCRUB  0
98
 
99
; MIDI IN Channel which is used for the transpose/arpeggiator/remote function
100
; Allowed values: 1-16, select 0 to disable
101
#define DEFAULT_SEQUENCER_CHANNEL   1
102
;
103
; The Note number which activates the remote function (examples: 0x24 == C-2, 0x60 == C-7)
104
#define DEFAULT_MIDI_REMOTE_KEY     0x60    ; C-7
105
;
106
; Optional channels for configuration via CC (1-16, select 0 to disable)
107
#define DEFAULT_MIDI_CHANNEL_LAYER_A    0
108
#define DEFAULT_MIDI_CHANNEL_LAYER_B    0
109
#define DEFAULT_MIDI_CHANNEL_LAYER_C    0
110
#define DEFAULT_MIDI_CHANNEL_CFG    0
111
;
112
; which notes should be played by the metronome?
113
; (the channel can be changed in the appr. menu)
114
; every 16th step:
115
#define DEFAULT_METRONOME_NOTE_MEASURE  0x25    ; (C#1)
116
#define DEFAULT_METRONOME_VEL_MEASURE   0x7f    ; 127
117
; every 4th step:
118
#define DEFAULT_METRONOME_NOTE_BEAT 0x25    ; (C#1)
119
#define DEFAULT_METRONOME_VEL_BEAT  0x60    ; 96
120
 
121
;; 0: old style - BPM can be divided by 1, 2, 4, 8, 16, 32, 64
122
;; 1: new style - BPM can be divided by 1..16
123
#define DEFAULT_BPM_DIVIDER_BEHAVIOUR   1
124
 
145 tk 125
;; define the AOUT interface which is used here:
126
;;   1: one MBHP_AOUT module
127
;;   2: up to 4 (chained) MBHP_AOUT_LC modules
128
;;   3: one MBHP_AOUT_NG module
129
;; all other values invalid!
130
#define AOUT_INTERFACE_TYPE 1
131
 
132
;; only relevant if one or more AOUT_LC modules are used:
133
;; define the resolution configuration here
134
;;   0: first channel 12bit, second channel 4bit
135
;;   1: first channel 8bit, second channel 8bit
285 tk 136
;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
145 tk 137
;; all other values invalid!
138
#define AOUT_LC_RESOLUTION_OPTION_M1 1
139
#define AOUT_LC_RESOLUTION_OPTION_M2 1
140
#define AOUT_LC_RESOLUTION_OPTION_M3 1
141
#define AOUT_LC_RESOLUTION_OPTION_M4 1
142
 
73 tk 143
;; define the pin which should be used as external clock output here
144
;; DEFAULT_EXT_CLK_LAT can be LATC (Pin 0, 1, 2, 4, 5) or LATD (Pin 4)
145
;; Note that this should be an exclusive pin. E.g., if an AOUT module is
146
;; be connected, LATC.5 and LATD.4 are already allocated. If an AIN module
147
;; is connected, LATC.0, .1 and .2 are already allocated
148
;; if a second LCD is connected, LATC.4 is already allocated
149
;; The external pin is disabled with DEFAULT_EXT_CLK_LAT == 0
150
#define DEFAULT_EXT_CLK_LAT LATC
151
#define DEFAULT_EXT_CLK_PIN 0
152
 
153
;; the external clock can be divided, the setting can also be changed in the BPM menu
154
;; 0: 96 ppqn (won't work, clock permanently 1)
155
;; 1: 48 ppqn
156
;; 2: 32 ppqn
157
;; 3: 24 ppqn (standard)
158
;; 4: 24/2 ppqn
159
;; 5: 24/3 ppqn
160
;; etc...
161
#define DEFAULT_EXT_CLK_DIVIDER 3
162
 
163
 
164
 
165
 
166
    org 0x3082      ; never change the origin!
167
; ==========================================================================
168
;  In this table all button functions are mapped to the DIN pins
169
;
170
;  The function name can be found on the left, the shift register and pin
171
;  number on the right side.
172
;
173
;  SR/pin numbers:
174
;     SR =  1 for the first DIN shift register
175
;     SR =  2 for the second DIN shift register
176
;     ...
177
;     SR = 16 for the last DIN shift register
178
;
179
;     Pin = 0 for the D0 input pin of the shift register
180
;     Pin = 1 for the D1 input pin of the shift register
181
;     ...
182
;     Pin = 7 for the last input pin (D7) of the shift register
183
;
184
;  Set the SR and pin number to 0 if a button function should not be used
185
;
186
;  The table must end with DIN_ENTRY_EOT!
187
; ==========================================================================
188
 
189
DIN_ENTRY MACRO function, sr, pin
190
    dw  function, (pin + 8*(sr-1))
191
    ENDM
192
 
193
DIN_ENTRY_EOT MACRO
194
    dw  0x0000, 0x0000
195
    ENDM
196
 
197
SEQ_IO_TABLE_DIN
198
    ;;      Function name       SR# Pin#
199
    ;; NOTE: the pins of the 16 general purpose buttons are assigned at main.asm
200
#if DEFAULT_ENC_DATAWHEEL < 0
201
    DIN_ENTRY   CS_MENU_BUTTON_Left,     1,  0
202
    DIN_ENTRY   CS_MENU_BUTTON_Right,    1,  1
203
#endif
204
    DIN_ENTRY   SEQ_BUTTON_Scrub,    1,  2
205
    DIN_ENTRY   SEQ_BUTTON_Metronome,    1,  3
206
 
207
    DIN_ENTRY   SEQ_BUTTON_Stop,     1,  4
208
    DIN_ENTRY   SEQ_BUTTON_Pause,    1,  5
209
    DIN_ENTRY   SEQ_BUTTON_Play,     1,  6
210
    DIN_ENTRY   SEQ_BUTTON_Rew,      1,  7
211
    DIN_ENTRY   SEQ_BUTTON_Fwd,      2,  0
212
 
213
    DIN_ENTRY   SEQ_BUTTON_F1,       2,  1
214
    DIN_ENTRY   SEQ_BUTTON_F2,       2,  2
215
    DIN_ENTRY   SEQ_BUTTON_F3,       2,  3
216
    DIN_ENTRY   SEQ_BUTTON_F4,       2,  4
217
 
218
    DIN_ENTRY   SEQ_BUTTON_Menu,     2,  5
219
    DIN_ENTRY   SEQ_BUTTON_Select,   2,  6
220
    DIN_ENTRY   SEQ_BUTTON_Exit,     2,  7
221
 
222
    DIN_ENTRY   SEQ_BUTTON_Track1,   3,  0
223
    DIN_ENTRY   SEQ_BUTTON_Track2,   3,  1
224
    DIN_ENTRY   SEQ_BUTTON_Track3,   3,  2
225
    DIN_ENTRY   SEQ_BUTTON_Track4,   3,  3
226
 
227
    DIN_ENTRY   SEQ_BUTTON_LayerA,   3,  4
228
    DIN_ENTRY   SEQ_BUTTON_LayerB,   3,  5
229
    DIN_ENTRY   SEQ_BUTTON_LayerC,   3,  6
230
 
231
    DIN_ENTRY   SEQ_BUTTON_Edit,     4,  0
232
    DIN_ENTRY   SEQ_BUTTON_Mute,     4,  1
233
    DIN_ENTRY   SEQ_BUTTON_Pattern,  4,  2
234
    DIN_ENTRY   SEQ_BUTTON_Song,     4,  3
235
 
236
    DIN_ENTRY   SEQ_BUTTON_Solo,     4,  4
237
    DIN_ENTRY   SEQ_BUTTON_Fast,     4,  5
238
    DIN_ENTRY   SEQ_BUTTON_All,      4,  6
239
 
240
    DIN_ENTRY_EOT
241
 
242
; ==========================================================================
243
;  The following table defines all available DOUT pins with the appr.
244
;  register and bit which is assigned to the pin
245
;  CS_MENU_LED_Update uses this table to update all LEDs
246
; 
247
;  The register name and bit number can be found on the left, 
248
;  the shift register and pin number on the right side.
249
;
250
;  SR/pin numbers:
251
;     SR =  1 for the first DOUT shift register
252
;     SR =  2 for the second DOUT shift register
253
;     ...
254
;     SR = 16 for the last DOUT shift register
255
;
256
;     Pin = 0 for the D7 output pin of the shift register
257
;     Pin = 1 for the D6 output pin of the shift register
258
;     ...
259
;     Pin = 7 for the last input pin (D0) of the shift register
260
;
261
;  Set the SR and pin number to 0 if a LED function should not be used
262
;
263
;  The table must end with DOUT_ENTRY_EOT!
264
; ==========================================================================
265
 
266
DOUT_ENTRY MACRO reg, bit, sr, pin
267
        if sr == 0      ; J5 selected
268
        dw  reg, bit | ((pin | 0x80) << 8)
269
    else            ; SR selected
270
        dw  reg, bit | ((pin + 8*(sr-1)) << 8)
271
    endif
272
    ENDM
273
 
274
DOUT_ENTRY_EOT MACRO
275
    dw  0x0000, 0x0000
276
    ENDM
277
 
278
SEQ_IO_TABLE_DOUT
279
    ;;      Register and bit            SR# Pin#      Description
280
    DOUT_ENTRY  TMP1, 0,                1,  0   ; Track #1 selected (Note: Pin #0 is the D7 output of first SR)
281
    DOUT_ENTRY  TMP1, 1,                1,  1   ; Track #2 selected
282
    DOUT_ENTRY  TMP1, 2,                1,  2   ; Track #3 selected
283
    DOUT_ENTRY  TMP1, 3,                1,  3   ; Track #4 selected
284
 
285
    DOUT_ENTRY  TMP1, 4,                1,  4   ; Layer A selected
286
    DOUT_ENTRY  TMP1, 5,                1,  5   ; Layer B selected
287
    DOUT_ENTRY  TMP1, 6,                1,  6   ; Layer C selected
288
 
289
    ;; NOTE: the pin of the beat indicator LED has to be assigned at main.asm
290
 
291
    DOUT_ENTRY  TMP2, 0,                2,  0   ; Edit Step LED
292
    DOUT_ENTRY  TMP2, 1,                2,  1   ; Mute LED
293
    DOUT_ENTRY  TMP2, 2,                2,  2   ; Pattern LED
294
    DOUT_ENTRY  TMP2, 3,                2,  3   ; Song LED
295
    DOUT_ENTRY  TMP2, 7,                2,  4   ; Solo LED
296
    DOUT_ENTRY  TMP2, 5,                2,  5   ; Fast Encoder LED
297
    DOUT_ENTRY  TMP2, 6,                2,  6   ; Change All Steps LED
298
 
299
    ;; NOTE: the pins of the MIDI Rx/Tx LEDs are assigned at main.asm
300
    ;; NOTE: the pins of the 16 general purpose LEDs are assigned at main.asm
301
    DOUT_ENTRY_EOT
302
 
303
 
304
    org 0x3280      ; never change the origin!
305
 
306
;; --------------------------------------------------------------------------
307
;; In this table DIN pins have to be assigned to rotary encoders for the
308
;; MIOS_ENC driver 
309
;; 
310
;; up to 64 entries are provided
311
;; 
312
;; The table must be terminated with an ENC_EOT entry. Unused entries should
313
;; be filled with ENC_EOT
314
;; 
315
;; ENC_ENTRY provides following parameters
316
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
317
;;    o second parameter: number of pin; since two pins are necessary
318
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
319
;;    o the third parameter contains the encoder mode:
320
;;      either MIOS_ENC_MODE_NON_DETENTED
321
;;          or MIOS_ENC_MODE_DETENTED
322
;;          or MIOS_ENC_MODE_DETENTED2
323
;;          or MIOS_ENC_MODE_DETENTED3
324
;;
325
;; Configuration Examples:
326
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
327
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
328
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
329
;; --------------------------------------------------------------------------
330
 
331
    ;; encoder entry structure
332
ENC_ENTRY MACRO sr, din_0, mode
333
    dw  (mode << 8) | (din_0 + 8*(sr-1))
334
    ENDM   
335
ENC_EOT MACRO
336
    dw  0xffff
337
    ENDM
338
 
339
MIOS_ENC_PIN_TABLE
340
    ;; encoders 1-16
341
    ;;        SR  Pin  Mode
342
#if DEFAULT_ENC_DATAWHEEL >= 0
343
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED   ; Data Wheel
344
#endif
345
 
346
    ENC_ENTRY  5,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 1
347
    ENC_ENTRY  5,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 2
348
    ENC_ENTRY  5,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 3
349
    ENC_ENTRY  5,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 4
350
    ENC_ENTRY  6,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 5
351
    ENC_ENTRY  6,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 6
352
    ENC_ENTRY  6,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 7
353
    ENC_ENTRY  6,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 8
354
    ENC_ENTRY  8,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 9
355
    ENC_ENTRY  8,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 10
356
    ENC_ENTRY  8,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 11
357
    ENC_ENTRY  8,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 12
358
    ENC_ENTRY  9,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 13
359
    ENC_ENTRY  9,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 14
360
    ENC_ENTRY  9,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 15
361
    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 16
362
 
363
    ;; encoders 18-32
364
    ENC_EOT
365
    ENC_EOT
366
    ENC_EOT
367
    ENC_EOT
368
    ENC_EOT
369
    ENC_EOT
370
    ENC_EOT
371
    ENC_EOT
372
    ENC_EOT
373
    ENC_EOT
374
    ENC_EOT
375
    ENC_EOT
376
    ENC_EOT
377
    ENC_EOT
378
    ENC_EOT
379
 
380
    ;; encoders 33-48
381
    ENC_EOT
382
    ENC_EOT
383
    ENC_EOT
384
    ENC_EOT
385
    ENC_EOT
386
    ENC_EOT
387
    ENC_EOT
388
    ENC_EOT
389
    ENC_EOT
390
    ENC_EOT
391
    ENC_EOT
392
    ENC_EOT
393
    ENC_EOT
394
    ENC_EOT
395
    ENC_EOT
396
    ENC_EOT
397
 
398
    ;; encoders 49-64
399
    ENC_EOT
400
    ENC_EOT
401
    ENC_EOT
402
    ENC_EOT
403
    ENC_EOT
404
    ENC_EOT
405
    ENC_EOT
406
    ENC_EOT
407
    ENC_EOT
408
    ENC_EOT
409
    ENC_EOT
410
    ENC_EOT
411
    ENC_EOT
412
    ENC_EOT
413
    ENC_EOT
414
    ENC_EOT
415
 
416
 
417
;; include the rest of the application
418
#include "main.inc"