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_vintage.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 Vintage (sequencer for MIDIbox64)
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 0
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 -1
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  64
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  1
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 0x1f    ; DOUT SR#4, 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 0x17 ; DOUT SR#3, pin D0
47
;
48
;
49
; Some menus provide the possibility to use 16 "general purpose" buttons
50
; Define the two shift registers which are assigned to this function here:
51
; (valid numbers: 1-16)
52
#define DEFAULT_GP_DIN_SR0  2   ; first GP DIN shift register assigned to SR#2
53
#define DEFAULT_GP_DIN_SR1  3   ; second GP DIN shift register assigned to SR#3
54
;
55
; above these buttons LEDs should be mounted to visualize the played MIDI events,
56
; but also the current sequencer position, the selected pattern, the menu, etc.
57
; Define the two shift registers which are assigned to this function here:  
58
; (valid numbers: 1-16)
59
#define DEFAULT_GP_DOUT_SR0 1   ; first GP DOUT shift register assigned to SR#1
60
#define DEFAULT_GP_DOUT_SR1 2   ; second GP DOUT shift register assigned to SR#2
61
;
62
; set this value to 1 if each track has its own set of 16 LEDs to display the 
63
; unmuted steps and the current sequencer position
64
#define DEFAULT_TRACK_LEDS_ENABLED 0
65
; define the DOUT pins to which the cathodes of these LEDs are connected
66
#define DEFAULT_TRACK_LEDS_1_CATHODE 0x27   ; Track 1 and GP LEDs
67
#define DEFAULT_TRACK_LEDS_2_CATHODE 0x26   ; Track 2
68
#define DEFAULT_TRACK_LEDS_3_CATHODE 0x25   ; Track 3
69
#define DEFAULT_TRACK_LEDS_4_CATHODE 0x24   ; Track 4
70
; (the anodes are connected to the shift registers which are defined by DEFAULT_GP_DOUT_SRx)
71
;
72
; Datawheel for menu navigation/data entry connected or not?
73
; A datawheel can replace the left/right buttons!
74
; if -1: datawheel not connected
75
; if 0: encoder #0 assigned to datawheel function
76
; values > 0 not allowed in the MIDIboxSEQ application
77
; don't forget to define the pins of the datawheel in MIOS_ENC_PIN_TABLE
78
; (-> mios_tables.inc or setup_*.asm, first entry)
79
#define DEFAULT_ENC_DATAWHEEL   -1
80
;
81
; the speed value for the datawheel (#0) which is used when the "FAST" button is activated:
82
#define DEFAULT_DATAWHEEL_SPEED_VALUE 3
83
;
84
; the speed value for the additional encoders (#1-#16) which is used when the "FAST" button is activated:
85
#define DEFAULT_ENC_SPEED_VALUE 3
86
 
87
;; Behaviour of FAST button:
88
;; 0: button pressed: fast encoders, button depressed: slow encoders
89
;; 1: fast mode toggled when button pressed
90
#define DEFAULT_BEHAVIOUR_BUTTON_FAST   1
91
;; The same for the "ALL" button (if flag set, all step parameters will be changed with a single encoder)
92
#define DEFAULT_BEHAVIOUR_BUTTON_ALL    0
93
;; the same for the solo button (if flag set, the current selected track will be played solo)
94
#define DEFAULT_BEHAVIOUR_BUTTON_SOLO   1
95
;; the same for the metronome button
96
#define DEFAULT_BEHAVIOUR_BUTTON_METRON 1
97
;; the same for the scrub button
98
#define DEFAULT_BEHAVIOUR_BUTTON_SCRUB  0
99
 
100
; MIDI IN Channel which is used for the transpose/arpeggiator/remote function
101
; Allowed values: 1-16, select 0 to disable
102
#define DEFAULT_SEQUENCER_CHANNEL   1
103
;
104
; The Note number which activates the remote function (examples: 0x24 == C-2, 0x60 == C-7)
105
#define DEFAULT_MIDI_REMOTE_KEY     0x60    ; C-7
106
;
107
; Optional channels for configuration via CC (1-16, select 0 to disable)
108
#define DEFAULT_MIDI_CHANNEL_LAYER_A    0
109
#define DEFAULT_MIDI_CHANNEL_LAYER_B    0
110
#define DEFAULT_MIDI_CHANNEL_LAYER_C    0
111
#define DEFAULT_MIDI_CHANNEL_CFG    0
112
;
113
; which notes should be played by the metronome?
114
; (the channel can be changed in the appr. menu)
115
; every 16th step:
116
#define DEFAULT_METRONOME_NOTE_MEASURE  0x25    ; (C#1)
117
#define DEFAULT_METRONOME_VEL_MEASURE   0x7f    ; 127
118
; every 4th step:
119
#define DEFAULT_METRONOME_NOTE_BEAT 0x25    ; (C#1)
120
#define DEFAULT_METRONOME_VEL_BEAT  0x60    ; 96
121
 
122
;; 0: old style - BPM can be divided by 1, 2, 4, 8, 16, 32, 64
123
;; 1: new style - BPM can be divided by 1..16
124
#define DEFAULT_BPM_DIVIDER_BEHAVIOUR   1
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 0   ; don't use with AIN module!
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
    DIN_ENTRY   SEQ_BUTTON_All,      1,  0
198
    DIN_ENTRY   SEQ_BUTTON_LayerA,   1,  1
199
    DIN_ENTRY   SEQ_BUTTON_LayerB,   1,  2
200
    DIN_ENTRY   SEQ_BUTTON_LayerC,   1,  3
201
    DIN_ENTRY   SEQ_BUTTON_Select,   1,  4
202
    DIN_ENTRY   SEQ_BUTTON_Left,     1,  5
203
    DIN_ENTRY   SEQ_BUTTON_Right,    1,  6
204
    DIN_ENTRY   SEQ_BUTTON_Exit,     1,  7
205
 
206
    ;; GP buttons assigned to the shift registers above!
207
 
208
    DIN_ENTRY   SEQ_BUTTON_Track1,   4,  0
209
    DIN_ENTRY   SEQ_BUTTON_Track2,   4,  1
210
    DIN_ENTRY   SEQ_BUTTON_Track3,   4,  2
211
    DIN_ENTRY   SEQ_BUTTON_Track4,   4,  3
212
    DIN_ENTRY   SEQ_BUTTON_Solo,     4,  4
213
    DIN_ENTRY   SEQ_BUTTON_Menu,     4,  5
214
    DIN_ENTRY   SEQ_BUTTON_Stop,     4,  6
215
    DIN_ENTRY   SEQ_BUTTON_Play,     4,  7
216
 
217
    DIN_ENTRY   SEQ_BUTTON_Pause,    5,  0
218
    DIN_ENTRY   SEQ_BUTTON_Rew,      5,  1
219
    DIN_ENTRY   SEQ_BUTTON_Fwd,      5,  2
220
    DIN_ENTRY   SEQ_BUTTON_Metronome,    5,  3
221
    DIN_ENTRY   SEQ_BUTTON_Edit,     5,  4
222
    DIN_ENTRY   SEQ_BUTTON_Mute,     5,  5
223
    DIN_ENTRY   SEQ_BUTTON_Pattern,  5,  6
224
    DIN_ENTRY   SEQ_BUTTON_Song,     5,  7
225
 
226
    DIN_ENTRY   SEQ_BUTTON_F1,       6,  0
227
    DIN_ENTRY   SEQ_BUTTON_F2,       6,  1
228
    DIN_ENTRY   SEQ_BUTTON_F3,       6,  2
229
    DIN_ENTRY   SEQ_BUTTON_F4,       6,  3
230
    DIN_ENTRY   SEQ_BUTTON_Scrub,    6,  4
231
    DIN_ENTRY   SEQ_BUTTON_Fast,     6,  5  ; not relevant for MB64SEQ Vintage
232
 
233
    DIN_ENTRY_EOT
234
 
235
 
236
; ==========================================================================
237
;  The following table defines all available DOUT pins with the appr.
238
;  register and bit which is assigned to the pin
239
;  CS_MENU_LED_Update uses this table to update all LEDs
240
; 
241
;  The register name and bit number can be found on the left, 
242
;  the shift register and pin number on the right side.
243
;
244
;  SR/pin numbers:
245
;     SR =  1 for the first DOUT shift register
246
;     SR =  2 for the second DOUT shift register
247
;     ...
248
;     SR = 16 for the last DOUT shift register
249
;
250
;     Pin = 0 for the D7 output pin of the shift register
251
;     Pin = 1 for the D6 output pin of the shift register
252
;     ...
253
;     Pin = 7 for the last input pin (D0) of the shift register
254
;
255
;  Set the SR and pin number to 0 if a LED function should not be used
256
;
257
;  The table must end with DOUT_ENTRY_EOT!
258
; ==========================================================================
259
 
260
DOUT_ENTRY MACRO reg, bit, sr, pin
261
        if sr == 0      ; J5 selected
262
        dw  reg, bit | ((pin | 0x80) << 8)
263
    else            ; SR selected
264
        dw  reg, bit | ((pin + 8*(sr-1)) << 8)
265
    endif
266
    ENDM
267
 
268
DOUT_ENTRY_EOT MACRO
269
    dw  0x0000, 0x0000
270
    ENDM
271
 
272
SEQ_IO_TABLE_DOUT
273
    ;;      Register and bit            SR# Pin#      Description
274
    DOUT_ENTRY  TMP1, 0,                3,  0   ; Track #1 selected (Note: Pin #0 is the D7 output of first SR)
275
    DOUT_ENTRY  TMP1, 1,                3,  1   ; Track #2 selected
276
    DOUT_ENTRY  TMP1, 2,                3,  2   ; Track #3 selected
277
    DOUT_ENTRY  TMP1, 3,                3,  3   ; Track #4 selected
278
 
279
    DOUT_ENTRY  TMP1, 4,                3,  4   ; Layer A selected
280
    DOUT_ENTRY  TMP1, 5,                3,  5   ; Layer B selected
281
    DOUT_ENTRY  TMP1, 6,                3,  6   ; Layer C selected
282
 
283
    ;; NOTE: the pin of the beat indicator LED has to be assigned at the header
284
 
285
    DOUT_ENTRY  TMP2, 0,                4,  0   ; Edit Step LED
286
    DOUT_ENTRY  TMP2, 1,                4,  1   ; Mute LED
287
    DOUT_ENTRY  TMP2, 2,                4,  2   ; Pattern LED
288
    DOUT_ENTRY  TMP2, 3,                4,  3   ; Song LED
289
    DOUT_ENTRY  TMP2, 7,                4,  4   ; Solo LED
290
    DOUT_ENTRY  TMP2, 5,                4,  5   ; Fast Encoder LED
291
    DOUT_ENTRY  TMP2, 6,                4,  6   ; Change All Steps LED
292
 
293
    ;; NOTE: the pins of the MIDI Rx/Tx LEDs are assigned at the header
294
    ;; NOTE: the pins of the 16 general purpose LEDs are assigned at the header
295
    DOUT_ENTRY_EOT
296
 
297
 
298
    org 0x3280      ; never change the origin!
299
;; --------------------------------------------------------------------------
300
;; In this table DIN pins have to be assigned to rotary encoders for the
301
;; MIOS_ENC driver 
302
;; 
303
;; up to 64 entries are provided
304
;; 
305
;; The table must be terminated with an ENC_EOT entry. Unused entries should
306
;; be filled with ENC_EOT
307
;; 
308
;; ENC_ENTRY provides following parameters
309
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
310
;;    o second parameter: number of pin; since two pins are necessary
311
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
312
;;    o the third parameter contains the encoder mode:
313
;;      either MIOS_ENC_MODE_NON_DETENTED
314
;;          or MIOS_ENC_MODE_DETENTED
315
;;          or MIOS_ENC_MODE_DETENTED2
316
;;          or MIOS_ENC_MODE_DETENTED3
317
;;
318
;; Configuration Examples:
319
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
320
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
321
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
322
;; --------------------------------------------------------------------------
323
 
324
    ;; encoder entry structure
325
ENC_ENTRY MACRO sr, din_0, mode
326
    dw  (mode << 8) | (din_0 + 8*(sr-1))
327
    ENDM   
328
ENC_EOT MACRO
329
    dw  0xffff
330
    ENDM
331
 
332
MIOS_ENC_PIN_TABLE
333
    ;; encoders 1-16
334
    ENC_EOT
335
    ENC_EOT
336
    ENC_EOT
337
    ENC_EOT
338
    ENC_EOT
339
    ENC_EOT
340
    ENC_EOT
341
    ENC_EOT
342
    ENC_EOT
343
    ENC_EOT
344
    ENC_EOT
345
    ENC_EOT
346
    ENC_EOT
347
    ENC_EOT
348
    ENC_EOT
349
    ENC_EOT
350
 
351
    ;; encoders 17-32
352
    ENC_EOT
353
    ENC_EOT
354
    ENC_EOT
355
    ENC_EOT
356
    ENC_EOT
357
    ENC_EOT
358
    ENC_EOT
359
    ENC_EOT
360
    ENC_EOT
361
    ENC_EOT
362
    ENC_EOT
363
    ENC_EOT
364
    ENC_EOT
365
    ENC_EOT
366
    ENC_EOT
367
    ENC_EOT
368
 
369
    ;; encoders 33-48
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
    ENC_EOT
380
    ENC_EOT
381
    ENC_EOT
382
    ENC_EOT
383
    ENC_EOT
384
    ENC_EOT
385
    ENC_EOT
386
 
387
    ;; encoders 49-64
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
    ENC_EOT
398
    ENC_EOT
399
    ENC_EOT
400
    ENC_EOT
401
    ENC_EOT
402
    ENC_EOT
403
    ENC_EOT
404
 
405
 
406
;; include the rest of the application
407
#include "main.inc"