Subversion Repositories svn.mios

Rev

Rev 1097 | Rev 1117 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1097 Rev 1113
Line 24... Line 24...
24
<CENTER><A HREF="mios_studio/mios_studio_mbng3.png"><IMG SRC="mios_studio/mios_studio_mbng3.png" width=401 height=350></A></CENTER>
24
<CENTER><A HREF="mios_studio/mios_studio_mbng3.png"><IMG SRC="mios_studio/mios_studio_mbng3.png" width=401 height=350></A></CENTER>
25
25
26
<P CLASS=DESC>The filename has to be specified without the .NGC extension.
26
<P CLASS=DESC>The filename has to be specified without the .NGC extension.
27
27
28
<P CLASS=DESC>From the MIOS Terminal it's also possible to store the current setup. So - in order to make any setup as your DEFAULT setup which will be restored after power-on, just type:
28
<P CLASS=DESC>From the MIOS Terminal it's also possible to store the current setup. So - in order to make any setup as your DEFAULT setup which will be restored after power-on, just type:
29
<TT><PRE style="margin-left:50px">
29
<TT><PRE style="margin-left:50px; font-size:8pt">
30
load &lt;your-setup-file&gt;
30
load &lt;your-setup-file&gt;
31
save default
31
save default
32
</PRE></TT>
32
</PRE></TT>
33
-&gt; done! :-)</P>
33
-&gt; done! :-)</P>
34
34
Line 40... Line 40...
40
<P CLASS=DESC>In MIOS Filebrowser, create a new configuration file by clicking on the "Create File" button. Name it "hello.ngc", and then click on the "Update" button to re-scan the directory.
40
<P CLASS=DESC>In MIOS Filebrowser, create a new configuration file by clicking on the "Create File" button. Name it "hello.ngc", and then click on the "Update" button to re-scan the directory.
41
41
42
<P CLASS=DESC>Click on the "HELLO.NGC" file and push the "Edit Text" button.
42
<P CLASS=DESC>Click on the "HELLO.NGC" file and push the "Edit Text" button.
43
43
44
<P CLASS=DESC>Thereafter enter following commands into this file:
44
<P CLASS=DESC>Thereafter enter following commands into this file:
45
<TT><PRE style="margin-left:50px">
45
<TT><PRE style="margin-left:50px; font-size:8pt">
46
RESET_HW
46
RESET_HW
47
47
48
LCD "%CHello World!"
48
LCD "%CHello World!"
49
</PRE></TT>
49
</PRE></TT>
50
50
51
<P CLASS=DESC>Click on the "Save" button, change to the main MIOS Studio window and enter following command into the MIOS Terminal:
51
<P CLASS=DESC>Click on the "Save" button, change to the main MIOS Studio window and enter following command into the MIOS Terminal:
52
<TT><PRE style="margin-left:50px">
52
<TT><PRE style="margin-left:50px; font-size:8pt">
53
load hello
53
load hello
54
</PRE></TT>
54
</PRE></TT>
55
55
56
<P CLASS=DESC>Your LCD should show the message now!
56
<P CLASS=DESC>Your LCD should show the message now!
57
57
Line 65... Line 65...
65
<P CLASS=DESC>The next experiment will work if a DIN shift register (e.g. of a <A HREF="mbhp_din.html">MBHP_DIN</A> or <A HREF="mbhp_dio_matrix.html">MBHP_DIO_MATRIX</A> module is connected to J8/9 of the core module.
65
<P CLASS=DESC>The next experiment will work if a DIN shift register (e.g. of a <A HREF="mbhp_din.html">MBHP_DIN</A> or <A HREF="mbhp_dio_matrix.html">MBHP_DIO_MATRIX</A> module is connected to J8/9 of the core module.
66
66
67
<P CLASS=DESC>We want to generate a Note event with a button connected to the D0 pin of the first shift register. The appr. button ID is 1.
67
<P CLASS=DESC>We want to generate a Note event with a button connected to the D0 pin of the first shift register. The appr. button ID is 1.
68
68
69
<P CLASS=DESC>Add following command to your HELLO.NGC file:
69
<P CLASS=DESC>Add following command to your HELLO.NGC file:
70
<TT><PRE style="margin-left:50px">
70
<TT><PRE style="margin-left:50px; font-size:8pt">
71
RESET_HW
71
RESET_HW
72
72
73
LCD "%CHello World!"
73
LCD "%CHello World!"
74
74
75
EVENT_BUTTON id=1  type=NoteOn key=36
75
EVENT_BUTTON id=1  type=NoteOn key=36
Line 84... Line 84...
84
84
85
<H2> <IMG SRC="images/bullet.gif" ALT=""> Push me softer! </H2>
85
<H2> <IMG SRC="images/bullet.gif" ALT=""> Push me softer! </H2>
86
86
87
<P CLASS=DESC>You want to play a Note with less velocity? Then just change the range of the event:
87
<P CLASS=DESC>You want to play a Note with less velocity? Then just change the range of the event:
88
88
89
<TT><PRE style="margin-left:50px">
89
<TT><PRE style="margin-left:50px; font-size:8pt">
90
EVENT_BUTTON id=1  type=NoteOn key=36 range=0:100
90
EVENT_BUTTON id=1  type=NoteOn key=36 range=0:100
91
</PRE></TT>
91
</PRE></TT>
92
92
93
<P CLASS=DESC>The MIDI IN monitor of MIOS Studio should now display NoteOn events with velocity 100
93
<P CLASS=DESC>The MIDI IN monitor of MIOS Studio should now display NoteOn events with velocity 100
94
94
95
95
96
<H2> <IMG SRC="images/bullet.gif" ALT=""> Changing the Channel </H2>
96
<H2> <IMG SRC="images/bullet.gif" ALT=""> Changing the Channel </H2>
97
97
98
<P CLASS=DESC>Events are sent to MIDI channel 1 by default. If you want to select a different channel, e.g. 3, write:
98
<P CLASS=DESC>Events are sent to MIDI channel 1 by default. If you want to select a different channel, e.g. 3, write:
99
99
100
<TT><PRE style="margin-left:50px">
100
<TT><PRE style="margin-left:50px; font-size:8pt">
101
EVENT_BUTTON id=1  type=NoteOn key=36 chn=3 range=0:100
101
EVENT_BUTTON id=1  type=NoteOn key=36 chn=3 range=0:100
102
</PRE></TT>
102
</PRE></TT>
103
103
104
<P CLASS=DESC>The MIDI protocol provides 16 MIDI channels....
104
<P CLASS=DESC>The MIDI protocol provides 16 MIDI channels....
105
105
Line 107... Line 107...
107
<H2> <IMG SRC="images/bullet.gif" ALT=""> Changing the Port </H2>
107
<H2> <IMG SRC="images/bullet.gif" ALT=""> Changing the Port </H2>
108
108
109
<P CLASS=DESC>...but in some situations it might be helpful to have more!
109
<P CLASS=DESC>...but in some situations it might be helpful to have more!
110
110
111
<P CLASS=DESC>For this purpose, MIDIbox NG provides multiple MIDI ports. With following command:
111
<P CLASS=DESC>For this purpose, MIDIbox NG provides multiple MIDI ports. With following command:
112
<TT><PRE style="margin-left:50px">
112
<TT><PRE style="margin-left:50px; font-size:8pt">
113
EVENT_BUTTON id=1  type=NoteOn key=36 chn=3 range=0:100 ports=0100010000000000
113
EVENT_BUTTON id=1  type=NoteOn key=36 chn=3 range=0:100 ports=0100010000000000
114
</PRE></TT>
114
</PRE></TT>
115
115
116
<P CLASS=DESC>The MIDI event will now be send over USB2 and MIDI OUT2
116
<P CLASS=DESC>The MIDI event will now be send over USB2 and MIDI OUT2
117
117
Line 121... Line 121...
121
<H2> <IMG SRC="images/bullet.gif" ALT=""> Be Verbose! </H2>
121
<H2> <IMG SRC="images/bullet.gif" ALT=""> Be Verbose! </H2>
122
122
123
<P CLASS=DESC>Now we want to display the button movement on our LCD, because the "Hello World!" message gets boring.
123
<P CLASS=DESC>Now we want to display the button movement on our LCD, because the "Hello World!" message gets boring.
124
124
125
<P CLASS=DESC>Replace the previous EVENT definition by:
125
<P CLASS=DESC>Replace the previous EVENT definition by:
126
<TT><PRE style="margin-left:50px">
126
<TT><PRE style="margin-left:50px; font-size:8pt">
127
EVENT_BUTTON id=1  type=NoteOn key=36  lcd_pos=1:1:1 label="Button #%3i: %3d"
127
EVENT_BUTTON id=1  type=NoteOn key=36  lcd_pos=1:1:1 label="Button #%3i: %3d"
128
</PRE></TT>
128
</PRE></TT>
129
129
130
Whenever you are pushing the button, the LCD should display: <TT>Button #  1: 127</TT><BR>
130
Whenever you are pushing the button, the LCD should display: <TT>Button #  1: 127</TT><BR>
131
When it's released the LCD should display: <TT>Button #  1:   0</TT>
131
When it's released the LCD should display: <TT>Button #  1:   0</TT>
Line 139... Line 139...
139
139
140
<P CLASS=DESC>So much about the obligatory disclaimer... don't worry, this resistor should be already stuffed on your <A HREF="mbhp_dout.html">MBHP_DOUT</A> module
140
<P CLASS=DESC>So much about the obligatory disclaimer... don't worry, this resistor should be already stuffed on your <A HREF="mbhp_dout.html">MBHP_DOUT</A> module
141
141
142
<P CLASS=DESC>Change the EVENT_BUTTON definition in your HELLO.NGC file as follows:
142
<P CLASS=DESC>Change the EVENT_BUTTON definition in your HELLO.NGC file as follows:
143
143
144
<TT><PRE style="margin-left:50px">
144
<TT><PRE style="margin-left:50px; font-size:8pt">
145
EVENT_BUTTON id=1  fwd_id=LED:1  type=NoteOn key=36  lcd_pos=1:1:1 label="Button #%3i: %3d"
145
EVENT_BUTTON id=1  fwd_id=LED:1  type=NoteOn key=36  lcd_pos=1:1:1 label="Button #%3i: %3d"
146
</PRE></TT>
146
</PRE></TT>
147
147
148
<P CLASS=DESC>The LED should turn on while you are pressing the button.
148
<P CLASS=DESC>The LED should turn on while you are pressing the button.
149
149
Line 159... Line 159...
159
159
160
<H2> <IMG SRC="images/bullet.gif" ALT=""> Toggle me! </H2>
160
<H2> <IMG SRC="images/bullet.gif" ALT=""> Toggle me! </H2>
161
161
162
<P CLASS=DESC>Sometimes you probably want to hold the button state after the button has been pushed, and you want to turn it off by pushing it again. This toggling behaviour can be easily configured with the "button_mode" parameter:
162
<P CLASS=DESC>Sometimes you probably want to hold the button state after the button has been pushed, and you want to turn it off by pushing it again. This toggling behaviour can be easily configured with the "button_mode" parameter:
163
163
164
<TT><PRE style="margin-left:50px">
164
<TT><PRE style="margin-left:50px; font-size:8pt">
165
EVENT_BUTTON id=1  fwd_id=LED:1  type=NoteOn key=36 range=0:127  button_mode=Toggle
165
EVENT_BUTTON id=1  fwd_id=LED:1  type=NoteOn key=36 range=0:127  button_mode=Toggle
166
</PRE></TT>
166
</PRE></TT>
167
167
168
168
169
<H2> <IMG SRC="images/bullet.gif" ALT=""> Surprise me! </H2>
169
<H2> <IMG SRC="images/bullet.gif" ALT=""> Surprise me! </H2>
170
170
171
<P CLASS=DESC>Our last experiment with a single button ends with a small surprise: change the EVENT_BUTTON statement to:
171
<P CLASS=DESC>Our last experiment with a single button ends with a small surprise: change the EVENT_BUTTON statement to:
172
172
173
<TT><PRE style="margin-left:50px">
173
<TT><PRE style="margin-left:50px; font-size:8pt">
174
EVENT_BUTTON id=1  fwd_id=LED:1  button_mode=OnOnly \
174
EVENT_BUTTON id=1  fwd_id=LED:1  button_mode=OnOnly \
175
             type=SysEx stream="0xf0 0x00 0x00 0x7e 0x32 0x00 0x0d 0x40 0x57 0x6F 0x77 0x21 0xf7" \
175
             type=SysEx stream="0xf0 0x00 0x00 0x7e 0x32 0x00 0x0d 0x40 0x57 0x6F 0x77 0x21 0xf7" \
176
             lcd_pos=1:1:1 label="Button #%3i: %3d"
176
             lcd_pos=1:1:1 label="Button #%3i: %3d"
177
</PRE></TT>
177
</PRE></TT>
178
178
Line 187... Line 187...
187
187
188
<P CLASS=DESC>This behaviour can be configured with so called "Radio groups" (see also <A HREF="http://en.wikipedia.org/wiki/Radio_button" TARGET="_blank">this Wikipedia article about Radio Buttons</A>).
188
<P CLASS=DESC>This behaviour can be configured with so called "Radio groups" (see also <A HREF="http://en.wikipedia.org/wiki/Radio_button" TARGET="_blank">this Wikipedia article about Radio Buttons</A>).
189
189
190
<P CLASS=DESC>So, let's try it! Following experiment requires 8 buttons connected to the first DIN shift register (input D0..D7), and 8 LEDs connected to the first DOUT shift register (output D7..D0):
190
<P CLASS=DESC>So, let's try it! Following experiment requires 8 buttons connected to the first DIN shift register (input D0..D7), and 8 LEDs connected to the first DOUT shift register (output D7..D0):
191
191
192
<TT><PRE style="margin-left:50px">
192
<TT><PRE style="margin-left:50px; font-size:8pt">
193
EVENT_BUTTON id=  1  fwd_id=LED:1  type=CC chn=1 cc=16  button_mode=OnOnly  range= 0:0   radio_group=1
193
EVENT_BUTTON id=  1  fwd_id=LED:1  type=CC chn=1 cc=16  button_mode=OnOnly  range= 0:0   radio_group=1
194
EVENT_BUTTON id=  2  fwd_id=LED:2  type=CC chn=1 cc=16  button_mode=OnOnly  range= 1:1   radio_group=1
194
EVENT_BUTTON id=  2  fwd_id=LED:2  type=CC chn=1 cc=16  button_mode=OnOnly  range= 1:1   radio_group=1
195
EVENT_BUTTON id=  3  fwd_id=LED:3  type=CC chn=1 cc=16  button_mode=OnOnly  range= 2:2   radio_group=1
195
EVENT_BUTTON id=  3  fwd_id=LED:3  type=CC chn=1 cc=16  button_mode=OnOnly  range= 2:2   radio_group=1
196
EVENT_BUTTON id=  4  fwd_id=LED:4  type=CC chn=1 cc=16  button_mode=OnOnly  range= 3:3   radio_group=1
196
EVENT_BUTTON id=  4  fwd_id=LED:4  type=CC chn=1 cc=16  button_mode=OnOnly  range= 3:3   radio_group=1
197
EVENT_BUTTON id=  5  fwd_id=LED:5  type=CC chn=1 cc=16  button_mode=OnOnly  range= 4:4   radio_group=1
197
EVENT_BUTTON id=  5  fwd_id=LED:5  type=CC chn=1 cc=16  button_mode=OnOnly  range= 4:4   radio_group=1
Line 211... Line 211...
211
211
212
<P CLASS=DESC>The same can be done without buttons, but only with LEDs. And it's also possible to select larger value ranges for a radio group!
212
<P CLASS=DESC>The same can be done without buttons, but only with LEDs. And it's also possible to select larger value ranges for a radio group!
213
213
214
<P CLASS=DESC>So, let's assume that 8 additional LEDs are connected to the second DOUT shift register, output D7..D0. We want to select the LED depeding on the incoming CC1 (modulation wheel) value. Just write:
214
<P CLASS=DESC>So, let's assume that 8 additional LEDs are connected to the second DOUT shift register, output D7..D0. We want to select the LED depeding on the incoming CC1 (modulation wheel) value. Just write:
215
215
216
<TT><PRE style="margin-left:50px">
216
<TT><PRE style="margin-left:50px; font-size:8pt">
217
EVENT_LED    id=  9                type=CC chn=1 cc= 1  range= 0:9  radio_group=2
217
EVENT_LED    id=  9                type=CC chn=1 cc= 1  range= 0:9  radio_group=2
218
EVENT_LED    id= 10                type=CC chn=1 cc= 1  range=10:19 radio_group=2
218
EVENT_LED    id= 10                type=CC chn=1 cc= 1  range=10:19 radio_group=2
219
EVENT_LED    id= 11                type=CC chn=1 cc= 1  range=20:29 radio_group=2
219
EVENT_LED    id= 11                type=CC chn=1 cc= 1  range=20:29 radio_group=2
220
EVENT_LED    id= 12                type=CC chn=1 cc= 1  range=30:39 radio_group=2
220
EVENT_LED    id= 12                type=CC chn=1 cc= 1  range=30:39 radio_group=2
221
EVENT_LED    id= 13                type=CC chn=1 cc= 1  range=40:49 radio_group=2
221
EVENT_LED    id= 13                type=CC chn=1 cc= 1  range=40:49 radio_group=2
Line 233... Line 233...
233
233
234
<P CLASS=DESC>MIOS32 supports different type of encoders, we can mainly differentiate between "detented" and "non-detented". For detented encoders we also have to differ between various types, mainly depending on the state where it makes "click" ;-)
234
<P CLASS=DESC>MIOS32 supports different type of encoders, we can mainly differentiate between "detented" and "non-detented". For detented encoders we also have to differ between various types, mainly depending on the state where it makes "click" ;-)
235
235
236
<P CLASS=DESC>The configuration of an encoder has to be done independent from the EVENT definition. E.g. take following configuration as an example:
236
<P CLASS=DESC>The configuration of an encoder has to be done independent from the EVENT definition. E.g. take following configuration as an example:
237
237
238
<TT><PRE style="margin-left:50px">
238
<TT><PRE style="margin-left:50px; font-size:8pt">
239
ENC n=  1   sr=3 pins=0:1   type=non_detented
239
ENC n=  1   sr=3 pins=0:1   type=non_detented
240
ENC n=  2   sr=3 pins=2:3   type=non_detented
240
ENC n=  2   sr=3 pins=2:3   type=non_detented
241
ENC n=  3   sr=3 pins=4:5   type=non_detented
241
ENC n=  3   sr=3 pins=4:5   type=non_detented
242
ENC n=  4   sr=3 pins=6:7   type=non_detented
242
ENC n=  4   sr=3 pins=6:7   type=non_detented
243
ENC n=  5   sr=4 pins=0:1   type=non_detented
243
ENC n=  5   sr=4 pins=0:1   type=non_detented
Line 249... Line 249...
249
<P CLASS=DESC>In this example it's assumed, that 8 rotary encoders are connected to the third and fourth DIN shift register of your <A HREF="mbhp_din.html">MBHP_DINX4</A> module. Of course, you are free to use different DIN SRs for this, please adapt your configuration accordingly by changing the "sr=&lt;shift-register-number&gt;" assignment.
249
<P CLASS=DESC>In this example it's assumed, that 8 rotary encoders are connected to the third and fourth DIN shift register of your <A HREF="mbhp_din.html">MBHP_DINX4</A> module. Of course, you are free to use different DIN SRs for this, please adapt your configuration accordingly by changing the "sr=&lt;shift-register-number&gt;" assignment.
250
250
251
<P CLASS=DESC>Channel A and B of the encoder have to be connected to pin D0/D1, D2/D3, D4/D5 or D6/D7. The third pin has to be connected to ground. Some encoders have the ground at the middle pin, some others at the left or right pin - please consult the datasheet of the encoder that you bought!
251
<P CLASS=DESC>Channel A and B of the encoder have to be connected to pin D0/D1, D2/D3, D4/D5 or D6/D7. The third pin has to be connected to ground. Some encoders have the ground at the middle pin, some others at the left or right pin - please consult the datasheet of the encoder that you bought!
252
252
253
<P CLASS=DESC>Without EVENT_ENC definition your encoder won't generate any MIDI event. But you will already be able to check, if encoder movements are notified by MIOS32. For this purpose, please activate the debug mode of MIDIbox NG in <B>the MIOS Terminal</B>:
253
<P CLASS=DESC>Without EVENT_ENC definition your encoder won't generate any MIDI event. But you will already be able to check, if encoder movements are notified by MIOS32. For this purpose, please activate the debug mode of MIDIbox NG in <B>the MIOS Terminal</B>:
254
<TT><PRE style="margin-left:50px">
254
<TT><PRE style="margin-left:50px; font-size:8pt">
255
set debug on
255
set debug on
256
</PRE></TT>
256
</PRE></TT>
257
257
258
When you are now moving the encoder, you should get debugging messages such as:
258
When you are now moving the encoder, you should get debugging messages such as:
259
<TT><PRE style="margin-left:50px">
259
<TT><PRE style="margin-left:50px; font-size:8pt">
260
...
260
...
261
[472675.962] MBNG_ENC_NotifyChange(0, 1)
261
[472675.962] MBNG_ENC_NotifyChange(0, 1)
262
[472675.962] No event assigned to ENC id=1
262
[472675.962] No event assigned to ENC id=1
263
[472676.035] MBNG_ENC_NotifyChange(0, 1)
263
[472676.035] MBNG_ENC_NotifyChange(0, 1)
264
[472676.035] No event assigned to ENC id=1
264
[472676.035] No event assigned to ENC id=1
Line 267... Line 267...
267
...
267
...
268
</PRE></TT>
268
</PRE></TT>
269
269
270
<P CLASS=DESC>on clockwise movements, and:
270
<P CLASS=DESC>on clockwise movements, and:
271
271
272
<TT><PRE style="margin-left:50px">
272
<TT><PRE style="margin-left:50px; font-size:8pt">
273
...
273
...
274
[472692.954] MBNG_ENC_NotifyChange(0, -1)
274
[472692.954] MBNG_ENC_NotifyChange(0, -1)
275
[472692.954] No event assigned to ENC id=1
275
[472692.954] No event assigned to ENC id=1
276
[472692.969] MBNG_ENC_NotifyChange(0, -1)
276
[472692.969] MBNG_ENC_NotifyChange(0, -1)
277
[472692.969] No event assigned to ENC id=1
277
[472692.969] No event assigned to ENC id=1
Line 296... Line 296...
296
296
297
<H2> <IMG SRC="images/bullet.gif" ALT=""> Encoder: send MIDI - now! </H2>
297
<H2> <IMG SRC="images/bullet.gif" ALT=""> Encoder: send MIDI - now! </H2>
298
298
299
<P CLASS=DESC>It's time to assign MIDI events to the encoders:
299
<P CLASS=DESC>It's time to assign MIDI events to the encoders:
300
300
301
<TT><PRE style="margin-left:50px">
301
<TT><PRE style="margin-left:50px; font-size:8pt">
302
EVENT_ENC id=1  type=CC chn= 1 cc= 16
302
EVENT_ENC id=1  type=CC chn= 1 cc= 16
303
EVENT_ENC id=2  type=CC chn= 1 cc= 17
303
EVENT_ENC id=2  type=CC chn= 1 cc= 17
304
EVENT_ENC id=3  type=CC chn= 1 cc= 18
304
EVENT_ENC id=3  type=CC chn= 1 cc= 18
305
EVENT_ENC id=4  type=CC chn= 1 cc= 19
305
EVENT_ENC id=4  type=CC chn= 1 cc= 19
306
EVENT_ENC id=5  type=CC chn= 1 cc= 20
306
EVENT_ENC id=5  type=CC chn= 1 cc= 20
Line 322... Line 322...
322
322
323
<H2> <IMG SRC="images/bullet.gif" ALT=""> Display me! </H2>
323
<H2> <IMG SRC="images/bullet.gif" ALT=""> Display me! </H2>
324
324
325
<P CLASS=DESC>You already own a LCD? Fine - the next experiment will display some useful informations on the LCD instead of the static "Hello World!" string:
325
<P CLASS=DESC>You already own a LCD? Fine - the next experiment will display some useful informations on the LCD instead of the static "Hello World!" string:
326
326
327
<TT><PRE style="margin-left:50px">
327
<TT><PRE style="margin-left:50px; font-size:8pt">
328
EVENT_ENC id=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
328
EVENT_ENC id=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
329
EVENT_ENC id=2  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
329
EVENT_ENC id=2  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
330
EVENT_ENC id=3  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
330
EVENT_ENC id=3  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
331
EVENT_ENC id=4  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
331
EVENT_ENC id=4  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
332
EVENT_ENC id=5  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
332
EVENT_ENC id=5  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d%B"
Line 341... Line 341...
341
<H2> <IMG SRC="images/bullet.gif" ALT=""> Toy me! </H2>
341
<H2> <IMG SRC="images/bullet.gif" ALT=""> Toy me! </H2>
342
342
343
<P CLASS=DESC>Let's play a bit with the labels. The example above overwrites the previous string whenever a different encoder is moved. But what if you want to get an oversight over all encoders - at least a vertical meter for each encoder?
343
<P CLASS=DESC>Let's play a bit with the labels. The example above overwrites the previous string whenever a different encoder is moved. But what if you want to get an oversight over all encoders - at least a vertical meter for each encoder?
344
344
345
<P CLASS=DESC>Try this one:
345
<P CLASS=DESC>Try this one:
346
<TT><PRE style="margin-left:50px">
346
<TT><PRE style="margin-left:50px; font-size:8pt">
347
EVENT_ENC id=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
347
EVENT_ENC id=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
348
EVENT_ENC id=2  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:2:2)%B"
348
EVENT_ENC id=2  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:2:2)%B"
349
EVENT_ENC id=3  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:3:2)%B"
349
EVENT_ENC id=3  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:3:2)%B"
350
EVENT_ENC id=4  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:4:2)%B"
350
EVENT_ENC id=4  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:4:2)%B"
351
EVENT_ENC id=5  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:5:2)%B"
351
EVENT_ENC id=5  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:5:2)%B"
Line 360... Line 360...
360
360
361
<P CLASS=DESC>You may have already noticed, that the LCD message isn't updated when the encoder value is changed from external (e.g. from a slider in MIOS Studio). The reason is, that incoming MIDI events won't trigger a LCD message by default (because this could be unwanted under certain situations).
361
<P CLASS=DESC>You may have already noticed, that the LCD message isn't updated when the encoder value is changed from external (e.g. from a slider in MIOS Studio). The reason is, that incoming MIDI events won't trigger a LCD message by default (because this could be unwanted under certain situations).
362
362
363
<P CLASS=DESC>In order to update the LCD also in such situations, add the "fwd_to_lcd=1" parameter to your EVENT_* definition:
363
<P CLASS=DESC>In order to update the LCD also in such situations, add the "fwd_to_lcd=1" parameter to your EVENT_* definition:
364
364
365
<TT><PRE style="margin-left:50px">
365
<TT><PRE style="margin-left:50px; font-size:8pt">
366
EVENT_ENC id=1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
366
EVENT_ENC id=1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
367
EVENT_ENC id=2  fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:2:2)%B"
367
EVENT_ENC id=2  fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:2:2)%B"
368
EVENT_ENC id=3  fwd_to_lcd=1  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:3:2)%B"
368
EVENT_ENC id=3  fwd_to_lcd=1  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:3:2)%B"
369
EVENT_ENC id=4  fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:4:2)%B"
369
EVENT_ENC id=4  fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:4:2)%B"
370
EVENT_ENC id=5  fwd_to_lcd=1  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:5:2)%B"
370
EVENT_ENC id=5  fwd_to_lcd=1  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:5:2)%B"
Line 385... Line 385...
385
<P CLASS=DESC>Actually it doesn't matter, if you are building the circuit based on the given schematic, or customize it, e.g. only for 8 LED Rings, or with a different number of LEDs per ring.
385
<P CLASS=DESC>Actually it doesn't matter, if you are building the circuit based on the given schematic, or customize it, e.g. only for 8 LED Rings, or with a different number of LEDs per ring.
386
386
387
<P CLASS=DESC>The entry point to configure LED Rings is the <I>DOUT_MATRIX</I> command. It specifies the DOUT shift registers, which are used to access the LEDs in a matrix configuration. Matrix is good for such a usecase, because it saves a lot of digital output pins. The (small) drawback is, that LEDs are activated time multiplexed, which means that they are not so bright as if they would be driven directly (permanently) from a digital output pin. However, by using low-current LEDs this can be easily compensated. See it as an advantage: time multiplexing saves power (you still want to supply your MIDIbox NG via USB...)
387
<P CLASS=DESC>The entry point to configure LED Rings is the <I>DOUT_MATRIX</I> command. It specifies the DOUT shift registers, which are used to access the LEDs in a matrix configuration. Matrix is good for such a usecase, because it saves a lot of digital output pins. The (small) drawback is, that LEDs are activated time multiplexed, which means that they are not so bright as if they would be driven directly (permanently) from a digital output pin. However, by using low-current LEDs this can be easily compensated. See it as an advantage: time multiplexing saves power (you still want to supply your MIDIbox NG via USB...)
388
388
389
<P CLASS=DESC>So, in following configuration example we assume a 16 LED Ring configuration, because this is the most common one that I used in previous projects like the <A HREF="http://www.ucapps.de/midibox16e/midibox16e.jpg" TARGET="_blank">MIDIbox16E</A>:
389
<P CLASS=DESC>So, in following configuration example we assume a 16 LED Ring configuration, because this is the most common one that I used in previous projects like the <A HREF="http://www.ucapps.de/midibox16e/midibox16e.jpg" TARGET="_blank">MIDIbox16E</A>:
390
<TT><PRE style="margin-left:50px">
390
<TT><PRE style="margin-left:50px; font-size:8pt">
391
# LEDring configuration
391
# LEDring configuration
392
DOUT_MATRIX n= 1   rows=16 sr_dout_sel1= 1 sr_dout_sel2= 2  sr_dout_r1= 3 sr_dout_r2= 4
392
DOUT_MATRIX n= 1   rows=16 sr_dout_sel1= 1 sr_dout_sel2= 2  sr_dout_r1= 3 sr_dout_r2= 4
393
</PRE></TT>
393
</PRE></TT>
394
394
395
<P CLASS=DESC>Today we would prefer to use <A HREF="http://www.midibox.org/dokuwiki/doku.php?id=fairlightiii" TARGET="_blank">Fairlightiii's premade PCB solution</A> instead - more informations about this once I get my hands on the PCBs! :-)
395
<P CLASS=DESC>Today we would prefer to use <A HREF="http://www.midibox.org/dokuwiki/doku.php?id=fairlightiii" TARGET="_blank">Fairlightiii's premade PCB solution</A> instead - more informations about this once I get my hands on the PCBs! :-)
Line 397... Line 397...
397
<P CLASS=DESC>Anyhow, as you can see in the definitions above, the matrix allocates four DOUT shift registers to select the 16 rows, and to output the pattern. The pattern is predefined for 11 LEDs, but could also be changed for any number of LEDs with the <A HREF="midibox_ng_manual_ngc.html">LED_MATRIX_PATTERN</A> command.
397
<P CLASS=DESC>Anyhow, as you can see in the definitions above, the matrix allocates four DOUT shift registers to select the 16 rows, and to output the pattern. The pattern is predefined for 11 LEDs, but could also be changed for any number of LEDs with the <A HREF="midibox_ng_manual_ngc.html">LED_MATRIX_PATTERN</A> command.
398
398
399
<P CLASS=DESC>Now let's try following .NGC file - this is a copy&paste of my complete setup (for the case that you lost the thread... ;-)<BR>
399
<P CLASS=DESC>Now let's try following .NGC file - this is a copy&paste of my complete setup (for the case that you lost the thread... ;-)<BR>
400
<B>It might be necessary that you adapt the shift register (sr*=) definitions to your hardware, depending on which shift registers (SRs) your encoders and LED Rings are located!</B>
400
<B>It might be necessary that you adapt the shift register (sr*=) definitions to your hardware, depending on which shift registers (SRs) your encoders and LED Rings are located!</B>
401
401
402
<TT><PRE style="margin-left:50px">
402
<TT><PRE style="margin-left:50px; font-size:8pt">
403
RESET_HW
403
RESET_HW
404
404
405
LCD "%CHello"
405
LCD "%CHello"
406
406
407
# Encoder configuration
407
# Encoder configuration
Line 424... Line 424...
424
424
425
# LEDring configuration
425
# LEDring configuration
426
DOUT_MATRIX n= 1   rows=16 sr_dout_sel1= 1 sr_dout_sel2= 2  sr_dout_r1= 3 sr_dout_r2= 4
426
DOUT_MATRIX n= 1   rows=16 sr_dout_sel1= 1 sr_dout_sel2= 2  sr_dout_r1= 3 sr_dout_r2= 4
427
427
428
# Encoder events
428
# Encoder events
429
EVENT_ENC id= 1  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
429
EVENT_ENC id= 1  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  type=CC chn= 1 cc= 16  label="ENC #%3i    %3d@(1:1:2)%B"
430
EVENT_ENC id= 2  fwd_id=LED_MATRIX:2   fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:2:2)%B"
430
EVENT_ENC id= 2  fwd_id=LED_MATRIX:2   fwd_to_lcd=1  type=CC chn= 1 cc= 17  label="ENC #%3i    %3d@(1:2:2)%B"
431
EVENT_ENC id= 3  fwd_id=LED_MATRIX:3   fwd_to_lcd=1  type=CC chn= 1 cc= 18  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:3:2)%B"
431
EVENT_ENC id= 3  fwd_id=LED_MATRIX:3   fwd_to_lcd=1  type=CC chn= 1 cc= 18  label="ENC #%3i    %3d@(1:3:2)%B"
432
EVENT_ENC id= 4  fwd_id=LED_MATRIX:4   fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:4:2)%B"
432
EVENT_ENC id= 4  fwd_id=LED_MATRIX:4   fwd_to_lcd=1  type=CC chn= 1 cc= 19  label="ENC #%3i    %3d@(1:4:2)%B"
433
EVENT_ENC id= 5  fwd_id=LED_MATRIX:5   fwd_to_lcd=1  type=CC chn= 1 cc= 20  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:5:2)%B"
433
EVENT_ENC id= 5  fwd_id=LED_MATRIX:5   fwd_to_lcd=1  type=CC chn= 1 cc= 20  label="ENC #%3i    %3d@(1:5:2)%B"
434
EVENT_ENC id= 6  fwd_id=LED_MATRIX:6   fwd_to_lcd=1  type=CC chn= 1 cc= 21  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:6:2)%B"
434
EVENT_ENC id= 6  fwd_id=LED_MATRIX:6   fwd_to_lcd=1  type=CC chn= 1 cc= 21  label="ENC #%3i    %3d@(1:6:2)%B"
435
EVENT_ENC id= 7  fwd_id=LED_MATRIX:7   fwd_to_lcd=1  type=CC chn= 1 cc= 22  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:7:2)%B"
435
EVENT_ENC id= 7  fwd_id=LED_MATRIX:7   fwd_to_lcd=1  type=CC chn= 1 cc= 22  label="ENC #%3i    %3d@(1:7:2)%B"
436
EVENT_ENC id= 8  fwd_id=LED_MATRIX:8   fwd_to_lcd=1  type=CC chn= 1 cc= 23  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:8:2)%B"
436
EVENT_ENC id= 8  fwd_id=LED_MATRIX:8   fwd_to_lcd=1  type=CC chn= 1 cc= 23  label="ENC #%3i    %3d@(1:8:2)%B"
437
EVENT_ENC id= 9  fwd_id=LED_MATRIX:9   fwd_to_lcd=1  type=CC chn= 1 cc= 24  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:9:2)%B"
437
EVENT_ENC id= 9  fwd_id=LED_MATRIX:9   fwd_to_lcd=1  type=CC chn= 1 cc= 24  label="ENC #%3i    %3d@(1:9:2)%B"
438
EVENT_ENC id=10  fwd_id=LED_MATRIX:10  fwd_to_lcd=1  type=CC chn= 1 cc= 25  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:10:2)%B"
438
EVENT_ENC id=10  fwd_id=LED_MATRIX:10  fwd_to_lcd=1  type=CC chn= 1 cc= 25  label="ENC #%3i    %3d@(1:10:2)%B"
439
EVENT_ENC id=11  fwd_id=LED_MATRIX:11  fwd_to_lcd=1  type=CC chn= 1 cc= 26  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:11:2)%B"
439
EVENT_ENC id=11  fwd_id=LED_MATRIX:11  fwd_to_lcd=1  type=CC chn= 1 cc= 26  label="ENC #%3i    %3d@(1:11:2)%B"
440
EVENT_ENC id=12  fwd_id=LED_MATRIX:12  fwd_to_lcd=1  type=CC chn= 1 cc= 27  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:12:2)%B"
440
EVENT_ENC id=12  fwd_id=LED_MATRIX:12  fwd_to_lcd=1  type=CC chn= 1 cc= 27  label="ENC #%3i    %3d@(1:12:2)%B"
441
EVENT_ENC id=13  fwd_id=LED_MATRIX:13  fwd_to_lcd=1  type=CC chn= 1 cc= 28  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:13:2)%B"
441
EVENT_ENC id=13  fwd_id=LED_MATRIX:13  fwd_to_lcd=1  type=CC chn= 1 cc= 28  label="ENC #%3i    %3d@(1:13:2)%B"
442
EVENT_ENC id=14  fwd_id=LED_MATRIX:14  fwd_to_lcd=1  type=CC chn= 1 cc= 29  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:14:2)%B"
442
EVENT_ENC id=14  fwd_id=LED_MATRIX:14  fwd_to_lcd=1  type=CC chn= 1 cc= 29  label="ENC #%3i    %3d@(1:14:2)%B"
443
EVENT_ENC id=15  fwd_id=LED_MATRIX:15  fwd_to_lcd=1  type=CC chn= 1 cc= 30  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:15:2)%B"
443
EVENT_ENC id=15  fwd_id=LED_MATRIX:15  fwd_to_lcd=1  type=CC chn= 1 cc= 30  label="ENC #%3i    %3d@(1:15:2)%B"
444
EVENT_ENC id=16  fwd_id=LED_MATRIX:16  fwd_to_lcd=1  type=CC chn= 1 cc= 31  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:16:2)%B"
444
EVENT_ENC id=16  fwd_id=LED_MATRIX:16  fwd_to_lcd=1  type=CC chn= 1 cc= 31  label="ENC #%3i    %3d@(1:16:2)%B"
445
</PRE></TT>
445
</PRE></TT>
446
446
447
<P CLASS=DESC>This setup:
447
<P CLASS=DESC>This setup:
448
<UL CLASS=CL>
448
<UL CLASS=CL>
449
  <LI>configures the encoders and LED Ring hardware
