Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
679 tk 1
; $Id: sid_cc_table.inc 1122 2013-04-20 12:37:28Z tk $
2
;
3
; MIDIbox SID
4
; CC Table
5
; maps CCs to engine specific parameters which are listed in sid_par_table.inc
6
;
7
; ==========================================================================
8
;
9
;  Copyright 1998-2007 Thorsten Klose (tk@midibox.org)
10
;  Licensed for personal non-commercial use only.
11
;  All other rights reserved.
12
;
13
; ==========================================================================
14
 
15
;; --------------------------------------------------------------------------
16
;;  This function sets a parameter via CC
17
;;  IN:	SID_MIDI_PARAMETER1 selects CC number
18
;;      SID_MIDI_PARAMETER2 contains CC value
19
;;      SID_PATCH_BUFFER_SHADOW + SID_Ix_ENGINE[1:0] contains engine number
1122 tk 20
;;      MIOS_PARAMETER3 contains channel/instrument selection
679 tk 21
;;  USES: TABLAT, TBLPTR[LHU], PROD[LH], MIOS_PARAMETER[123], TMP1 (!!!)
22
;; --------------------------------------------------------------------------
23
SID_CC_TABLE_Set
24
	SET_BSR	SID_BASE
25
 
26
	;; get pointer to table depending on engine
27
	movf	SID_MIDI_PARAMETER1, W, BANKED
28
	movff	SID_PATCH_BUFFER_SHADOW + SID_Ix_ENGINE, TABLAT
29
	BRA_IFSET TABLAT, 1, ACCESS, SID_CC_TABLE_Set_DM
30
SID_CC_TABLE_Set_LB
31
	BRA_IFSET TABLAT, 0, ACCESS, SID_CC_TABLE_Set_B
32
SID_CC_TABLE_Set_L
33
	TABLE_ADDR_MUL_W SID_CC_TABLE_L, 1
34
	rgoto	SID_CC_TABLE_Set_Cont
35
SID_CC_TABLE_Set_B
36
	TABLE_ADDR_MUL_W SID_CC_TABLE_B, 1
37
	rgoto	SID_CC_TABLE_Set_Cont
38
 
39
SID_CC_TABLE_Set_DM
40
	BRA_IFSET TABLAT, 0, ACCESS, SID_CC_TABLE_Set_M
41
SID_CC_TABLE_Set_D
42
	TABLE_ADDR_MUL_W SID_CC_TABLE_D, 1
43
	rgoto	SID_CC_TABLE_Set_Cont
44
SID_CC_TABLE_Set_M
45
	TABLE_ADDR_MUL_W SID_CC_TABLE_M, 1
46
	;; 	rgoto	SID_CC_TABLE_Set_Cont
47
 
48
SID_CC_TABLE_Set_Cont
49
 
50
	tblrd*+
51
	movf	TABLAT, W
52
	bz	SID_CC_TABLE_Set_End ; NOP
53
 
54
	;; store parameter in TMP1
55
	movwf	TMP1
56
 
57
	;; check value range by (mis-)using the scale function
58
	;; scale down 0xffff, and check if the resulting value is <= 0x7f
59
	movlw	0xff
60
	movwf	MIOS_PARAMETER1
61
	movwf	MIOS_PARAMETER2
62
	bcf	MIOS_PARAMETER3, 3 ; scale down
63
	movf	TMP1, W
64
	call	SID_PARIN_Scale
65
 
66
	movf	MIOS_PARAMETER2, W
67
	bnz	SID_CC_TABLE_Set_Scaled
68
	movf	MIOS_PARAMETER1, W
69
	andlw	0x80
70
	bnz	SID_CC_TABLE_Set_Scaled
71
 
72
SID_CC_TABLE_Set_Unscaled
73
	;; pass 7bit value -> MIOS_PARAMETER[12]
74
	movff	SID_MIDI_PARAMETER2, MIOS_PARAMETER1
75
	clrf	MIOS_PARAMETER2
1122 tk 76
	;; MIOS_PARAMETER3 already prepared before function call
679 tk 77
	;; perform parameter change
78
	movf	TMP1, W
79
	call	SID_PARIN_Set
80
 	rgoto	SID_CC_TABLE_Set_End
81
 
82
SID_CC_TABLE_Set_Scaled
83
	;; convert 7bit CC value to 16bit value -> MIOS_PARAMETER[12]
84
	clrf	MIOS_PARAMETER1
85
	rlf	SID_MIDI_PARAMETER2, W, BANKED
86
	movwf	MIOS_PARAMETER2
1122 tk 87
	;; MIOS_PARAMETER3 already prepared before function call
679 tk 88
	;; perform parameter change
89
	movf	TMP1, W
90
	call	SID_PARIN_Set16
91
	;; 	rgoto	SID_CC_TABLE_Set_End
