MIDIO128 V3
Created in July 2011
The MIDIO128 application allows to midify keyboard instruments such as organs.
It can also be used for other purposes of course - whenever you are planning to trigger MIDI events with buttons, and/or to control LEDs (or relays) via USB, MIDI or Ethernet/OSC, have a closer look to the feature list!
While the previous version was based on the expired PIC based core, MIDIO128 V3 utilizes the new MBHP_CORE_LPC17 module and provides much more features:
- up to 16 8bit input shift registers (=128 pins, =4 x MBHP_DINX4 modules)
- up to 16 8bit output shift registers (=128 pins, =4 x MBHP_DOUTX4 modules)
- up to 16 scan matrices for up to 1024 pins/keys
- up to 8 pots/faders (NOTE: will be 128 pots in future with two MBHP_AINSER64 modules)
- 2 MIDI IN ports and 2 MIDI OUT ports
- USB MIDI port with much higher transfer rate (ca. 100x faster!) than common MIDI
- Ethernet port to send/receive events via OSC
- support for DHCP - connect the module to a wireless router without additional configuration
- different OSC modes are prepared for popular PC/Mac/iPhone/iPad apps, extensions can be added on request
- can also be used as USB/MIDI interface, or even as OSC/MIDI interface
- integrated MIDI router with 16 configurable nodes
- multiple patches are stored on SD Card
- optional Control Surface for direct editing without a computer
- but patches can also be edited on a computer, e.g. in an Excel or Open Office spreadsheet
- integrated MIDI monitor for all Ports (USB/MIDI/OSC)
- integrated MIDI File Player
- integrated SD Card Reader (Mass Storage Device driver for USB)
- more features available on request
Hardware
The MIDIO128 V3 application consists of:
- a MBHP_CORE_LPC17 module
- up to 4 MBHP_DINX4 modules
- up to 4 MBHP_DOUTX4 modules
- an (more or less) optional SD Card
Without a SD Card patches can't be stored/restored, and MIDI files can't be played
- an optional 2x20 LCD + 6 buttons + rotary encoder for the control surface
Without the control surface patches can only be edited with a PC/Mac
- up to 8 pots/faders connected to J5A/J5B of the core module
Controlling Reed Relays
This diagram shows, how Reed Relays can be connected to the DOUT module.
This photo shows the circuit together with a 74HC595 shift register (DOUT) built on a veroboard.
Scan Matrices
MIDIO128 V3 allows to scan up to 16 8x8 matrices, which are connected between a DOUT and DIN shift register.
Connection diagram for a single matrix
Each matrix can be assigned to a dedicated DIN and DOUT shift register. Optionally it's possible to share a single DOUT register for all matrices (in this case assign a DOUT to the first matrix, and disable the DOUT for all other matrices). The remaining (not assigned) DIN/DOUT registers can still be used to connect buttons and LEDs directly.
Pots/Faders
Up to 8 pots/faders can be connected to J5A/B of the MBHP_CORE_LPC17 module as shown in the interconnection diagram.
The resistor value should be in the range of 1k..10k. It's recommended to connect 100 pF caps from the wiper to ground to get stable conversion values. The cable between pot and J5 port shouldn't be longer than 0.5m if 10k pots are used. With a shielded cable and 1k pots the allowed length is up to 2m.
Installation
The MIDIO128 V3 firmware is released as a precompiled binary, which can be easily updated via USB MIDI by using MIOS Studio. Details about the bootloader are explained here.
Step by Step:
- it's assumed that you already tested the USB MIDI communication by pressing the Query button in MIOS Studio as explained in the Bootloader page - you should get some informations about the chip and the running application.
If this procedure sounds unfamiliar to you, please follow the hardware test procedure first as explained in the MBHP_CORE_LPC17 page.
- download the latest midio128_v3_* release package from the MIOS32 Download Page.
- unzip the .zip archive.
- load the project.hex file with the "Hex Upload" window of MIOS Studio and press the Start button.
- the new firmware will be transfered to your MIDIbox.
- once the "Upload completed" message is displayed by MIOS Studio (after ca. 20..30 seconds), your MIDIbox will reboot, and the new firmware will be started..
The Control Surface
The optional control surface allows to edit most configuration values without the need of a computer. The rotary encoder and buttons can be directly connected to J10 of the MBHP_CORE_LPC17 module, no special DIN shift register is required (see also this schematic).
After startup the main screen will be displayed as shown on the picture above. The upper line shows the current MIDI file once the soft-button below "PLAY" is pushed. The next two soft buttons allow to select the previous/next MIDI file found in the root directory of the SD Card. The soft-button below "MENU" enters the configuration menu:

The pages are described in more details below.
Note that the 2x20 LCD will only display 4 of these items at once. Use the rotary encoder to scroll through the menu, and use a soft button to select the item above the button. Use the Exit button to get back to the previous page.
By pressing the Shift button a special page will pop up:

- MIDI: allows to start/stop the MIDI file player from any page
- MIDI: allows to disable all DOUT pins (like "All Notes Off") from any page
- MSD: enables/disables the Mass Storage Device driver as descriped in the "Integrated SD Card Reader" topic
The DIN page:

allows to configure parameters for each individual input pin of the DIN shift register chain:
- Pin: the pin number counted from 0 (0..127)
- DIN: the same number in "SR.Dx" format: first number displays the number of shift register (counted from 1, 1..16), and the second number the data input of the shift register (D0..D7)
- Mode: the button behaviour can be configured in three modes:
- Normal: On-Event sent when button pushed, Off-Event sent when button depressed
- OnOff: only On-Event is sent, no event sent when button depressed
- Toggle: alternates between On- and Off-Event whenever button is pushed
- E0On..E2On: the three bytes of the "On-Event" which is sent when the button is pushed in hexadecimal format
- E0Off..E2Off: the three bytes of the "Off-Event" which is sent when the button is depressed (resp. Toggle mode: the alternate event) in hexadecimal format
- USB1..OSC4: selects the MIDI ports over which the selected DIN pin will send the MIDI event
Hot tip: the usage of this page is too cumpersome for "mass edits" - if multiple (or all) pins should be changed, you might prefer to use a spreadsheet as described in the topic "Editing a patch with Excel/OpenOffice"
The DOUT page:

allows to configure parameters for each individual output pin of the DOUT shift register chain:
- Pin: the pin number counted from 0 (0..127)
- DOUT: the same number in "SR.Dx" format: first number displays the number of shift register (counted from 1, 1..16), and the second number the data input of the shift register (D7..D0). Note that D7..D0 is reversed, so that outputs can be connected from the left to the right side of the MBHP_DOUT module!
- Evn0..Evn1: the first two bytes of the event which will set the output pin. Whenever the value 0x00..0x3F is received, the pin will be switched off, with values >= 0x40 the pin will be switched on.
- USB1..OSC4: selects the MIDI ports over which the selected DOUT pin will receive MIDI events
Hot tip: the usage of this page is too cumpersome for "mass edits" - if multiple (or all) pins should be changed, you might prefer to use a spreadsheet as described in the topic "Editing a patch with Excel/OpenOffice"
The M8x8 page:

allows to configure the scan matrices:
- Matrix: the matrix number counted from 1..16
- Channel: the MIDI channel to which the matrix will send Note Events
- Base: the base node for the first pin of the matrix.
- DIN: DIN register assignment. If "---", the matrix is disabled, with "1..16" the selected matrix is assigned to the given DIN shift register.
Please note that the appr. pins of the shift register won't be available for sending common MIDI events as configured in the DIN page anymore!
- DOUT: DOUT register assignment. If "---", the matrix won't write to any DOUT register, with "1..16" the matrix will write to the given DOUT register in order to select the matrix row.
Please note that the appr. pins of the shift register won't be available for outputing values on incoming MIDI events as configured in the DOUT page anymore!
Please note also that all matrices will output the same value to the DOUT shift registers in order to select a button row. Accordingly it's possible to share a single DOUT register for all matrices to save hardware. However, using multple DOUT SRs could make sense if for example selarate keyboards should be scanned.
The Matrix handler is prepared for supporting different modes, which will be added on request. Currently only a single matrix configuration (DINs connected to columns, DOUTs connected to rows) is available, and only Note events over a selectable channel with a selectable base note are sent.
The AIN page:

allows to configure parameters for each individual analog pin of J5A/J5B of the core module:
- Pin: the pin number counted from 0 (0..7)
- Evn0..Evn1: the first two bytes of the event which is sent by the analog pin
- USB1..OSC4: selects the MIDI ports over which the AIN will send MIDI events
Please note: an unconnected analog input will send a permanent stream of random MIDI values. Therefore the pins are disabled by default (no MIDI port assigned). Please ensure that the pot/fader is properly connected before enabling the output port(s), either in the AIN page or in your .MIO file!
The Router page:

allows to configure the integrated MIDI Router.
The 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)
- Node: the selected router node (1..16)
- SrcP: the source port
- Chn.: the source channel ("--" to disable, 1..16 or "All")
- DstP: the destination port
- Chn.: the destination channel ("--" to disable, 1..16 to change the channel, or "All" to keep it untouched)
The OSC page:

allows to configure the OSC ports 1..4.
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). Various packet formats are supported, additional modes can be added in future on request.
- Port: the selected OSC port (1..4)
- Remote IP: the remote IP assigned to the OSC port (e.g. the IP of your iPad)
- Remote IP: the remote port to which OSC packets will be sent
- Remote IP: the local port from which OSC packets will be received
- Mode: following transfer formats are currently supported:
- MIDI: MIDI events are bundled into MIDI elements
- Text Msg (Integer): uses human readable pathes, values are in integer format
- Text Msg (Float): uses human readable pathes, values are in float format
- MPP (Pianist Pro): selects format which is used by Pianist Pro
- TOSC (TouchOSC): selects format which is used by TouchOSC
The various OSC modes are described in more detail in the "Supported OSC Packet Formats" topic below.
The Network page:

allows to configure the Ethernet interface of the MBHP_CORE_LPC17 module.
- DHCP: 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.
- IP Host: if DHCP on: displays the current IP address, if DHCP off: allows to enter the IP address of your MIDIO128 manually
- Netmask: if DHCP on: displays the current netmask, if DHCP off: allows to enter the netmask of your MIDIO128 manually
- IP Gateway: if DHCP on: displays the current gateway address, if DHCP off: allows to enter the gateway of the ethernet network manually
The MIDI page:

allows to select the MIDI play mode, and to directly select a MIDI file.
- Mode: two modes are available: "All" plays all MIDI files which can be found in the root directory of your SD Card.
"Single" plays the current MIDI file in a loop.
- Filename: opens a filename browser:

Use the rotary encoder or the </> soft buttons to scroll through the directory. Press "Load" to play the selected MIDI file.
The Monitor page:

shows all IN ports at the upper line, and OUT ports at the lower line.
Whenever an event is received or sent, the appr. item will show the event for a short moment.
This gives you a great overview of the MIDI activity, especially to analyze the current track and MIDI router setup.
The Disk page:

allows to store and restore a patch on SD Card of a given name.
- Load: opens a filename browser for all .MIO files found on SD Card:

Select one of these files to load the patch (or press the Exit button to cancel this operation).
- Save: enter the filename with the rotary encoder:

Press "SAVE" to store the patch (or press the Exit button to cancel this operation).
Editing a patch with Excel/OpenOffice
Patches are stored in "CSV" (character separated values) format on SD Card, the items are delimited with semicolons.
This format allows to edit patches with a common text editor, but also in a spreadsheet with Microsoft Excel or OpenOffice.
Most simple solution: mount the SD Card, search for the .MIO patch (e.g. "DEFAULT.MIO"), rename it to "DEFAULT.CSV" and double-click on the file.
Open Office will ask you for some formatting parameters, just use the default setup:
Now each cell will contain a single configuration value, and you can simply edit/copy/paste/etc... - vertically and horizontally!
Note that some columns (such as USB2..4, RES1..4, etc...) have no effect yet, and are reserved for future extensions.
(more details on the value formats required? This should be selfexplaining...)
Store your edits, and rename the file to the original filename. Thereafter load the patch from the Disk->Load menu - done!
Integrated SD Card Reader
A MSD (Mass Storage Device) driver is integrated into the firmware. It allows you to mount your SD Card via USB without disconnecting it from the MBHP_CORE_LPC17 module, which is especially useful if you want to quickly edit a .MIO file, or copy some .MID files.
It can be activated by pressing SHIFT and the soft button under the "MSD" item:

Alternatively (if no control surface connected) it can be activated in the MIOS Terminal with the "msd on" command.
Once enabled, the SD Card should be automatically mounted by your operating system (Windows/MacOS/Linux). USB MIDI will be disabled. The upper line of the LCD will show the MSD status in any menu page until your SD Card has been unmounted from the operating system (and MSD has been disabled again).
Remote-Configuration from MIOS Terminal
Some configuration values can be edited from the MIOS Terminal which is part of MIOS Studio.
Enter "help" to get a list of available commands:
In future it could be possible to edit any configuration parameter from the terminal, which might be helpful for runtime editing if MIDIO128 is used without a control surface.
Supported OSC Packet Formats
Following OSC formats are supported by the application - the list of supported formats will be enhanced on request:
- MIDI: MIDI events are bundled into MIDI elements, so that they can be forwarded with a MIDI proxy running on a computer. Currently only a selfwritten proxy for MacOS exists, but it should be possible to port it to other operating systems as well (if somebody is interested: step forward!)
The proxy supports common MIDI events, but also SysEx streams (!!!) embedded into "blobs".
OSC packets are sent to the path "/midi1" ... "/midi4" depending on the OSC port number.
- Text Msg (Integer or Float): MIDI events will be converted into human readable pathes. Values are either in integer or float format (e.g. float is the only type which is supported by NI Reaktor.
List of Events:
- Note Events: /<chn>/note <key-number> <velocity>
- Polypressure Events: /<chn>/polypressure <key-number> <velocity>
- CC Events: /<chn>/cc <cc-number> <cc-value>
- NRPN Events: /<chn>/nrpn <nrpn-number> <14bit-value>
- Program Change Events: /<chn>/programchange <program-number>
- Aftertouch Events: /<chn>/aftertouch <key-number>
- Pitchbend Events: /<chn>/pitchbend <pitch>
- Pianist Pro: MIDI events will be converted into the format which is used by Pianist Pro:
- Note Events: /mcmpp/key/<chn>/<key-number> <velocity>
- Polypressure Events: /mcmpp/polypressure/<chn>/<key-number> <velocity>
- CC Events: /mcmpp/cc/<chn>/<cc-number> <cc-value>
- Program Change Events: /mcmpp/programchange/<chn>/<program-number>
- Aftertouch Events: /aftertouch/<chn> <key-number>
- Pitchbend Events: /pitch/<chn> <pitch>
- TouchOSC: MIDI events will be converted into the format which is compatible to TouchOSC:
- Note Events: /<chn>/note_<key-number> <velocity>
- Polypressure Events: /<chn>/polypressure_<key-number> <velocity>
- CC Events: /<chn>/cc_<cc-number> <cc-value>
- Program Change Events: /<chn>/programchange_<program-number>
- Aftertouch Events: /<chn>/aftertouch <key-number>
- Pitchbend Events: /<chn>/pitchbend <pitch>
A simple example configuration for iPad can be downloaded from here.
Hot tip: you can use the integrated OSC Monitor of MIOS Studio to send and receive OSC events to check your configuration.
Please note: local and remote port have to be swapped when two devices communicate together. It's like connecting the "MIDI OUT" to the "MIDI IN" port. In other words: the "local port" of MIDIO128 has to be set to the "remote port" of the remote host, and vice versa.
Please note also that MIDIO128 allows to use the same port number for "local" and "remote", but unfortunately most other applications don't support this simplified setup.
Future Enhancements/Wishlist:
- all open requests have been implemented
- your request might be added here if it's easy to implement

Last update: 2012-01-14
Copyright © 1998-2012, Thorsten Klose. All rights reserved.
|