Subversion Repositories svn.mios

Rev

Rev 1107 | Rev 1117 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

HEADER 3 MIDIbox NG User Manual --- .NGC Configuration File

<P CLASS=INFO><B><A HREF="midibox_ng_manual.html">Back to main page...</A></B></P>

<H1>MIDIbox NG</H1>
<H1>User Manual --- .NGC Configuration File</H1>

<P CLASS=INFO>This chapter lists all configuration commands and parameters of the .NGC file. If this format is new to you, please read the <A HREF="midibox_ng_manual_fs.html">First Steps chapter</A> first to get a basic understanding.</P>

<H2> <IMG SRC="images/bullet.gif" ALT=""> Syntax </H2>

<P CLASS=DESC>The syntax of the .NGC file is tailored around the need to express the processing of MIDI events in an extendable format, so that simple operations can be defined with a small number of parameters, and complex configurations are (hopefully) still human readable. Each parameter has a name which will cause a bit more writing effort, on the other hand this will allow to provide extensions in future firmware versions without compatibility issues.</P>

<P CLASS=DESC>Each configuration entry begins with a keyword, and is followed by parameters which have to be defined in a single command line. In order to keep the oversight (not everybody is working on a big widescreen display), it's possible to split the command line over multiple lines in the .NGC file by appending them with the \ (Backslash) character at the end of a line:
<TT><PRE style="margin-left:50px; font-size:8pt">
COMMAND  parameter1=ABC  parameter2=XxXxX  parameter3=qwertz \
         parameter4=Foo  parameter5=Bar \
         parameter6=42
</PRE></TT>

<P CLASS=DESC>The complete command line can consist of up to 1000 characters! <!-- for techs who read the .html source: up to 1023 chars ;-) -->

<P CLASS=DESC>It's allowed to add space characters before and after the = (equal) sign, which helps to improve the readability:
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=  1  type=NoteOn chn= 1 key= 36
EVENT_BUTTON id=  2  type=NoteOn chn=16 key= 37
EVENT_BUTTON id=  3  type=CC     chn= 1 cc = 16
</PRE></TT>

<P CLASS=DESC>Values can be defined in decimal or hexadecimal format. Hexadecimal numbers begin with 0x (C-Style):
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=  1  type=CC  chn= 1 cc=0x10
</PRE></TT>

