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_v2.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
 
125
 
145 tk 126
;; define the AOUT interface which is used here:
127
;;   1: one MBHP_AOUT module
128
;;   2: up to 4 (chained) MBHP_AOUT_LC modules
129
;;   3: one MBHP_AOUT_NG module
130
;; all other values invalid!
131
#define AOUT_INTERFACE_TYPE 1
132
 
133
;; only relevant if one or more AOUT_LC modules are used:
134
;; define the resolution configuration here
135
;;   0: first channel 12bit, second channel 4bit
136
;;   1: first channel 8bit, second channel 8bit
285 tk 137
;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
145 tk 138
;; all other values invalid!
139
#define AOUT_LC_RESOLUTION_OPTION_M1 1
140
#define AOUT_LC_RESOLUTION_OPTION_M2 1
141
#define AOUT_LC_RESOLUTION_OPTION_M3 1
142
#define AOUT_LC_RESOLUTION_OPTION_M4 1
143
 
73 tk 144
;; define the pin which should be used as external 24ppqn clock output here
145
;; DEFAULT_EXT_CLK_LAT can be LATC (Pin 0, 1, 2, 4, 5) or LATD (Pin 4)
146
;; Note that this should be an exclusive pin. E.g., if an AOUT module is
147
;; be connected, LATC.5 and LATD.4 are already allocated. If an AIN module
148
;; is connected, LATC.0, .1 and .2 are already allocated
149
;; if a second LCD is connected, LATC.4 is already allocated
150
;; The external pin is disabled with DEFAULT_EXT_CLK_LAT == 0
151
#define DEFAULT_EXT_CLK_LAT LATC
152
#define DEFAULT_EXT_CLK_PIN 0
153
 