449
  <LI>configures the encoders and LED Ring hardware
Line 455... Line 455...
455
455
456
456
457
<H2> <IMG SRC="images/bullet.gif" ALT=""> Bank me! </H2>
457
<H2> <IMG SRC="images/bullet.gif" ALT=""> Bank me! </H2>
458
458
459
<P CLASS=DESC>You want to get more for the same price? Let's bank the encoders! :-)
459
<P CLASS=DESC>You want to get more for the same price? Let's bank the encoders! :-)
-
 
460
<TT><PRE style="margin-left:50px; font-size:8pt">
-
 
461
# Example for Encoder 1
-
 
462
EVENT_ENC id= 1  hw_id=1  bank=1  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  \
-
 
463
                                  type=CC chn= 1 cc= 16  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
460
464
461
<TT><PRE style="margin-left:50px">
465
EVENT_ENC id=17  hw_id=1  bank=2  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  \
462
BANK n=1  enc=1:16:1
466
                                  type=CC chn= 1 cc= 32  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
-
 
467
463
BANK n=2  enc=1:16:17
468
EVENT_ENC id=33  hw_id=1  bank=3  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  \
464
BANK n=3  enc=1:16:33
469
                                  type=CC chn= 1 cc= 48  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
-
 
470
465
BANK n=4  enc=1:16:49
471
EVENT_ENC id=49  hw_id=1  bank=4  fwd_id=LED_MATRIX:1   fwd_to_lcd=1  \
-
 