<P CLASS=DESC>Strings could contain intended spaces, therefore they have to be wrapped around single (') or double (") quotation marks. It's allowed to use single quotes inside double quotes and vice versa:
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=  1  type=CC  chn= 1 cc= 16  label="This is a Test!"
EVENT_BUTTON id=  2  type=CC  chn= 1 cc= 17  label='This is a Test!'
EVENT_BUTTON id=  3  type=CC  chn= 1 cc= 18  label="This is a 'Test'!"
EVENT_BUTTON id=  4  type=CC  chn= 1 cc= 19  label='This is a "Test"!'
EVENT_BUTTON id=  5  type=SysEx  stream="0xf0 0x11 0x22 0x33 0xf7"
</PRE></TT>

<P CLASS=DESC>Certain parameters expect ranges or multiple values. These values are concatenated with colons (:)<BR>
<B>Spaces before/after colons are not allowed!</B>
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=  1  type=CC  chn= 1 cc= 16  range=  0:127
EVENT_BUTTON id=  2  type=CC  chn= 1 cc= 17  range=  0:10
EVENT_BUTTON id=  3  type=CC  chn= 1 cc= 18  range=100:127
EVENT_BUTTON id=  4  type=CC  chn= 1 cc= 19  range=  0:127  lcd_pos= 1:1:1 label="First LCD, First Line"
</PRE></TT>

<P CLASS=DESC>The parser doesn't disallow to specify a parameter multiple times, but in most cases only the last assignment will be taken:
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=1  id=2  id=3 type=CC  chn= 1 cc= 16  range=  0:127
# this button will have  ^^^^ ID 3
</PRE></TT>

<P CLASS=DESC>Exceptions are mentioned in the tables below. E.g. it's possible to specify multiple meta events:
<TT><PRE style="margin-left:50px; font-size:8pt">
EVENT_BUTTON id=  1     type=Meta   meta=SetBank      meta=DoAnythingElse:42
#                                   ^^^^ first event  ^^^^ second event
</PRE></TT>

<P CLASS=DESC>Last but not least: comments can be added to the .NGC file by starting with a hash (#):
<TT><PRE style="margin-left:50px; font-size:8pt">
# My first .NGC file
</PRE></TT>

<H2> <IMG SRC="images/bullet.gif" ALT=""> IDs and Banks </H2>

<P CLASS=INFO>Several ID values are used to address hardware and software functions.</P>

<P CLASS=DESC>We mainly differ between the <I>id</I> of an EVENT (see next chapter), which can range from 1..4095 for each control element, and the <I>hw_id</I> which addresses the actual hardware controller.

<P CLASS=DESC>Available controllers are:
<UL CLASS=CL>
  <LI><I>BUTTON</I>: the first button (1) is connected to the first DIN shift register, pin D0, the second button (2) to the first DIN shift register, pin D1, ... the 9th button to the second DIN shift register, pin D0, etc...<BR>
Up to 256 buttons can be connected to up to 32 DIN shift registers.<BR>
   The <I>hw_id</I> ranges from 1..256
  <LI><I>LED</I>: the first LED (1) is connected to the first DOUT shift register, pin D7 (!), the second LED (2) to the first DOUT shift register, pin D6, ... the 9th LED to the second DOUT shift register, pin D7, etc...<BR>
Up to 128 LEDs can be connected to up to 32 DOUT shift registers.<BR>
   The <I>hw_id</I> ranges from 1..256
  <LI><I>ENC</I>: rotary encoders allocate two DIN pins, which have to be assigned with the ENC command which is described later in this chapter.<BR>
Up to 128 rotary encoders are currently supported.
   The <I>hw_id</I> ranges from 1..128
  <LI><I>AIN</I>: 6 AIN (analog input) pins are directly available on the <A HREF="mbhp_core_stm32.html">MBHP_CORE_STM32</A> and <A HREF="mbhp_core_lpc17.html">MBHP_CORE_LPC17</A> module at J5A.A0 .. J5B.A5 - conversion values are working at 7bit resolution only due to the reduced voltage range of 0..3.3V. For higher resolutions or more inputs please use the AINSER option!<BR>
   The <I>hw_id</I> ranges from 1..6
  <LI><I>AINSER</I>: the usage of the <A HREF="mbhp_ainser64.html">MBHP_AINSER64</A> module is the recommended solution for pots and faders. The resultion is up to 11bit without jittering values. Up to 2 MBHP_AINSER64 modules can be handled by the firmware, accordingly up to 128 AINSER based controllers are available.<BR>
The inputs of the first AINSER module are available as AINSER controller 1-64, the inputs of the second module as AINSER controller 65-128.<BR>
   The <I>hw_id</I> ranges from 1..128
  <LI><I>MF</I>: up to 4 <A HREF="mbhp_mf_ng.html">MBHP_MF_NG</A> modules can be connected, which means that up to 32 motorfaders can be used as controllers. The modules are configured with the MF command which is described later in this chapter.<BR>
The faders of the first MBHP_MF_NG module are available as MF controller 1-8, the faders of the second module as MF controller 9-16, etc.<BR>
   The <I>hw_id</I> ranges from 1..32
  <LI><I>CV</I>: up to 4 <A HREF="mbhp_aout.html">MBHP_AOUT</A> or 4 <A HREF="mbhp_aout_lc.html">MBHP_AOUT_LC</A> or 4 <A HREF="http://www.midibox.org/dokuwiki/aout_ng" TARGET="_blank">MBHP_AOUT_NG</A> modules can be connected, which means that up to 32 CV channels can be controlled. The modules are configured with the AOUT command which is described later in this chapter.<BR>
   The <I>hw_id</I> ranges from 1..32
  <LI><I>KEYBOARD</I>: up to 2 <A HREF="midibox_kb.html">MIDI Keyboards with velocity</A> can be scanned. The same driver as for MIDIbox KB is used.<BR>
   The <I>hw_id</I> ranges from 1..2
</UL>

<P CLASS=DESC>The separation of these ids is important for banking. By default, the <I>hw_id</I> will be identical to the <I>id</I> if not further specified, but by changing the <I>hw_id</I> in an EVENT definition it's possible to assign the same hardware to multiple software functions, and to select the function with the <I>bank</I> parameter.

<P CLASS=DESC>The bank can then be switched with control elements which are assigned to the <I>SetBank</I>, <I>IncBank</I>, <I>DecBank</I> or <I>CycleBank</I> meta event. Either dedicated buttons could be used for such a purpose, or a rotary encoder, or MIDI events sent from external. Alternatively it will be possible to select a bank from the SCS.

<P CLASS=DESC>Configuration Example:
<TT><PRE style="margin-left:50px; font-size:8pt">
# decrement/increment bank
EVENT_BUTTON id=2001  type=Meta  meta=DecBank  button_mode=OnOnly  lcd_pos=1:17:1 label="Bnk%q"
EVENT_BUTTON id=2002  type=Meta  meta=IncBank  button_mode=OnOnly  lcd_pos=1:17:1 label="Bnk%q"
</PRE></TT>

<P CLASS=DESC>With the <I>SetBankOfHwId</I>, <I>IncBankOfHwId</I>, <I>DecBankOfHwId</I> or <I>CycleBankOfHwId</I> events it's even possible to select only the EVENT definition for a specific (or multiple) hardware controllers, selected with their <I>hw_id</I>, e.g.:
<TT><PRE style="margin-left:50px; font-size:8pt">
# the two leftmost encoders (hw_id=1 and 2) select the bank for the remaining upper/lower encoders
EVENT_ENC    id=101  hw_id =  1  fwd_id=LED_MATRIX:1  fwd_to_lcd=1  type=Meta  range=  1:4 \
             meta=SetBankOfHwId:3 \
             meta=SetBankOfHwId:5 \
             meta=SetBankOfHwId:7 \
             meta=SetBankOfHwId:9 \
             meta=SetBankOfHwId:11 \
             meta=SetBankOfHwId:13 \
             meta=SetBankOfHwId:15 \
             lcd_pos=1:17:1 label="Bnk%d"

EVENT_ENC    id=102  hw_id =  2  fwd_id=LED_MATRIX:2  fwd_to_lcd=1  type=Meta  range=  1:4 \
             meta=SetBankOfHwId:4 \
             meta=SetBankOfHwId:6 \
             meta=SetBankOfHwId:8 \
             meta=SetBankOfHwId:10 \
             meta=SetBankOfHwId:12 \
             meta=SetBankOfHwId:14 \
             meta=SetBankOfHwId:16 \
             lcd_pos=1:17:2 label="Bnk%d"
</PRE></TT>

<P CLASS=DESC>Following examples are worth to gather more informations about this topic:
  <UL CLASS=CL>
    <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fencbanks.ngc" TARGET="_blank">encbanks.ngc</A>.
    <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fbnk_2sel.ngc" TARGET="_blank">bnk_2sel.ngc</A>.
    <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fbnk_8sel.ngc" TARGET="_blank">bnk_8sel.ngc</A>.
  </UL>

<P CLASS=DESC>Please note that it's also possible to assign only a subset of controllers to banks, and to use the remaining hardware elements for dedicated functions outside the bank: <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Febnkpart.ngc" TARGET="_blank">Link to a configuration example</A>.

<P CLASS=DESC>Buttons and LEDs which are connected to a DIN/DOUT matrix can be used in banks by emulating BUTTON/LED controllers, see the <I>button_emu_id_offset</I> and <I>led_emu_id_offset</I> of the <I>DIN_MATRIX</I> and <I>DOUT_MATRIX</I> configuration command.


<H2> <IMG SRC="images/bullet.gif" ALT=""> EVENT_* </H2>

<P CLASS=DESC>The EVENT_* commands confgure "virtual control elements" which will act as a MIDI event source and/or destination:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>EVENT Command</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_BUTTON</I></TD>
    <TD CLASS=TABCOLOR2>A button can send a MIDI event whenever it's pressed or depressed. If pressed, the maximum value of the specified range will be sent (typically 127), if depressed the minimum value (typically 0). In toggle mode, the on/off state will be updated when it receives the same event.
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_LED</I></TD>
    <TD CLASS=TABCOLOR2>A LED can receive a MIDI event. It's turned on if the received value is >= the mid value of the specified range, otherwise it's turned off.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_BUTTON_MATRIX</I></TD>
    <TD CLASS=TABCOLOR2>A button matrix is a hardware option where one or more DIN/DOUT shift registers scan a network of buttons. The corresponding EVENT_BUTTON_MATRIX command sends a value from the specified key or CC number upwards. Toggle mode is not supported! If this is desired, or if individual MIDI events should be sent from the matrix, the events have to be configured with <I>BUTTON_MATRIX button_emu_id_offset=&lt;offset&gt;</I> instead. In this case, the button matrix won't react on EVENT_BUTTON_MATRIX anymore, but on EVENT_BUTTON instead!
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_LED_MATRIX</I></TD>
    <TD CLASS=TABCOLOR2>A LED matrix is a hardware option where multiple DOUT shift registers scan a network of LEDs. The corresponding EVENT_LED_MATRIX command allows to assign a MIDI event to control individual LEDs of the matrix, or to set a row in the LED matrix to a specified pattern:
      <UL CLASS=CL>
        <LI>MIDI events from <I>key/cc=&lt;value&gt;</I> upwards will turn on/off the LEDs of the matrix
        <LI>if <I>led_matrix_pattern</I> is specified, MIDI events will set a whole LED row of a matrix with the incoming MIDI event value (for LED Rings, Meters, etc...)
      </UL>
      This works as long as the <I>LED_MATRIX</I> hardware has been configured with <I>led_emu_id_offset=0</I> (default). With <I>led_emu_id_offset=1 (or greater)</I> the LED matrix will react on individual MIDI events instead, specified with <I>EVENT_LED</I> events.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_ENC</I></TD>
    <TD CLASS=TABCOLOR2>An encoder can send and receive MIDI events. In "absolute mode" it will handle a value internally, in incremental modes it will just send an inc/dec event and expects the handling of the resulting value at the host site. In conjunction with a LED Ring (specified via DOUT_MATRIX) it can display the handled value. It's possible to specify individual <I>led_matrix_pattern</I> for each encoder event.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_AIN</I></TD>
    <TD CLASS=TABCOLOR2>An AIN (core baed analog input) can send and receive MIDI events. Various modes are available, such as "Snap" and "Parallax" to avoid jumping values if a host has notified a value change.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_AINSER</I></TD>
    <TD CLASS=TABCOLOR2>Similar to EVENT_AIN, the AINSER event can send and receive MIDI events. Various modes are available, such as "Snap" and "Parallax" to avoid jumping values if a host has notified a value change.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_MF</I></TD>
    <TD CLASS=TABCOLOR2>A MF (motorfader) event can send and receive MIDI events, and forward them to a <A HREF="mbhp_mf_ng.html">MBHP_MF_NG</A> module via MIDI.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_CV</I></TD>
    <TD CLASS=TABCOLOR2>A CV channel can receive a MIDI event and forward the value to the <A HREF="mbhp_aout.html">MBHP_AOUT</A>, <A HREF="mbhp_aout_lc.html">MBHP_AOUT_LC</A> or <A HREF="http://www.midibox.org/dokuwiki/aout_ng">MBHP_AOUT_NG</A> module(s). Up to 4 modules are supported, which means that up to 32 channels are available!<BR><B>Note:</B> it isn't possible to mix the module types - so, either 4 MBHP_AOUT, or 4 MBHP_AOUT_LC, or 4 MBHP_AOUT_NG modules can be used!<BR>There is a special handling for note events: they are processed through note stacks (each channel has its own) so that MBNG can also be used to play synths from a MIDI keyboard.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_RECEIVER</I></TD>
    <TD CLASS=TABCOLOR2>A receiver is a generic destination which can receive MIDI events and process them according to the specified parameters. It's especially useful as a "forwarding device" to pass received MIDI event values to any other component.<BR>
    A receiver won't send MIDI events.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>EVENT_SENDER</I></TD>
    <TD CLASS=TABCOLOR2>A sender is a generic source which can send MIDI events when it gets a forwarded event from any other device. This one is especially useful in conjunction with <I>EVENT_RECEIVER</I> for converting or just 1:1 forwarding incoming MIDI event values.<BR>
    A sender won't react on incoming MIDI events.
    </TD>
  </TR>
</TABLE>

<P CLASS=DESC>Each EVENT_*:
  <UL CLASS=CL>
    <LI>has an individual ID from id=1 .. id=4095
    <LI>can be assigned to a MIDI event such as Note (7bit), CC (7bit), Aftertouch, PitchBend (14bit), NRPN (14bit), SysEx with the <I>type</I> parameter
    <LI>can forward the received value to another EVENT_* definition with the <I>fwd</I> parameter
    <LI>can listen/send to specified MIDI ports with the <I>ports</I> parameter
    <LI>can convert the value to a specified range with the <I>range</I> parameter
    <LI>can display a value on the LCD with the <I>lcd_pos</I> and <I>label</I> parameter
    <LI>etc... etc...
  </UL>
<P CLASS=DESC>List of parameters:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>EVENT_* Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>id=&lt;1..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the ID of the event which can range from 1..4095.<BR>
       Each EVENT_* element requires a unique ID in the configuration file!<BR>
       The EVENT_&lt;type&gt; is part of the ID, which means that BUTTON, LED, ENC, AINSER can have the same id number.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>hw_id=&lt;1..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Optionally specifies the <I>hw_id</I> (hardware controller) to which the EVENT definition is assigned. See also the detailed description in the previous chapter.<BR>
       If not specified, the <I>hw_id</I> will match with the <I>id</I>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>bank=&lt;0..255&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the bank to which the <I>hw_id</I> is assigned. See also the detailed description in the previous chapter.<BR>
       With <I>bank=0</I> the controller won't be assigned to any bank, with <I>bank=1..255</I> it will be assigned, so that the EVENT definition is only active if the selected bank matches with the given number.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>fwd_id=&lt;target:id&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Whenever an matching MIDI event has been received, the value can be forwarded to another EVENT element:
      <UL CLASS=CL>
        <LI><I>BUTTON:&lt;1..4095&gt;</I>
        <LI><I>LED:&lt;1..4095&gt;</I>
        <LI><I>BUTTON_MATRIX:&lt;1..4095&gt;</I>
        <LI><I>LED_MATRIX:&lt;1..4095&gt;</I>
        <LI><I>ENC:&lt;1..4095&gt;</I>
        <LI><I>AIN:&lt;1..4095&gt;</I>
        <LI><I>AINSER:&lt;1..4095&gt;</I>
        <LI><I>CV:&lt;1..4095&gt;</I>
        <LI><I>RECEIVER:&lt;1..4095&gt;</I>
        <LI><I>SENDER:&lt;1..4095&gt;</I>
      </UL>
      There are many usecases for this function. E.g. it allows to pass the received value of a button to the corresponding LED, or the value of an encoder to a LED_MATRIX based LED Ring.<BR>
      In conjunction with EVENT_RECEIVER and EVENT_SENDER it's also possible to convert MIDI events, even from "simple" to SysEx and vice versa. Some examples can be found in the <A HREF="midibox_ng_manual_fs.html">First Steps</A> chapter.<BR>
      Multiple events can be chained this way, but the maximum chain length is limited to 4!<BR>
      If a value is passed to an unspecified EVENT id (because you want to avoid unnecessary writing effort), it's assumed that it will have the same parameters like the EVENT which forwards the value. E.g.:
<TT><PRE style="margin-left:50px; font-size:8pt">EVENT_ENC id=1 fwd_id=LED_MATRIX:1 led_matrix_pattern=1</PRE></TT>
      will forward the received value to an EVENT_LED_MATRIX entry with id=1. If this entry hasn't been specified, then it will inherit the parameters of the ENC element. Since the ENC element specified led_matrix_pattern=1, the LED Ring will display the value with pattern #1
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>fwd_to_lcd=&lt;1|0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Whenever an matching MIDI event has been received, and a label is assigned to the EVENT, and the EVENT is not part of a bank, or the bank is selected, the label will be print on screen.<BR>Use this option to display value changes from external on the LCD.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>type=&lt;event-type&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the MIDI event type which should be sent and/or received.<BR>
       <UL CLASS=CL>
         <LI><I>NoteOff</I>: will send/receive a Note Off event with the specified key value
         <LI><I>NoteOn</I>: will send/receive a Note On event with the specified key value. Please consider that the MIDI protocol handles a NoteOn with value 0 like a Note Off event, therefore <I>type=NoteOff</I> is actually redundant.
         <LI><I>PolyPressure</I>: will send/receive a Poly Pressure event with the specified key value
         <LI><I>CC</I>: will send/receive a CC event with the specified cc value
         <LI><I>ProgramChange</I>: will send/recieve a Program Change event
         <LI><I>Aftertouch</I>: will send/recieve an Aftertouch event with the specified key value
         <LI><I>PitchBend</I>: will send/recieve a Pitch Bender event with the specified 14bit (!) value
         <LI><I>SysEx</I>: will send/recieve SysEx values with the specified stream
         <LI><I>NRPN</I>: will send/recieve NRPN values with the specified nrpn number and format
         <LI><I>Meta</I>: will perform the specified Meta command with the specified meta event
       </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>chn=&lt;1..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the MIDI channel number (1..16) for <I>NoteOff, NoteOn, PolyPressure, CC, ProgramChange, Aftertouch, PitchBend and NRPN</I> events
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>key=&lt;0..127&gt;</I><BR><I>key=any</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the key number (0..127) for <I>type=NoteOff, NoteOn, PolyPressure and Aftertouch</I> events.<BR>
    With <I>key=any</I> the event will take any key number. In combination with the <I>use_key_number</I> flag it's possible to process the received key number instead of the velocity value.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cc=&lt;0..127&gt;</I><BR><I>cc=any</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the CC number (0..127) for <I>type=CC</I> events.<BR>
    With <I>cc=any</I> the event will take any CC number. In combination with the <I>use_cc_number</I> flag it's possible to process the received CC number instead of the CC value.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>use_key_number=&lt;0|1&gt;</I><BR><I>use_cc_number=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>By default, a Note or CC event will process the velocity or CC value.<BR>
    With <I>use_key_number=1</I> or <I>use_cc_number=1</I> the key/CC number will be processed instead.<BR>
    This is especially useful for EVENT_CV to handle the note stack:
<TT><PRE style="margin-left:50px; font-size:8pt">
# these two events listen to any key on channel 1
# the first event uses the "key" as value, sets CV Channel #1 and the CV Gate #1 (at J5A.A0)
# the second event uses velocity as value (default) and sets CV Channel #2
EVENT_CV  id= 1  type=NoteOn  chn= 1 key=any use_key_number=1  fwd_gate_to_dout_pin=1.D7
EVENT_CV  id= 2  type=NoteOn  chn= 1 key=any use_key_number=0
</PRE></TT>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>fwd_gate_to_dout_pin=&lt;1..32&gt;.D&lt;7..0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Only supported by EVENT_CV: sets the given DOUT pin on Note events.<BR>
      The first number specifies the DOUT shift register (1..32), and the second number the data pin (D7..D0).<BR>
      Example: <I>fwd_gate_to_dout_pin=2.D4</I> will forward the gate to the D4 pin of the second shift register.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>nrpn=&lt;0..16383&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the NRPN number (0..16383) for <I>type=NRPN</I> events
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>nrpn_format=&lt;Unsigned|Signed&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the NRPN format for a <I>type=NRPN</I> event: <I>Unsigned</I> or <I>Signed</I>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>stream=&lt;...&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the SysEx stream of a <I>type=SysEx</I> event. The stream is specified as a string with decimal and/or hexadecimal numbers. It can also contain variables which are identified with a Caret (^):<BR>
<TT><PRE style="margin-left:50px; font-size:8pt">stream="0xf0 0x11 0x22 0x33 ^dev 0x00 ^val 0xf7"</PRE></TT>
        This example sends and receives a SysEx string starting with "0xf0 0x11 0x22 0x33", then we send/expect the device number, 0x00, the value (which will be passed or send to/from the control element) and 0xf7.<BR>
        Following SysEx variables are available:
        <UL CLASS=CL>
          <LI><I>^dev</I>: the device number which can be specified with <I>SysExDev</I> or from the Control Surface (SCS)
          <LI><I>^pat</I>: the patch number which can be specified with <I>SysExPat</I> or from the Control Surface (SCS)
          <LI><I>^bnk</I>: the bank number which can be specified with <I>SysExBnk</I> or from the Control Surface (SCS)
          <LI><I>^ins</I>: the instrument number which can be specified with <I>SysExIns</I> or from the Control Surface (SCS)
          <LI><I>^chn</I>: the channel number which can be specified with <I>SysExChn</I> or from the Control Surface (SCS)
          <LI><I>^chk_start</I>: starts the calculation of a checksum (this is a control word, it doesn't send/receive a byte)
          <LI><I>^chk</I>: sends the checksum over all bytes between the last ^chk_start and ^chk
          <LI><I>^chk_inv</I>: sends the inverted checksum over all bytes between the last ^chk_start and ^chk_inv
          <LI><I>^val</I>: sends the lower 7bit of the EVENT value
          <LI><I>^val_h</I>: sends bit 13..7 of the EVENT value
          <LI><I>^val_n1</I>: sends the first nibble of the EVENT value (bit 0..3)
          <LI><I>^val_n2</I>: sends the second nibble of the EVENT value (bit 4..7)
          <LI><I>^val_n3</I>: sends the third nibble of the EVENT value (bit 8..11)
          <LI><I>^val_n4</I>: sends the fourth nibble of the EVENT value (bit 12..15)
          <LI><I>^ignore</I>: ignores an incoming byte, doesn't send a byte
          <LI><I>^dump</I>: starts the SysEx dump mapping: EVENTs with <I>syxdump_pos</I> will get the received values at the specified positions.
          <LI><I>^cursor</I>: allows to directly set the LCD cursor from a SysEx dump. This is used when text messages should be received via SysEx.<BR>Value 0..63 will set the cursor at the first line, value 64..127 at the second line.<BR> If the text is longer than 40 characters, and a second 2x40 LCD is connected, it will be automatically continued there.
          <LI><I>^txt</I>: outputs the received text to the LCD until F7 is received
          <LI><I>^txt56</I>: outputs the received text to the LCD until F7 is received. Automatically jumps to the next line if the cursor has exceeded the 56th column.<BR>
          ^txt and ^txt56 also allow to map incoming characters to different cursor positions. An example can be found in the <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftemplates%2Flogictrl.ngc" TARGET="_blank">logictrl.ngc template</A>.<BR>
          Independent from this map feature, ^txt and ^txt56 now also take lcd_pos=... and label=... into account to set the initial LCD and cursor position, at which the message will start. The label can be used to change the GLCD font before the characters will be print. An example can be found in the <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftemplates%2Flogictrl.ngc" TARGET="_blank">logictrl.ngc template</A> as well.
        </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>meta=&lt;...&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies an operation for <I>type=Meta</I> event:
      <UL CLASS=CL>
        <LI><I>SetBank</I>: sets the bank according to the EVENT value (1..16). If buttons are used to select the bank, please specify <I>meta=SetBank range=1:1 button_mode=OnOnly</I> to select the first bank. If an encoder, pot, etc... is used, please specify <I>meta=SetBank range=1:16</I>.
        <LI><I>IncBank</I>: increments the bank number
        <LI><I>DecBank</I>: decrements the bank number
        <LI><I>CycleBank</I>: increments the bank number, resets to 1 if last bank reached
        <LI><I>SetBankOfHwId:&lt;hw_id&gt;</I>: sets the bank number only for the EVENTs which are matching with the given <I>hw_id</I>
        <LI><I>IncBankOfHwId:&lt;hw_id&gt;</I>: increments the bank number number only for the EVENTs which are matching with the given <I>hw_id</I>
        <LI><I>DecBankOfHwId:&lt;hw_id&gt;</I>: decrements the bank number number only for the EVENTs which are matching with the given <I>hw_id</I>
        <LI><I>CycleBankOfHwId:&lt;hw_id&gt;</I>: increments the bank number, resets to 1 if last bank reached for the EVENTs which are matching with the given <I>hw_id</I>
        <LI><I>EncFast</I>: speeds up encoder movements according to the EVENT value. E.g. if <I>meta=EncFast range=0:5</I> is assigned to a BUTTON_EVENT, encoders will increment 5 times faster if the button is pressed.
        <LI><I>MidiLearn</I>: can be used to enable MIDI Learn mode from a dedicated button (instead of the <A HREF="midibox_ng_manual_scs.html">SCS</A>).<BR>
        E.g. if <I>meta=MidiLearn range=0:1</I> is assigned to a BUTTON_EVENT, Learn Mode will be enabled when the button is pressed, and disabled once it has been released.<BR>
        With <I>meta=MidiLearn range=0:2</I> NRPNs can be learned as well - in the case, CC#6/38/98/99 will be transformed into a NRPN event.
        <LI><I>ScsEnc</I>: emulates a SCS encoder movement. This Meta event can either be issued from EVENT_ENC or EVENT_BUTTON events. A usage example is given below.
        <LI><I>ScsSoft1</I>: emulates the SOFT1 button of the SCS
        <LI><I>ScsSoft2</I>: emulates the SOFT2 button of the SCS
        <LI><I>ScsSoft3</I>: emulates the SOFT3 button of the SCS
        <LI><I>ScsSoft4</I>: emulates the SOFT4 button of the SCS
        <LI><I>ScsShift</I>: emulates the SHIFT button of the SCS
        <LI><I>ScsMenu</I>: emulates the MENU button of the SCS<BR>
           Here a complete configuration example for 8 emulated SCS buttons:
<TT><PRE style="margin-left:20px; font-size:8pt">
EVENT_BUTTON id=  1  type=Meta   meta=ScsSoft1 range=0:1
EVENT_BUTTON id=  2  type=Meta   meta=ScsSoft2 range=0:1
EVENT_BUTTON id=  3  type=Meta   meta=ScsSoft3 range=0:1
EVENT_BUTTON id=  4  type=Meta   meta=ScsSoft4 range=0:1
EVENT_BUTTON id=  5  type=Meta   meta=ScsShift range=0:1
EVENT_BUTTON id=  6  type=Meta   meta=ScsMenu  range=0:1
# if dec/inc buttons should be used:
# DEC:
EVENT_BUTTON id=  7  type=Meta   meta=ScsEnc   range=63:63 button_mode=OnOnly
# INC:
EVENT_BUTTON id=  8  type=Meta   meta=ScsEnc   range=65:65 button_mode=OnOnly
</PRE></TT>

           Here a complete configuration example for 6 emulated SCS buttons + 1 SCS encoder:
<TT><PRE style="margin-left:20px; font-size:8pt">
EVENT_BUTTON id=  1  type=Meta   meta=ScsSoft1 range=0:1
EVENT_BUTTON id=  2  type=Meta   meta=ScsSoft2 range=0:1
EVENT_BUTTON id=  3  type=Meta   meta=ScsSoft3 range=0:1
EVENT_BUTTON id=  4  type=Meta   meta=ScsSoft4 range=0:1
EVENT_BUTTON id=  5  type=Meta   meta=ScsShift range=0:1
EVENT_BUTTON id=  6  type=Meta   meta=ScsMenu  range=0:1
# if a rotary encoder should be used:
ENC n=  1   sr= 15 pins=0:1   type=detented3
EVENT_ENC    id=  1  type=Meta   meta=ScsEnc   range=0:127 enc_mode=40Speed
</PRE></TT>
      </UL>
      It's allowed to specify multiple <I>meta=&lt;...&gt;</I> parameters for a single EVENT element, e.g.:
<TT><PRE style="margin-left:50px; font-size:8pt">meta=SetBank  meta=DoAnythingElse:42</PRE></TT>
      This is just a starting point, much more meta events will be available in future!<BR>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>range=&lt;min-value&gt;:&lt;max-value&gt;</I><BR><I>range=map&lt;1..255&gt;</I></TD>
    <TD CLASS=TABCOLOR2>The received/sent value will be scaled to the specified, colon separated, range.<BR>
      For 7bit types such as <I>NoteOn, CC, ...</I> it typically ranges from 0..127<BR>
      For 14bit types such as <I>PitchBend, NRPN but also SysEx</I> it can also range between -16384..16383 -&gt; try it out! ;-)<BR>
      It's also allowed to specify an ranges such as <I>range=127:0</I> to invert values.<BR>
      In addition, it's possible to use a MAP for the range (<I>range=map1 .. map255</I>). This powerful feature is described
      in a separate chapter (search for the MAP command)
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>value=&lt;0..16383&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the initial value of the event.</TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>offset=&lt;-16384..16383&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the value offset at which the received value will be displayed in the range of -16384..16383<BR>
       Only relevant in conjunction with LCD <I>label</I>.<BR>
       Usage example: the received CC value ranges from 0:127, but it should be displayed from -64..63: in this case specify <I>offset=-64</I>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>syxdump_pos</I></TD>
    <TD CLASS=TABCOLOR2><I>type=SysEx</I> events are able to start a ^dump for starting the collection of incoming values. The syxdump_pos parameter selects the value position within the ^dump.<BR>
       Syntax: <I>syxdump_pos=&lt;receiver-id&gt;:&lt;syxdump-pos&gt;</I>. A usage example can be found under <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftemplates%2Fblofeld.ngc" TARGET="_blank">cfg/templates/blofeld.ngc</A>.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>button_mode=&lt;mode&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Following button modes are supported for EVENT_BUTTON:
      <UL CLASS=CL>
        <LI><I>OnOff</I> (default): the button will send the maximum value of the specified <I>range</I> when pressed, and the mimimum value when depressed
        <LI><I>OnOnly</I>: the button will only send the maximum value of the specified <I>range</I> when pressed, it won't send a value when depressed
        <LI><I>Toggle</I>: toggles between on/off state whenever the button is pressed. The maximum/minimum value of the <I>range</I> will be sent according to the on/off state.
      </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>radio_group=&lt;0..63&gt;</I></TD>
    <TD CLASS=TABCOLOR2><I>EVENT_BUTTON</I>, <I>EVENT_LED</I>, <I>EVENT_SENDER</I> and <I>EVENT_RECEIVER</I> elements can be assigned to groups, which handle the same value over multiple elements.<BR>
      E.g. let's say, that 8 buttons should send different CC#16 values, and the related LEDs should display the button state. Only one LED should turn on depending on the value which has been sent:
<PRE style="margin-left:10px; font-size:8pt; font-size:8pt">
EVENT_BUTTON id=1  fwd_id=LED:1  type=CC chn=1 cc=16  button_mode=OnOnly range= 0:0 radio_group=1
EVENT_BUTTON id=2  fwd_id=LED:2  type=CC chn=1 cc=16  button_mode=OnOnly range= 1:1 radio_group=1
EVENT_BUTTON id=3  fwd_id=LED:3  type=CC chn=1 cc=16  button_mode=OnOnly range= 2:2 radio_group=1
EVENT_BUTTON id=4  fwd_id=LED:4  type=CC chn=1 cc=16  button_mode=OnOnly range= 3:3 radio_group=1
EVENT_BUTTON id=5  fwd_id=LED:5  type=CC chn=1 cc=16  button_mode=OnOnly range= 4:4 radio_group=1
EVENT_BUTTON id=6  fwd_id=LED:6  type=CC chn=1 cc=16  button_mode=OnOnly range= 5:5 radio_group=1
EVENT_BUTTON id=7  fwd_id=LED:7  type=CC chn=1 cc=16  button_mode=OnOnly range= 6:6 radio_group=1
EVENT_BUTTON id=8  fwd_id=LED:8  type=CC chn=1 cc=16  button_mode=OnOnly range= 7:7 radio_group=1
</PRE></TT>

      This also works if only LEDs are used, and it's allowed to use larger ranges:
<PRE style="margin-left:50px; font-size:8pt">
EVENT_LED    id=  9                type=CC chn=1 cc= 1  range= 0:9  radio_group=2
EVENT_LED    id= 10                type=CC chn=1 cc= 1  range=10:19 radio_group=2
EVENT_LED    id= 11                type=CC chn=1 cc= 1  range=20:29 radio_group=2
EVENT_LED    id= 12                type=CC chn=1 cc= 1  range=30:39 radio_group=2
EVENT_LED    id= 13                type=CC chn=1 cc= 1  range=40:49 radio_group=2
EVENT_LED    id= 14                type=CC chn=1 cc= 1  range=50:59 radio_group=2
EVENT_LED    id= 15                type=CC chn=1 cc= 1  range=60:69 radio_group=2
EVENT_LED    id= 16                type=CC chn=1 cc= 1  range=70:79 radio_group=2
</PRE></TT>

  <P CLASS=DESC>More usage examples:
    <UL CLASS=CL>
      <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fradiogrp.ngc" TARGET="_blank">radiogrp.ngc</A>: demonstrates the usage of radio groups as shown above
      <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fbnkled.ngc" TARGET="_blank">bnkled.ngc</A>: using a radio group to display the selected bank with LEDs
      <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fbnkledcc.ngc" TARGET="_blank">bnkledcc.ngc</A>: same as above, but in additional a MIDI event is sent with EVENT_SENDER assigned to the same radio group
    </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>ain_mode=&lt;mode&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Following ain modes are supported for EVENT_AIN and EVENT_AINSER:
      <UL CLASS=CL>
        <LI><I>Direct</I>: the output value jumps directly to the new conversion value whenever the pot/fader is moved
        <LI><I>Snap</I>: (in literature also called "Soft-Takeover") whenever a new value is received from external, pot/fader movements won't generate MIDI events until it passed beyond the new position.
        <LI><I>Relative</I>: whenever a new value is received from external, pot/fader movements will increment the received value instead of setting it to the absolute position
        <LI><I>Parallax</I>: this name is cool, isn't it? ;-) A description can be found in <A HREF="http://www.ucapps.de/midibox/midibox_plus_parallax.gif">this history document from the year 1999</A>.
      </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>enc_mode=&lt;mode&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Following encoder modes are supported for EVENT_ENC:
      <UL CLASS=CL>
        <LI><I>Absolute</I>: the encoder will send/receive an absolute value in the specified <I>range</I>
        <LI><I>40Speed</I>: the encoder will send 0x40+&lt;speed&gt; when moved clockwise, and 0x40-&lt;speed&gt; when moved counter-clockwise
        <LI><I>00Speed</I>: the encoder will send 0x00+&lt;speed&gt; when moved clockwise, and 0x7f-&lt;speed&gt; when moved counter-clockwise
        <LI><I>Inc00Speed_Dec40Speed</I>: the encoder will send 0x00+&lt;speed&gt; when moved clockwise, and 0x40+&lt;speed&gt; when moved counter-clockwise
        <LI><I>Inc41_Dec3F</I>: the encoder will send 0x41 when moved clockwise, and 0x3f when moved counter-clockwise
        <LI><I>Inc01_Dec7F</I>: the encoder will send 0x01 when moved clockwise, and 0x7f when moved counter-clockwise
        <LI><I>Inc01_Dec41</I>: the encoder will send 0x01 when moved clockwise, and 0x41 when moved counter-clockwise
        <LI><I>IncDec</I>: the encoder will send different CC events when moved clockwise or counter-clockwise. This will allow to send CC#96 and CC#97 (Data Inc/Dec) in future (not implemented yet)
      </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>enc_speed_mode=&lt;mode:par&gt;</I></TD>
    <TD CLASS=TABCOLOR2>The encoder speed mode allows to modify the speed response of an EVENT_ENC:
      <UL CLASS=CL>
        <LI><I>Auto</I>: speed automatically adapted according to the value <I>range</I>. It isn't required to specify a value after Auto
        <LI><I>Slow:0 .. Slow:7</I>: divides the increments
        <LI><I>Normal</I>: no special measure, increments will be passed 1:1
        <LI><I>Fast:0 .. Fast:7</I>: accelerates the increments
      </UL>
      <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fencspeed.ngc" TARGET="_blank">Link to test application for all modes</A>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>led_matrix_pattern=&lt;pattern-number&gt;</I></TD>
    <TD CLASS=TABCOLOR2>LED patterns can be specified if an event should forward its value to a LED_MATRIX element:
      <UL CLASS=CL>
        <LI><I>1</I>: the first LED pattern specified with <I>LED_MATRIX_PATTERN n=1</I> commands
        <LI><I>2</I>: the second LED pattern specified with <I>LED_MATRIX_PATTERN n=2</I> commands
        <LI><I>3</I>: the third LED pattern specified with <I>LED_MATRIX_PATTERN n=3</I> commands
        <LI><I>4</I>: the fourth LED pattern specified with <I>LED_MATRIX_PATTERN n=4</I> commands
        <LI><I>LcAuto</I>: to handle the Logic Control protocol correctly, this pattern type will set the pattern number (1..4) according bit 5..4 of the received MIDI event value. Bit 3..0 will select the pattern position, and the 6th bit will set the "Center LED".
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cv_inverted=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Only relevant for EVENT_CV: with <I>cv_inverted=1</I> the CV output will be inverted.</TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cv_hz_v=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Only relevant for EVENT_CV:
    <UL CLASS=CL>
      <LI><I>cv_hz_v=0</I>: (default) the CV output will change with 1V per octave (if correctly calibrated)
      <LI><I>cv_hz_v=1</I>: The V/Hz scaling is suitable for synths like the Korg MS-20.
    </UL>
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cv_gate_inverted=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Only relevant for EVENT_CV: with <I>cv_gate_inverted=1</I> the CV gate output (specified with <I>fwd_gate_to_dout_pin</I> will be inverted.</TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>ports=&lt;port-selections&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Expects a 16bit binary value (0|1) to select the MIDI ports over which the event should send and receive:
       <UL CLASS=CL>
          <LI>the first 4 digits enable/disable USB1..USB4
          <LI>the next 4 digits enable/disable MIDI1..MIDI4
          <LI>the next 4 digits are reserved, don't use!
          <LI>the last 4 digits enable/disable OSC1..OSC4
       </UL>
       Example: following binary value (which is the default value)
<TT><PRE style="margin-left:50px; font-size:8pt">ports=1000100000001000</PRE></TT>
       will enable USB1, MIDI1 (IN1 and OUT1) and OSC1, and following binary:
<TT><PRE style="margin-left:50px; font-size:8pt">ports=0000110000000000</PRE></TT>
       will only enable MIDI1 and MIDI2
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>lcd_pos=&lt;lcd&gt;:&lt;X&gt;:&lt;Y&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Each event can output a label whenever a value has been received via MIDI, or the control element has been moved (e.g. button has been pushed, encoder/motorfader/pot has been moved).<BR>
      <I>lcd</I> specifies the LCD number which should be used to output the label, <I>X</I> the column and <I>Y</I> the line. E.g.:
<TT><PRE style="margin-left:50px; font-size:8pt">lcd_pos=1:1:1</PRE></TT>
        will output the label on the first LCD, first character in the first line. And:
<TT><PRE style="margin-left:50px; font-size:8pt">lcd_pos=1:1:2</PRE></TT>
        will output the label on the first LCD, first character in the second line.
    </TD>
  </TR>

  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>label=&lt;string&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the label (string) which should be output at the specified <I>lcd_pos</I>. The string can contain printf-linke control characters to output formatted values or strings, and it can contain references to globally defined labels of the <A HREF="midibox_ng_manual_ngl.html">.NGL file</A>.
      <UL CLASS=CL>
        <LI><I>%d</I>: will output the value (minus specified <I>offset</I>) in decimal format
        <LI><I>%u</I>: same like %d, but value always in unsigned format
        <LI><I>%x</I>: will output the value (minus specified <I>offset</I>) in hexadecimal format
        <LI><I>%X</I>: same like %x, but with capital letters
        <LI><I>%c</I>: will output the value as character
        <LI><I>%s</I>: will output an empty string. In conjunction with padding values it could save some memory, e.g. "%20s" will output 20 spaces
        <LI><I>%i</I>: the ID of the EVENT
        <LI><I>%p</I>: for EVENT_BUTTON_MATRIX only: the pin number of the matrix
        <LI><I>%e</I>: the MIDI event of the EVENT (up to 3 hexadecimal values, always 6 characters)
        <LI><I>%m</I>: the minimum value of the EVENT which has been specified with <I>range</I>
        <LI><I>%M</I>: the maximum value of the EVENT which has been specified with <I>range</I>
        <LI><I>%b</I>: a binary digit: * if value >= (range/2), o if value < (range/2)
        <LI><I>%B</I>: a vertical bar which works like a meter.<BR>In conjunction with various fonts (selected with <I>&amp;&lt;font&gt;</I>) alternative icons will be output instead.
        <LI><I>%q</I>: current selected bank (q is a rotated b - do you see it? ;-)
        <LI><I>%C</I>: clear all LCDs
        <LI><I>%%</I>: outputs the % character
        <LI><I>^^</I>: outputs the ^ character
        <LI><I>^&lt;label&gt;</I>: outputs a globally defined, conditional or unconditional label. See the <A HREF="midibox_ng_manual_ngl.html">.NGL chapter</A> for details.
        <LI><I>^#</I>: is doing nothing - this "terminator" is used if text should follow a label, e.g. label="^clr^#MyText" will print the ^clr label, and thereafter "MyText".
      </UL>
      It's possible to format the output by adding following specifiers after the percent (%) character. In following example the %d (decimal value) is used, but this works with any format type:
      <UL CLASS=CL>
        <LI><I>%3d</I>: the value will be padded with spaces to 3 characters, and it will be output right-aligned, e.g. "  1", " 10", "100"
        <LI><I>%-3d</I>: the value will be padded with spaces to 3 characters, and it will be output left-aligned, e.g. "1  ", "10 ", "100"
        <LI><I>%03d</I>: the value will be padded with zeroes to 3 characters, and it will be output right-aligned, e.g. "001", "010", "100"
      </UL>
      Examples:
<TT><PRE style="margin-left:50px; font-size:8pt">lcd_pos=1:1:1  label="ENC #%3i    %3d%B"</PRE></TT>
      will output at the first LCD, first column, first line a string with 20 characters. It starts with "ENC #", followed by the ID of the EVENT_ENC (3 digits), some spaces, the EVENT value (3 digits right-aligned) and a vertical bar.
<TT><PRE style="margin-left:50px; font-size:8pt">lcd_pos=1:1:1  label="FIL1 Type ^fil_type"</PRE></TT>
      will output "FIL1 Type " and then a conditional label called ^fil_type which has been specified in the <A HREF="midibox_ng_manual_ngl.html">.NGL file</A>.<BR>
      GLCDs can output different fonts which are selected with the ampersant (&amp;) character:
      <UL CLASS=CL>
        <LI><I>&amp;&amp;</I>: outputs the &amp; character
        <LI><I>&amp;&lt;font&gt;</I>: selects a font for graphical LCDs:
          <UL CLASS=CL>
            <LI><I>&amp;n</I>: selects the "normal" 6x8 font
            <LI><I>&amp;s</I>: selects the "small" 4x8 font
            <LI><I>&amp;b</I>: selects the "big" 24x16 font
            <LI><I>&amp;k</I>: selects "knob icons", a 24x32 font. Values can be output with %B
            <LI><I>&amp;h</I>: selects a meter with horizontal orientation, a 32x8 font. Values can be output with %B
            <LI><I>&amp;v</I>: selects a meter with vertical orientation, a 8x32 font. Values can be output with %B
          </UL>
      </UL>
      And finally it's also possible to change the output LCD and position within a label:
      <UL CLASS=CL>
        <LI><I>@(&lt;lcd&gt;:&lt;X&gt;:&lt;Y&gt;)</I>: changes to the given lcd, X and Y position.
      </UL>
      Example:
<TT><PRE style="margin-left:50px; font-size:8pt">lcd_pos=1:1:1  label="Enc%3i&amp;k@(1:1:2)%B&amp;n@(1:18:1)%3d"</PRE></TT>
      No, this is not an encrypted message, because the processing rules are well documented! ;-) - it will output "ENC" + the ID number. Then it will select the "knob" icon, jump to position X=1 Y=2 and output the knob icon based on the EVENT value. Thereafter it will select the normal font, jump to position X=18 Y=1 and output the MIDI value in decimal format.
    </TD>
  </TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> MAP&lt;n&gt; </H2>

<P CLASS=DESC>This command creates a map of values which can be used by EVENTs for alternative value ranges without continuous values.

<P CLASS=DESC>E.g., consider that an encoder should only send following values:
<TT><PRE style="margin-left:50px; font-size:8pt">
MAP1   1 2 4 8 16 32 64
</PRE></TT>

<P CLASS=DESC>Then select this map with:
<TT><PRE style="margin-left:50px; font-size:8pt; font-size:8pt">
EVENT_ENC    id=  1  fwd_id=LED_MATRIX:1  fwd_to_lcd=1 \
                     type=CC chn= 1 cc= 16  range=map1  lcd_pos=1:1:1  label="^std_enc"
</PRE></TT>

<P CLASS=DESC>Up to 255 maps can be defined (<I>MAP1</I> .. <I>MAP255</I>), each map can specify up to 128 values, the value range is 0..255 (8bit)

<P CLASS=DESC>The various control elements use maps the following way:
<UL CLASS=CL>
  <LI><I>EVENT_ENC</I>: send a mapped value with <I>enc_mode=Absolute</I> - <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fmapenc.ngc" TARGET="_blank">configuration example</A>
  <LI><I>EVENT_AIN</I> and <I>EVENT_AINSER</I>: send a mapped value - <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fmapain.ngc" TARGET="_blank">configuration example</A>
  <LI><I>EVENT_MF</I>: send a mapped value - <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fmapmf.ngc" TARGET="_blank">configuration example</A>
  <LI><I>EVENT_BUTTON</I>: with <I>button_mode=Toggle</I> a single button can cycle between the map values - <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fmapbtn.ngc" TARGET="_blank">configuration example</A>
  <LI><I>EVENT_SENDER</I> and <I>EVENT_RECEIVER</I>: the sent/received value will be mapped - <A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fmapmidi.ngc" TARGET="_blank">configuration example</A>
</UL>

<P CLASS=DESC>Other EVENTs don't support mapped ranges yet. It could make sense for EVENT_CV to map output voltages (problem: maps only work at 8bit resolution), or for EVENT_BUTTON_MATRIX to map a Note key - this could be provided in future versions.</P>


<H2> <IMG SRC="images/bullet.gif" ALT=""> SYSEX_VAR </H2>

<P CLASS=DESC>This command specifies the default values of various SysEx variables, which are available for <I>EVENT_* stream="..."</I>:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>SYSEX_VAR Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>dev=&lt;0..127&gt;</I></TD>
    <TD CLASS=TABCOLOR2>the Device ID (<I>^dev</I>)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>pat=&lt;0..127&gt;</I></TD>
    <TD CLASS=TABCOLOR2>the Patch number (<I>^pat</I>)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>bnk=&lt;0..127&gt;</I></TD>
    <TD CLASS=TABCOLOR2>the Bank number (<I>^bnk</I>)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>ins=&lt;0..127&gt;</I></TD>
    <TD CLASS=TABCOLOR2>the Instrument number (<I>^ins</I>)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>chn=&lt;0..127&gt;</I></TD>
    <TD CLASS=TABCOLOR2>the Channel number (<I>^chn</I>)</TD>
  </TR>
</TABLE>

<P CLASS=DESC>The variables could also be used for other purposes of course, they are only placeholders for typical usecases.


<H2> <IMG SRC="images/bullet.gif" ALT=""> ENC </H2>

<P CLASS=DESC>The ENC command configures rotary encoders which are connected to a <A HREF="mbhp_din.html">MBHP_DIN</A> module:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>ENC Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..128&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the encoder number which should be configured; it can range from 1..128</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr=&lt;1..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the DIN shift register to which the encoder is connected. 1 stands for the first DIN in the chain, 2 for the second, etc...</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>pins=&lt;pin-a&gt;:&lt;pin-b&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the pair of digital input pins of the DIN shift register to which the encoder is connected. The allowed pinning is restricted to following combinations:
      <UL CLASS=CL>
        <LI><I>0:1</I> encoder connected to input pin D0 and D1
        <LI><I>2:3</I> encoder connected to input pin D2 and D3
        <LI><I>4:5</I> encoder connected to input pin D4 and D5
        <LI><I>6:7</I> encoder connected to input pin D6 and D7
      </UL>
      If you notice that the encoder increments in the wrong direction, the pins have to be swapped at the hardware side!
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>type=&lt;name&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the encoder type: <I>non_detented</I>, <I>detented1</I>, <I>detented2</I> or <I>detented3</I>.<BR>
      A documentation about these types can be found in <A HREF="http://www.midibox.org/dokuwiki/doku.php?id=encoders" TARGET="_blank">this Wiki article</A>.
    </TD>
  </TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> DIN_MATRIX </H2>

<P CLASS=DESC>The DIN_MATRIX command configures button matrices which are connected between DIN/DOUT shift registers. Please note that all assigned shift registers can't be used for common button or LED functions anymore:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>DIN_MATRIX Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..8&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the matrix number which should be configured; it can range from 1..8</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>rows=&lt;4|8|16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the number of rows which should be scanned:
      <UL CLASS=CL>
        <LI><I>rows=4</I>: 4 selection pulses are output by the DOUT register specified with <I>sr_dout_sel1</I>. The pulses are available twice: at D7:D4 and D3:D0.<BR>This configuration allows to scan up to 4x8 buttons with a single DIN, or 4x16 buttons with two DINs.
        <LI><I>rows=8</I>: 8 selection pulses are output by the DOUT register specified with <I>sr_dout_sel1</I>. The pulses are available at D7:D0<BR>This configuration allows to scan up to 8x8 buttons with a single DIN, or 8x16 buttons with two DINs.
        <LI><I>rows=16</I>: 16 selection pulses are output by the DOUT registers specified with <I>sr_dout_sel1</I> and <I>sr_dout_sel2</I>. The pulses are available at D7:D0 of each register.<BR>This configuration allows to scan up to 16x8 buttons with a single DIN, or 16x16 buttons with two DINs.
      </UL>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>inverted=&lt;1|0&gt;<BR>inverted_sel=&lt;1|0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>DOUT selection lines will be inverted with <I>inverted=1</I> or <I>inverted_sel=1</I>. This is required if the diodes of the button matrix have been connected in the opposite order:
       <UL CLASS=CL>
          <LI><I>inverted=0</I>: Cathodes are connected to the DOUT selection lines, see also <A HREF="midio128/midio128_v3_scanmatrix.pdf" TARGET="_blank">this schematic</A>.
          <LI><I>inverted=1</I>: Inverting sink drivers have been added to the DOUT register.
          <LI><I>inverted_sel=1 and inverted_row=1</I>: Anodes are connected to the DOUT selection lines (not standard, but sometimes required if already existing hardware should be re-used).
       </UL>
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>inverted_row=&lt;1|0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>DIN row patterns can be inverted with <I>inverted_row=1</I>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_sel1=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the first DOUT shift register which should output the row selection signals.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_sel2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the second DOUT shift register which should output the row selection signals in a <I>row=16</I> setup.<BR>Set this parameter to 0 if a second DOUT is not required.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_din1=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the first DIN shift register of the button matrix.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_din2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the (optional) second DIN shift register of the button matrix.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>button_emu_id_offset=&lt;1..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>With a value &gt;0, the button matrix will trigger EVENT_BUTTON events instead of EVENT_BUTTON_MATRIX, starting with the specified ID. A matrix of 8x8 buttons can emulate 64 buttons with individual event assignments this way.
  </TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> DOUT_MATRIX </H2>

<P CLASS=DESC>The DOUT_MATRIX command configures LED matrices which are connected between multiple DOUT shift registers. Please note that all assigned shift registers can't be used for common LED functions anymore:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>DOUT_MATRIX Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..8&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the matrix number which should be configured; it can range from 1..8</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>rows=&lt;4|8|16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the number of rows which should be scanned:
      <UL CLASS=CL>
        <LI><I>rows=4</I>: 4 selection pulses are output by the DOUT register specified with <I>sr_dout_sel1</I>. The pulses are available twice: at D7:D4 and D3:D0.<BR>This configuration allows to scan up to 4x8 LEDs with two DOUTs, or 4x16 LEDs with three DOUTs.
        <LI><I>rows=8</I>: 8 selection pulses are output by the DOUT register specified with <I>sr_dout_sel1</I>. The pulses are available at D7:D0<BR>This configuration allows to scan up to 8x8 LED with two DOUTs, or 8x16 LEDs with three DOUTs.
        <LI><I>rows=16</I>: 16 selection pulses are output by the DOUT registers specified with <I>sr_dout_sel1</I> and <I>sr_dout_sel2</I>. The pulses are available at D7:D0 of each register.<BR>This configuration allows to scan up to 16x8 LEDs with three DOUTs, or 16x16 LEDs with four DOUTs.
      </UL>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>inverted=&lt;1|0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>DOUT selection lines will be inverted with <I>inverted=1</I>. This is required if the LEDs of the matrix have been connected in the opposite order:
       <UL CLASS=CL>
          <LI><I>inverted=0</I>: Cathodes are connected to the DOUT selection lines, see also <A HREF="mbhp/mbhp_blm_map.pdf" TARGET="_blank">this schematic</A>.
          <LI><I>inverted=1</I>: Inverting sink drivers have been added to the DOUT register.
          <LI><I>inverted_sel=1 and inverted_row=1</I>: Anodes are connected to the DOUT selection lines (swapped polarity)
       </UL>
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>inverted_row=&lt;1|0&gt;</I></TD>
    <TD CLASS=TABCOLOR2>DOUT row patterns can be inverted with <I>inverted_row=1</I>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_sel1=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the first DOUT shift register which should output the row selection signals.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_sel2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the second DOUT shift register which should output the row selection signals in a <I>row=16</I> setup.<BR>Set this parameter to 0 if a second DOUT is not required.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_r1=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the first DOUT shift register of the LED matrix row.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_r2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the (optional) second DOUT shift register of the LED matrix row.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_g1=&lt;0..16&gt;</I><BR><I>sr_dout_g2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>These parameters allow to drive duo-colour or RGB LEDs by using a second set of DOUTs connected to the green LEDs.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>sr_dout_b1=&lt;0..16&gt;</I><BR><I>sr_dout_b2=&lt;0..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>These parameters allow to drive RGB LEDs by using a third set of DOUTs connected to the blue LEDs.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>led_emu_id_offset=&lt;1..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>With a value &gt;0, the LED matrix will listen on EVENT_LED events instead of EVENT_LED_MATRIX, starting with the specified ID. A matrix of 8x8 LED can emulate 64 LEDs with individual event assignments this way.
  </TR>
</TABLE>



<H2> <IMG SRC="images/bullet.gif" ALT=""> LED_MATRIX_PATTERN </H2>

<P CLASS=DESC>The LED_MATRIX_PATTERN command is used in conjunction with LED Rings to configure the output based on an incoming value for EVENT_MATRIX_DOUT elements with the <I>led_pattern</I> parameter. Optionally the pattern can also be selected by a EVENT_ENC element if no EVENT_MATRIX_DOUT event has been defined.

<P CLASS=DESC>Each pattern-set consists of 17 entries. 16 entries are scaled over the specified min/max range of incoming value. The 17th entry is called 'M' and is used when the middle of the value range has been reached.

Examples for a typical patterns for a LED Ring with 11 LEDs, and a 12th "center" LED (see also <A HREF="http://www.ucapps.de/mbhp/mbhp_doutx4_ledrings.pdf" TARGET="_blank">this schematic</A>):
<TT><PRE style="margin-left:50px; font-size:8pt">
# LED_MATRIX_PATTERNs
LED_MATRIX_PATTERN n= 1  pos= 0  pattern=1000000000000000
LED_MATRIX_PATTERN n= 1  pos= 1  pattern=1100000000000000
LED_MATRIX_PATTERN n= 1  pos= 2  pattern=1100000000000000
LED_MATRIX_PATTERN n= 1  pos= 3  pattern=1110000000000000
LED_MATRIX_PATTERN n= 1  pos= 4  pattern=1110000000000000
LED_MATRIX_PATTERN n= 1  pos= 5  pattern=1111000000000000
LED_MATRIX_PATTERN n= 1  pos= 6  pattern=1111000000000000
LED_MATRIX_PATTERN n= 1  pos= 7  pattern=1111100000000000
LED_MATRIX_PATTERN n= 1  pos= M  pattern=1111110000010000
LED_MATRIX_PATTERN n= 1  pos= 8  pattern=1111111000000000
LED_MATRIX_PATTERN n= 1  pos= 9  pattern=1111111100000000
LED_MATRIX_PATTERN n= 1  pos=10  pattern=1111111100000000
LED_MATRIX_PATTERN n= 1  pos=11  pattern=1111111110000000
LED_MATRIX_PATTERN n= 1  pos=12  pattern=1111111110000000
LED_MATRIX_PATTERN n= 1  pos=13  pattern=1111111111000000
LED_MATRIX_PATTERN n= 1  pos=14  pattern=1111111111000000
LED_MATRIX_PATTERN n= 1  pos=15  pattern=1111111111100000

LED_MATRIX_PATTERN n= 2  pos= 0  pattern=1111110000000000
LED_MATRIX_PATTERN n= 2  pos= 1  pattern=0111110000000000
LED_MATRIX_PATTERN n= 2  pos= 2  pattern=0111110000000000
LED_MATRIX_PATTERN n= 2  pos= 3  pattern=0011110000000000
LED_MATRIX_PATTERN n= 2  pos= 4  pattern=0001110000000000
LED_MATRIX_PATTERN n= 2  pos= 5  pattern=0001110000000000
LED_MATRIX_PATTERN n= 2  pos= 6  pattern=0000110000000000
LED_MATRIX_PATTERN n= 2  pos= 7  pattern=0000010000000000
LED_MATRIX_PATTERN n= 2  pos= M  pattern=0000111000010000
LED_MATRIX_PATTERN n= 2  pos= 8  pattern=0000010000000000
LED_MATRIX_PATTERN n= 2  pos= 9  pattern=0000011000000000
LED_MATRIX_PATTERN n= 2  pos=10  pattern=0000011000000000
LED_MATRIX_PATTERN n= 2  pos=11  pattern=0000011100000000
LED_MATRIX_PATTERN n= 2  pos=12  pattern=0000011110000000
LED_MATRIX_PATTERN n= 2  pos=13  pattern=0000011110000000
LED_MATRIX_PATTERN n= 2  pos=14  pattern=0000011111000000
LED_MATRIX_PATTERN n= 2  pos=15  pattern=0000011111100000

LED_MATRIX_PATTERN n= 3  pos= 0  pattern=1000000000000000
LED_MATRIX_PATTERN n= 3  pos= 1  pattern=0100000000000000
LED_MATRIX_PATTERN n= 3  pos= 2  pattern=0100000000000000
LED_MATRIX_PATTERN n= 3  pos= 3  pattern=0010000000000000
LED_MATRIX_PATTERN n= 3  pos= 4  pattern=0010000000000000
LED_MATRIX_PATTERN n= 3  pos= 5  pattern=0001000000000000
LED_MATRIX_PATTERN n= 3  pos= 6  pattern=0000100000000000
LED_MATRIX_PATTERN n= 3  pos= 7  pattern=0000010000000000
LED_MATRIX_PATTERN n= 3  pos= M  pattern=0000111000010000
LED_MATRIX_PATTERN n= 3  pos= 8  pattern=0000010000000000
LED_MATRIX_PATTERN n= 3  pos= 9  pattern=0000001000000000
LED_MATRIX_PATTERN n= 3  pos=10  pattern=0000000100000000
LED_MATRIX_PATTERN n= 3  pos=11  pattern=0000000100000000
LED_MATRIX_PATTERN n= 3  pos=12  pattern=0000000010000000
LED_MATRIX_PATTERN n= 3  pos=13  pattern=0000000001000000
LED_MATRIX_PATTERN n= 3  pos=14  pattern=0000000001000000
LED_MATRIX_PATTERN n= 3  pos=15  pattern=0000000000100000
</PRE></TT>


<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>LED_MATRIX_PATTERN Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the pattern-set number; it can range from 1..8</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>pos=&lt;0..15|M&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the position for the following pattern (0..15, or M for middle position)
  <TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>pattern=&lt;16-bit-binary&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the pattern for the given position. It consists of 16 binary digits (0 or 1 for LED off/on)
  <TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> KEYBOARD </H2>

<P CLASS=DESC>The KEYBOARD command configures (hardware) keyboards. The same driver like for <A HREF="midibox_kb.html">MIDIbox KB</A> is used, but the scan frequency is slower (10 times!). Each row is scanned in 320 uS (instead of 32 uS). This has to be considered in the velocity delay configuration: delay_slowest should be 100 (instead of 1000), and delay_fastest should be 5 (instead of 50)</P>

<P CLASS=DESC>Here a typical keyboard configuration for a Fatar DF type with 61 keys:
<TT><PRE style="margin-left:10px; font-size:8pt; font-size:8pt">
KEYBOARD n=1   rows=8  dout_sr1=1  dout_sr2=2  din_sr1=1  din_sr2=2 \
               din_inverted=0  break_inverted=0  din_key_offset=32 \
               scan_velocity=1  scan_optimized=0  note_offset=28 \
               midi_ports=1000100000001000  midi_chn=1 \
               delay_fastest=5  delay_fastest_black_keys=0  delay_slowest=100 \
               ain_pitchwheel_pin=  0  ain_pitchwheel_ctrl=128  ain_pitchwheel_min=  1  ain_pitchwheel_max=254 \
               ain_modwheel_pin  =  0  ain_modwheel_ctrl  =  1  ain_modwheel_min  =  1  ain_modwheel_max  =254 \
               ain_sustain_pin   =  0  ain_sustain_ctrl   = 64  ain_sustain_min   =  1  ain_sustain_max   =254
</PRE></TT>


<P CLASS=DESC>Please note, that the configuration commands are identical "set kb..." as documented at the <A HREF="http://www.ucapps.de/midibox_kb.html">MIDIbox KB page</A>. This means, that the keyboard parameters can also be changed during runtime to determine the best matching values, before they are written into the .NGC file.</P>

<H2> <IMG SRC="images/bullet.gif" ALT=""> AIN </H2>

<P CLASS=DESC>The AIN command allows to enable/disable core based analog inputs with the <I>enable_mask</I> parameter. It consists of 6 binary digits which stand for J5A.A0..J5B.A5

<P CLASS=DESC>Example:
<TT><PRE style="margin-left:50px; font-size:8pt">
# AIN hardware
AIN enable_mask=110000
</PRE></TT>
will enable the J5A.A0 and J5A.A1 inputs.

<P CLASS=DESC><B>Please note:</B> unconnected analog inputs which haven't been disabled will generate random MIDI event values! It's strongly recommended to disable unused pins in the <I>enable_mask</I>, or to connect these pins to ground!


<H2> <IMG SRC="images/bullet.gif" ALT=""> AINSER </H2>

<P CLASS=DESC>The AINSER command configures the <A HREF="mbhp_ainser64.html">MBHP_AINSER64</A> module:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>AINSER Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..2&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the AINSER module which should be configured (1 or 2)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>enabled=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Enables the module with 1, disables the module with 0 so that it doesn't generate EVENT_AINSER events.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cs=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the "chip select" line which is jumpered with J4 of the module. Each module has to be configured for a dedicated chip select line!<BR><I>cs=0</I> selects CS1, <I>cs=1</I> selects CS2 (sorry for the confusion...)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>resolution=&lt;4..12bit&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the resolution at which the analog inputs should be scanned.<BR>
    By default the pins are scanned at 7bit resolution. Up to 12bit is supported, but in this case there won't be any (deadband based) jitter rejection.<BR>
    So, the recommended values are:
      <UL CLASS=CL>
        <LI><I>7bit</I> for sending common MIDI events
        <LI><I>11bit</I> for sending high-resolution MIDI events
      </UL>
      The 11bit setting requires a clean pot wiring! Ground and +5V should be wired star-like, and the middle pins of the pots should be wired with shielded cables.<BR>
      If you should still notice jittering values with this resolution, try lower options such as 10bit or 9bit first - maybe this already satisies your needs before you've to spend a lot of effort into hardware improvements.<BR>
      Please note that the resolution setting is independent from the resolution sent by a MIDI event. This one will be scaled automatically to the target resolution depending on the specified range!
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>num_pins=&lt;1..64&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the number of scanned analog input pins.<BR>
      By default all 64 pins of the MBHP_AINSER module will be scanned. It makes sense to specify a lower number of the upper analog inputs are not connected (even not to ground) to avoid the generation of random values due to the floating inputs.</TD>
  </TR>
</TABLE>



<H2> <IMG SRC="images/bullet.gif" ALT=""> MF </H2>

<P CLASS=DESC>The MF command configures the <A HREF="mbhp_mf_ng.html">MBHP_MF_NG</A> module. The module has to be configured for "Motormix" emulation, because this protocol allows to send and receive fader movements over dedicated MIDI channels with 14bit resolution. It's allowed to connect multiple modules in a MIDI chain, in such a case the MIDI merger has to be configured as "MIDIbox Link Endpoint" for the last module, and as "MIDIbox Link Forwarding Point" for the remaining modules in the MBHP_MF_NG configuration tool which is part of <A HREF="mios_studio.html">MIOS Studio</A>:
<CENTER><IMG SRC="mios_studio/mios_studio_mbhp_mf_ng_tool.png" width=702 height=680></CENTER></P>

<P CLASS=DESC>List of parameters:
<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>MF Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the MF module which should be configured (1..4)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>enabled=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Enables the module with 1, disables the module with 0 so that it doesn't generate EVENT_MF events.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>midi_in_port=&lt;IN1..IN4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the MIDI IN port to which the module is connected (IN1..IN4)<BR>Please ensure that this port is not used by the <I>MIDI_ROUTER</LI>.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>midi_out_port=&lt;OUT1..OUT4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the MIDI OUT port to which the module is connected (OUT1..OUT4)<BR>Please ensure that this port is not used by the <I>MIDI_ROUTER</LI>.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>config_port=&lt;USB1..USB4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the USB port over which the MBHP_MF_NG module should be configured (with the MIOS Studio based tool described above). It's recommended not to use USB1 for SysEx accesses (including firmware updates), since MIOS32 listens to the same port for firmware updates if it's assigned to the same SysEx Device ID. Any other USB port (USB2..USB4) will work without such potential collisions.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>chn=&lt;1..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the MIDI channel over which the MBHP_MF_NG module will send and receive fader movements</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>ts_first_button_id=&lt;0..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>With a value &gt;0, touch sensor events generated by the MBHP_MF_NG module will trigger EVENT_BUTTON elements with the specified ID upwards. This allows to convert these events into any over MIDI output (and/or to display them on the LCD)</TD>
  </TR>
</TABLE>

<H2> <IMG SRC="images/bullet.gif" ALT=""> AOUT </H2>

<P CLASS=DESC>This command configures the AOUT module:

<P CLASS=DESC>List of parameters:
<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>AOUT Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>type=&lt;aout-type&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the AOUT module which is connected to port J19 of the <A HREF="mbhp_core_lpc17.html">MBHP_CORE_LPC17</A> module:
      <UL CLASS=CL>
        <LI><I>type=none</I>: disables the AOUT modules -&gt; no CV channels available!
        <LI><I>type=AOUT</I>: selects the <A HREF="mbhp_aout.html">MBHP_AOUT</A> module
        <LI><I>type=AOUT_LC</I>: selects the <A HREF="mbhp_aout_lc.html">MBHP_AOUT_LC</A> module
        <LI><I>type=AOUT_NG</I>: selects the <A HREF="http://www.midibox.org/dokuwiki/aout_ng" TARGET="_blank">MBHP_AOUT_NG</A> module
      </UL>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>cs=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the "chip select" line which to which the AOUT module is connected:
      <UL CLASS=CL>
        <LI><I>cs=0</I>: CS line connected to J19.RC1
        <LI><I>cs=1</I>: CS line connected to J19.RC2
      </UL>
      Please take care that the CS line doesn't conflict with the AINSER configuration, which uses the same serial port!
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>num_channels=&lt;1..32&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the number of channels which should be controlled via EVENT_CV events. The channel number corresponds with the EVENT id
  </TR>
</TABLE>

<P CLASS=INFO>Configuration example:
<TT><PRE style="margin-left:50px; font-size:8pt">
# initialize the AOUT module
AOUT  type=AOUT_NG  cs=0  num_channels=8
</PRE></TT>

<P CLASS=INFO>Complete examples:
<UL CLASS=CL>
  <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fcv.ngc" TARGET="_blank">Simple configuration</A>
  <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fcvhires.ngc" TARGET="_blank">High-Res configuration</A>
  <LI><A HREF="http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fcvnotes.ngc" TARGET="_blank">Handling Note, Gate and Velocity</A>
</UL>


<H2> <IMG SRC="images/bullet.gif" ALT=""> SCS </H2>

<P CLASS=DESC>SCS stands for "Standard Control Surface" which is explained in the <A HREF="midibox_ng_manual_scs.html">SCS chapter</A>.

<P CLASS=DESC>The SCS command allows to define the emulated button and encoder IDs which are used when the SCS is in the main page.

<P CLASS=DESC>List of parameters:
<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=200>AOUT Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>soft1_button_emu_id=&lt;0..4095&gt;</I><BR>
                                  <I>soft2_button_emu_id=&lt;0..4095&gt;</I><BR>
                                  <I>soft3_button_emu_id=&lt;0..4095&gt;</I><BR>
                                  <I>soft4_button_emu_id=&lt;0..4095&gt;</I><BR>
                                  <I>shift_button_emu_id=&lt;0..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>A SCS button will emulate the specified BUTTON ID if the SCS is in the main page.<BR>If the id is set to 0, the button function won't have any effect!</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>enc_emu_id==&lt;0..4095&gt;</I></TD>
    <TD CLASS=TABCOLOR2>A SCS encoder will emulate the specified ENC ID if the SCS is in the main page.<BR>If the id is set to 0, the encoder function won't have any effect!</TD>
  </TR>
</TABLE>

<P CLASS=INFO>Configuration example:
<TT><PRE style="margin-left:50px; font-size:8pt; font-size:8pt">
# the SCS should emulate button/enc functions in main page
SCS soft1_button_emu_id=2000 \
    soft2_button_emu_id=2001 \
    soft3_button_emu_id=2002 \
    soft4_button_emu_id=2003 \
    shift_button_emu_id=2004 \
    enc_emu_id=2000


# Controlled from SCS buttons at J10 in main page
EVENT_BUTTON id=2000  type=Meta   meta=SetBank   button_mode=OnOnly range=1:1  lcd_pos=1:17:1 label="Bnk%q"
EVENT_BUTTON id=2001  type=Meta   meta=SetBank   button_mode=OnOnly range=2:2  lcd_pos=1:17:1 label="Bnk%q"
EVENT_BUTTON id=2002  type=Meta   meta=SetBank   button_mode=OnOnly range=3:3  lcd_pos=1:17:1 label="Bnk%q"
EVENT_BUTTON id=2003  type=Meta   meta=SetBank   button_mode=OnOnly range=4:4  lcd_pos=1:17:1 label="Bnk%q"
EVENT_BUTTON id=2004  type=Meta   meta=EncFast:4 button_mode=OnOff  range=0:2

# the SCS encoder at J10 just increments/decrements the bank
# redundant function - could be changed in future
EVENT_ENC    id=2000  type=Meta   meta=SetBank   range=1:4
</PRE></TT>


<H2> <IMG SRC="images/bullet.gif" ALT=""> ROUTER </H2>

<P CLASS=DESC>The integrated MIDI router consists of 16 "nodes". Each node can be connected to an individual source and destination port. A node is activated by selecting a source MIDI channel != "--", e.g. 1..16 or All (for all channels). The node will forward a MIDI event to the destination port. Either to the original channel ("All"), or to a changed channel (1..16).

<P CLASS=DESC>List of parameters:
<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>ROUTER Parameter</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..16&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the ROUTER node which should be configured (1..16)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>src_port=&lt;port&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the source port from which MIDI events should be forwarded:
      <UL CLASS=CL>
        <LI><I>USB1..USB4</I>: for USB ports
        <LI><I>IN1..IN4</I>: for MIDI ports
        <LI><I>OSC1..OSC4</I>: for Ethernet based OSC ports
      </UL>
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>src_chn=&lt;0..17&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Allows to select a dedicated channel which should be forwarded:
      <UL CLASS=CL>
        <LI><I>0 or Off</I>: no channel will be forwarded (node disabled)
        <LI><I>1..16</I>: only the specified MIDI channel will be forwarded, all others will be filtered
        <LI><I>17 or All</I>: all MIDI channels will be forwarded
      </UL>
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>dst_port=&lt;port&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the destination port to which MIDI events should be forwarded:
      <UL CLASS=CL>
        <LI><I>USB1..USB4</I>: for USB ports
        <LI><I>OUT1..OUT4</I>: for MIDI ports
        <LI><I>OSC1..OSC4</I>: for Ethernet based OSC ports
      </UL>
    </TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>dst_chn=&lt;0..17&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Allows to convert the incoming MIDI channel:
      <UL CLASS=CL>
        <LI><I>0 or Off</I>: no channel will be forwarded (node disabled)
        <LI><I>1..16</I>: the incoming MIDI channel(s) will be changed to the specified channel
        <LI><I>17 or All</I>: no conversion will take place
      </UL>
    </TD>
  </TR>
</TABLE>

<P CLASS=DESC><B>Please note:</B> the MIDI router can also be configured during runtime in the MIOS Terminal with the "set router" command. "router" will output an oversight over the complete configuration.


<H2> <IMG SRC="images/bullet.gif" ALT=""> ETH </H2>

<P CLASS=DESC>The ETH command allows to configure the ethernet interface of the MBHP_CORE_LPC17 module:

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>ETH Command</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>dhcp=&lt;0|1&gt;</I></TD>
    <TD CLASS=TABCOLOR2>if enabled (default), the Host IP, Network Mask and Gateway address will be requested from a DHCP Daemon (e.g. your wireless router) automatically whenever the ethernet cable is connected. The configuration could take some seconds depending on the responsiveness of your router.</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>local_ip=&lt;ip&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the IP address of your MIDIbox NG directly if <I>dhcp=0</I></TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>netmask=&lt;mask&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the netmask of your MIDIbox NG directly if <I>dhcp=0</I></TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>gateway=&lt;ip&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the IP address of the gateway (typically your router) directly if <I>dhcp=0</I></TD>
  </TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> OSC </H2>

<P CLASS=DESC>The OSC command configures the OSC ports. More details about the MIOS32 based OSC implementation can be found <A HREF="midibox_osc.html">at this page</A>.<BR>

List of parameters:

Each OSC port has an individual remote IP, a remote port (to which OSC packets will be sent) and a local port (from which OSC packets will be received):

<TABLE WIDTH="100%" BORDER=0 CELLSPACING=5 CELLPADDING=0>
  <TR>
    <TH WIDTH=150>OSC Command</TD>
    <TH>Description</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>n=&lt;1..4&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Specifies the OSC port which should be configured (1..4)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>remote_ip=&lt;ip&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the remote IP assigned to the OSC port (e.g. the IP of your iPad)</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>remote_port=&lt;ip&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the remote port to which OSC packets will be sent</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>local_port=&lt;ip&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Sets the local port from which OSC packets will be received</TD>
  </TR>
  <TR>
    <TD CLASS=TABCOLOR2 WIDTH=150><I>transfer_mode=&lt;format&gt;</I></TD>
    <TD CLASS=TABCOLOR2>Following transfer formats are currently supported:
      <UL CLASS=CL>
        <LI><I>MIDI</I>: MIDI events are bundled into MIDI elements
        <LI><I>Int</I>: uses human readable pathes, values are in integer format
        <LI><I>Flt</I>: uses human readable pathes, values are in float format
        <LI><I>MPP</I>: selects format which is used by <A HREF="http://moocowmusic.com/PianistPro/index.html" TARGET="_blank">Pianist Pro</A>
        <LI><I>TOSC</I>: selects format which is used by <A HREF="http://hexler.net/software/touchosc" TARGET="_blank">TouchOSC</A>
      </UL>
      Additional modes can be added in future on request:
      </TD>
  </TR>
</TABLE>


<H2> <IMG SRC="images/bullet.gif" ALT=""> DebounceCtr </H2>

<P CLASS=DESC><I>DebounceCtr &lt;0..255&gt;</I>: this command allows to enable a debouncing mechanism for digital inputs (buttons). The number specifies the dead time in mS at which button events will be rejected.


<H2> <IMG SRC="images/bullet.gif" ALT=""> GlobalChannel </H2>

<P CLASS=DESC><I>GlobalChannel &lt;0..16&gt;</I>: if set to a value &gt;0, all MIDI events generated with EVENT_* commands will be forced to the given MIDI channel. <B>not implemented yet!</B>

<H2> <IMG SRC="images/bullet.gif" ALT=""> AllNotesOffChannel </H2>

<P CLASS=DESC><I>AllNotesOffChannel &lt;0..16&gt;</I>: if set to a value &gt;0, the CC#123 event will turn off all LEDs when received over the specified channel

<H2> <IMG SRC="images/bullet.gif" ALT=""> ConvertNoteOffToOn0 </H2>

<P CLASS=DESC><I>ConvertNoteOffToOn0 &lt;0|1&gt;</I>: if set to 1, incoming NoteOff events will be converted to NoteOn with velocity 0. This option is enabled by default to simplify the configuration of receivers (e.g. LEDs) which should be turned off on any NoteOff event, including NoteOn with velocity 0 which has the same purpose (according to the MIDI spec).

<P CLASS=DESC>If set to 0, this simplification doesn't take place, so that NoteOn and NoteOff events can be handled separately.

<H2> <IMG SRC="images/bullet.gif" ALT=""> RESET_HW </H2>

<P CLASS=INFO>The <I>RESET_HW</I> command can be set at the top of a .NGC file to reset the complete configuration. This is especially useful if your file only specifies a small number of settings, so that the remaining hardware is in a "known state".

<P CLASS=INFO>This command shouldn't be specified in files which contain partial setups, e.g. an alternative <I>EVENT_*</I> configuration for your hardware, or different <I>ROUTER</I> and <I>OSC</I> settings which you could load during runtime without overwriting the actual controller setup.


<H2> <IMG SRC="images/bullet.gif" ALT=""> LCD </H2>

<P CLASS=INFO>The <I>LCD</I> command prints an immediate message on screen while it's executed.

<P CLASS=INFO>It can be used to initialize the LCDs with static text, or just to display the purpose of your file before an EVENT_* based label overwrites the message.

<P CLASS=INFO>All string control formats and directives are supported (see description of <I>EVENT_* label</I> parameter), which especially means that it's possible to clear the screen, and to jump to different cursor positions at different displays.

Example:
<TT><PRE style="margin-left:50px; font-size:8pt">
LCD "%C@(1:1:1)Hello World!"
</PRE></TT>

FOOTER