92
 
93
SID_CC_TABLE_Set_End
94
	return
95
 
96
 
97
;; --------------------------------------------------------------------------
98
;;  CC Tables
99
;;  see also mbsidv2_cc_chart.txt
100
;;
101
;;  Note that following parameters are already mapped and therefore listed
102
;;  as NOP here:
103
;;    CC#00: select Bank
104
;;    CC#01: Knob#1
105
;;    CC#06: NRPN MSB Value
106
;;    CC#16: Knob#2
107
;;    CC#17: Knob#3
108
;;    CC#18: Knob#4
109
;;    CC#19: Knob#5
110
;;    CC#38: NRPN LSB Value
111
;;    CC#64: Sustain
112
;;    CC#98: NRPN LSB
113
;;    CC#99: NRPN MSB
114
;; --------------------------------------------------------------------------
115
 
116
;; --------------------------------------------------------------------------
117
;; -- Lead Engine
118
;; --------------------------------------------------------------------------
119
SID_CC_TABLE_L
745 tk 120
	db	0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x00, 0x01	; offset 0x00
679 tk 121
	db	0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x08
122
	db	0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x22, 0x23	; offset 0x10
123
	db	0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b	; offset 0x18
124
	db	0x2c, 0x2d, 0x2e, 0x2f, 0x48, 0x4c, 0x00, 0x00	; offset 0x20
681 tk 125
	db	0x00, 0x00, 0xc1, 0xc3, 0xc8, 0xc9, 0xca, 0xd1	; offset 0x28
126
	db	0xd3, 0xd8, 0xd9, 0xda, 0x88, 0x89, 0x8a, 0x8b	; offset 0x30
679 tk 127
	db	0x8c, 0x8d, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95	; offset 0x38
128
	db	0x00, 0x00, 0x00, 0x00, 0x30, 0x31, 0x32, 0x33	; offset 0x40
129
	db	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f	; offset 0x48
130
	db	0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47	; offset 0x50
131
	db	0x00, 0x00, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65	; offset 0x58
132
	db	0x66, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x60
133
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x68
134
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x70
135
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x78
1122 tk 136
 
137
 
138
SID_CC_TABLE_B
139
	db	0x00, 0x00, 0x00, 0x00, 0x61, 0x65, 0x00, 0x01	; offset 0x00
140
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x08
141
	db	0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00	; offset 0x10
142
	db	0x25, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00	; offset 0x18
143
	db	0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x20
144
	db	0xc1, 0xc5, 0xc9, 0xcd, 0xd1, 0xd5, 0xd9, 0xe1	; offset 0x28
145
	db	0x00, 0x00, 0x89, 0x91, 0x99, 0xa1, 0x8d, 0x95	; offset 0x30
146
	db	0x9d, 0xa5, 0x00, 0x00, 0x69, 0x6d, 0x71, 0x00	; offset 0x38
147
	db	0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00	; offset 0x40
148
	db	0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00	; offset 0x48
149
	db	0x41, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00	; offset 0x50
150
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x58
151
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x60
152
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x68
153
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x70
154
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x78
155
 
156
 
157
SID_CC_TABLE_D
158
	db	0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x01	; offset 0x00
159
	db	0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x08
160
	db	0x00, 0x00, 0x00, 0x00, 0x30, 0x31, 0x32, 0x33	; offset 0x10
161
	db	0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b	; offset 0x18
162
	db	0x3c, 0x3d, 0x3e, 0x3f, 0x00, 0x00, 0x00, 0x00	; offset 0x20
163
	db	0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87	; offset 0x28
164
	db	0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f	; offset 0x30
165
	db	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97	; offset 0x38
166
	db	0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f	; offset 0x40
167
	db	0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7	; offset 0x48
168
	db	0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf	; offset 0x50
169
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x58
170
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x60
171
	db	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7	; offset 0x68
172
	db	0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf	; offset 0x70
173
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x78
174
 
175
 
176
SID_CC_TABLE_M
177
	db	0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x01	; offset 0x00
178
	db	0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x08
179
	db	0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00	; offset 0x10
180
	db	0x29, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00	; offset 0x18
181
	db	0x39, 0x00, 0x00, 0x00, 0x69, 0x71, 0x00, 0x00	; offset 0x20
182
	db	0xc1, 0xc9, 0xd1, 0xd9, 0xe1, 0xe9, 0xf1, 0x00	; offset 0x28
183
	db	0x00, 0x00, 0x81, 0x89, 0x91, 0x99, 0xa1, 0xa9	; offset 0x30
184
	db	0xb1, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x38
185
	db	0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00	; offset 0x40
186
	db	0x49, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00	; offset 0x48
187
	db	0x59, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00	; offset 0x50
188
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x58
189
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x60
190
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x68
191
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x70
192
	db	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	; offset 0x78