472
                                  type=CC chn= 1 cc= 64  lcd_pos=1:1:1  label="ENC #%3i    %3d@(1:1:2)%B"
466
</PRE></TT>
473
</PRE></TT>
467
474
468
<P CLASS=DESC>These commands will map the 16 hardware encoders (starting from 1) to the EVENT_ENC elements 1..16, 17..32, 33..48 and 49..64
475
<P CLASS=DESC>These commands will map the first hardware encoder (<I>hw_id=1</I>) to the EVENT_ENC elements 1, 17, 33 and 49, which will send different CC numbers.
469
476
470
<P CLASS=DESC>You will need 4 buttons to switch between the banks - this is achieved by using so called "Meta Events" which don't issue MIDI output, but trigger internal functions instead:
477
<P CLASS=DESC>You will need 4 buttons to switch between the banks - this is achieved by using so called "Meta Events" which don't issue MIDI output, but trigger internal functions instead:
471
<TT><PRE style="margin-left:50px">
478
<TT><PRE style="margin-left:50px; font-size:8pt">
472
EVENT_BUTTON id=  1  type=Meta   meta=SetBank button_mode=OnOnly range=1:1  lcd_pos=1:17:1 label="Bnk%q"
479
EVENT_BUTTON id=  1  type=Meta   meta=SetBank button_mode=OnOnly range=1:1  lcd_pos=1:17:1 label="Bnk%q"
473
EVENT_BUTTON id=  2  type=Meta   meta=SetBank button_mode=OnOnly range=2:2  lcd_pos=1:17:1 label="Bnk%q"
480
EVENT_BUTTON id=  2  type=Meta   meta=SetBank button_mode=OnOnly range=2:2  lcd_pos=1:17:1 label="Bnk%q"
474
EVENT_BUTTON id=  3  type=Meta   meta=SetBank button_mode=OnOnly range=3:3  lcd_pos=1:17:1 label="Bnk%q"
481
EVENT_BUTTON id=  3  type=Meta   meta=SetBank button_mode=OnOnly range=3:3  lcd_pos=1:17:1 label="Bnk%q"
475
EVENT_BUTTON id=  4  type=Meta   meta=SetBank button_mode=OnOnly range=4:4  lcd_pos=1:17:1 label="Bnk%q"
482
EVENT_BUTTON id=  4  type=Meta   meta=SetBank button_mode=OnOnly range=4:4  lcd_pos=1:17:1 label="Bnk%q"
476
</PRE></TT>
483
</PRE></TT>