154
;; the external clock can be divided, the setting can also be changed in the BPM menu
155
;; 0: 96 ppqn (won't work, clock permanently 1)
156
;; 1: 48 ppqn
157
;; 2: 32 ppqn
158
;; 3: 24 ppqn (standard)
159
;; 4: 24 ppqn / 2
160
;; 5: 24 ppqn / 3
161
;; etc...
162
#define DEFAULT_EXT_CLK_DIVIDER 3
163
 
164
 
165
    org 0x3082      ; never change the origin!
166
; ==========================================================================
167
;  In this table all button functions are mapped to the DIN pins
168
;
169
;  The function name can be found on the left, the shift register and pin
170
;  number on the right side.
171
;
172
;  SR/pin numbers:
173
;     SR =  1 for the first DIN shift register
174
;     SR =  2 for the second DIN shift register
175
;     ...
176
;     SR = 16 for the last DIN shift register
177
;
178
;     Pin = 0 for the D0 input pin of the shift register
179
;     Pin = 1 for the D1 input pin of the shift register
180
;     ...
181
;     Pin = 7 for the last input pin (D7) of the shift register
182
;
183
;  Set the SR and pin number to 0 if a button function should not be used
184
;
185
;  The table must end with DIN_ENTRY_EOT!
186
; ==========================================================================
187
 
188
DIN_ENTRY MACRO function, sr, pin
189
    dw  function, (pin + 8*(sr-1))
190
    ENDM
191
 
192
DIN_ENTRY_EOT MACRO
193
    dw  0x0000, 0x0000
194
    ENDM
195
 
196
SEQ_IO_TABLE_DIN
197
    ;;      Function name       SR# Pin#
198
    ;; NOTE: the pins of the 16 general purpose buttons are assigned at main.asm
199
#if DEFAULT_ENC_DATAWHEEL < 0
200
    DIN_ENTRY   CS_MENU_BUTTON_Left,     1,  0
201
    DIN_ENTRY   CS_MENU_BUTTON_Right,    1,  1
202
#endif
203
    DIN_ENTRY   SEQ_BUTTON_Scrub,    1,  2
204
    DIN_ENTRY   SEQ_BUTTON_Metronome,    1,  3
205
 
206
    DIN_ENTRY   SEQ_BUTTON_Stop,     1,  4
207
    DIN_ENTRY   SEQ_BUTTON_Pause,    1,  5
208
    DIN_ENTRY   SEQ_BUTTON_Play,     1,  6
209
    DIN_ENTRY   SEQ_BUTTON_Rew,      1,  7
210
    DIN_ENTRY   SEQ_BUTTON_Fwd,      2,  0
211
 
212
    DIN_ENTRY   SEQ_BUTTON_F1,       2,  1
213
    DIN_ENTRY   SEQ_BUTTON_F2,       2,  2
214
    DIN_ENTRY   SEQ_BUTTON_F3,       2,  3
215
    DIN_ENTRY   SEQ_BUTTON_F4,       2,  4
216
 
217
    DIN_ENTRY   SEQ_BUTTON_Menu,     2,  5
218
    DIN_ENTRY   SEQ_BUTTON_Select,   2,  6
219
    DIN_ENTRY   SEQ_BUTTON_Exit,     2,  7
220
 
221
    DIN_ENTRY   SEQ_BUTTON_Track1,   3,  0
222
    DIN_ENTRY   SEQ_BUTTON_Track2,   3,  1
223
    DIN_ENTRY   SEQ_BUTTON_Track3,   3,  2
224
    DIN_ENTRY   SEQ_BUTTON_Track4,   3,  3
225
 
226
    DIN_ENTRY   SEQ_BUTTON_LayerA,   3,  4
227
    DIN_ENTRY   SEQ_BUTTON_LayerB,   3,  5
228
    DIN_ENTRY   SEQ_BUTTON_LayerC,   3,  6
229
 
230
    DIN_ENTRY   SEQ_BUTTON_Edit,     4,  0
231
    DIN_ENTRY   SEQ_BUTTON_Mute,     4,  1
232
    DIN_ENTRY   SEQ_BUTTON_Pattern,  4,  2
233
    DIN_ENTRY   SEQ_BUTTON_Song,     4,  3
234
 
235
    DIN_ENTRY   SEQ_BUTTON_Solo,     4,  4
236
    DIN_ENTRY   SEQ_BUTTON_Fast,     4,  5
237
    DIN_ENTRY   SEQ_BUTTON_All,      4,  6
238
 
239
    DIN_ENTRY_EOT
240
 
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
;; --------------------------------------------------------------------------
305
;; In this table DIN pins have to be assigned to rotary encoders for the
306
;; MIOS_ENC driver 
307
;; 
308
;; up to 64 entries are provided
309
;; 
310
;; The table must be terminated with an ENC_EOT entry. Unused entries should
311
;; be filled with ENC_EOT
312
;; 
313
;; ENC_ENTRY provides following parameters
314
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
315
;;    o second parameter: number of pin; since two pins are necessary
316
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
317
;;    o the third parameter contains the encoder mode:
318
;;      either MIOS_ENC_MODE_NON_DETENTED
319
;;          or MIOS_ENC_MODE_DETENTED
320
;;          or MIOS_ENC_MODE_DETENTED2
321
;;          or MIOS_ENC_MODE_DETENTED3
322
;;
323
;; Configuration Examples:
324
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
325
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
326
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
327
;; --------------------------------------------------------------------------
328
    org 0x3280      ; never change the origin!
329
    ;; encoder entry structure
330
ENC_ENTRY MACRO sr, din_0, mode
331
    dw  (mode << 8) | (din_0 + 8*(sr-1))
332
    ENDM   
333
ENC_EOT MACRO
334
    dw  0xffff
335
    ENDM
336
 
337
MIOS_ENC_PIN_TABLE
338
    ;; encoders 1-16
339
    ;;        SR  Pin  Mode
340
#if DEFAULT_ENC_DATAWHEEL >= 0
341
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED   ; Data Wheel
342
#endif
343
 
344
    ENC_ENTRY  5,  0,  MIOS_ENC_MODE_DETENTED   ; V-Pot 1
345
    ENC_ENTRY  5,  2,  MIOS_ENC_MODE_DETENTED   ; V-Pot 2
346
    ENC_ENTRY  5,  4,  MIOS_ENC_MODE_DETENTED   ; V-Pot 3
347
    ENC_ENTRY  5,  6,  MIOS_ENC_MODE_DETENTED   ; V-Pot 4
348
    ENC_ENTRY  6,  0,  MIOS_ENC_MODE_DETENTED   ; V-Pot 5
349
    ENC_ENTRY  6,  2,  MIOS_ENC_MODE_DETENTED   ; V-Pot 6
350
    ENC_ENTRY  6,  4,  MIOS_ENC_MODE_DETENTED   ; V-Pot 7
351
    ENC_ENTRY  6,  6,  MIOS_ENC_MODE_DETENTED   ; V-Pot 8
352
    ENC_ENTRY  8,  0,  MIOS_ENC_MODE_DETENTED   ; V-Pot 9
353
    ENC_ENTRY  8,  2,  MIOS_ENC_MODE_DETENTED   ; V-Pot 10
354
    ENC_ENTRY  8,  4,  MIOS_ENC_MODE_DETENTED   ; V-Pot 11
355
    ENC_ENTRY  8,  6,  MIOS_ENC_MODE_DETENTED   ; V-Pot 12
356
    ENC_ENTRY  9,  0,  MIOS_ENC_MODE_DETENTED   ; V-Pot 13
357
    ENC_ENTRY  9,  2,  MIOS_ENC_MODE_DETENTED   ; V-Pot 14
358
    ENC_ENTRY  9,  4,  MIOS_ENC_MODE_DETENTED   ; V-Pot 15
359
    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_DETENTED   ; V-Pot 16
360
 
361
    ;; encoders 18-32
362
    ENC_EOT
363
    ENC_EOT
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
 
378
    ;; encoders 33-48
379
    ENC_EOT
380
    ENC_EOT
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
 
396
    ;; encoders 49-64
397
    ENC_EOT
398
    ENC_EOT
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
 
414
 
415
;; include the rest of the application
416
#include "main.inc"