0% found this document useful (0 votes)
57 views15 pages

Universal Midi Encoder Guide

The Universal Midi Encoder is designed to generate Midi data from various input devices in an organ console, supporting a flexible configuration of keyboards, stops, and pedals. It requires external resistors and an interface board for reliable connections, and programming is done via a USB link to a PC. The manual provides detailed instructions on installation, connections, and programming, catering to users with varying levels of electronic knowledge.

Uploaded by

Miguel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views15 pages

Universal Midi Encoder Guide

The Universal Midi Encoder is designed to generate Midi data from various input devices in an organ console, supporting a flexible configuration of keyboards, stops, and pedals. It requires external resistors and an interface board for reliable connections, and programming is done via a USB link to a PC. The manual provides detailed instructions on installation, connections, and programming, catering to users with varying levels of electronic knowledge.

Uploaded by

Miguel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hauptwerk Hardware

Universal Midi Encoder

Installation & Programming

Release 1.3 – December 2019

© Hauptwerk Hardware 2019 Page 1


Table of Contents
Introduction..........................................................................................................................................3
Principle of Operation..........................................................................................................................4
Connections..........................................................................................................................................7
Programming........................................................................................................................................9
External Components Required..........................................................................................................14
Notes...................................................................................................................................................15

© Hauptwerk Hardware 2019 Page 2


Introduction
The Universal Midi Encoder has been developed especially for the purpose of generating Midi data
from the many different types and styles of input devices commonly found in an organ console. It
can process inputs from keyboards, stops, pistons and pedal-boards as well as analogue devices
such as expression shoes.
It's main strength lies in its compatibility with many different types and styles of keyboards
combined with its flexibility concerning the number and type of input devices connected. For
example you could have one keyboard, one pedal-board and two hundred stops along with three
expression shoes, or you could have five keyboards, no pedal-board, and eighty stops with eight
expression shoes or you could use it simply as a stop and piston encoder, in which case it supports
up to 444 inputs.
You can use more than one encoder if you have a very large theatre organ style console in mind as
the Midi channel that the encoder sends it's data over is selectable for each input type or group,
obviously with a maximum of 16 channels. It is quite feasible therefore to use multiple encoders
and connect them to your Hauptwerk PC or sound module either via multiple Midi interfaces within
the PC or via a Midi hub.
The encoder is based on open source hardware using with our own closed source software.
In order to operate correctly the encoder requires that several resistors are connected externally to
it's circuit board. Because of this and the fact that connections are made to the encoder by simple
plug in pins which are not ideal for long term individual wire connections, we have developed an
interface board (sold separately) which contains all these external components along with a built in
5 pin DIN Midi out socket and header pins which the encoder board plugs on to. This considerably
simplifies connections to the encoder board and provides a reliable long term solution. Please note
that we do not recommend making any soldered connections direct to the encoder board and that
doing so invalidates any and all warranties.

Using the encoder requires three steps.


1. Plan your console design – i.e. how many keyboards, stops, pistons etc..
2. Install these devices and wire them up to the encoder
3. Program the encoder using a USB link to a laptop or PC and a terminal program.

This manual explains all the necessary information about the encoder and presents the required data
in a traditional electronic engineering format. Whilst this is adequate for those with an appreciation
of electronics generally, it may present a learning curve for those with no previous electronic
knowledge.
With this in mind we have produced a DVD which shows in detail exactly how to connect, program
and use the encoder and is aimed primarily at those with no previous electrical knowledge.
Both the DVD and the Interface board are available to buy from our website under the 'Shop' menu.
www.hauptwerkhardware.com

© Hauptwerk Hardware 2019 Page 3


Principle of Operation.
The operating principle used by the encoder is basically very simple. There are 12 physical inputs
which are used for the notes of the octave when connected to a keyboard. For all other devices such
as stops and pistons, these are connected together in groups of 12 also. A common line which we
refer to as a 'scan line' connects the other side of each group of 12 switches (keys or stops etc.) and
these are connected to the various 'scan ports' on the encoder. The encoder is then programmed so
that it knows which devices are connected to which of it's pins.

This arrangement suits most commercial keyboards made from the late 1970's onwards as they all
used a diode matrix scanning arrangement. The encoder will work whichever way round the diodes
are and different keyboards can have different diode directions. The only caveat is that diodes must
be the same way round on each key of any one keyboard.
Some older keyboards had a common line that covered the whole keyboard connecting one side of
all 61 keys together. These usually had separately wired switches for each key, in other words they
were hard wired rather than using a PCB. In this case it is easy to simply cut the common bus into
separate lines – one for each octave. This was the case with the Wyvern 'Exeter' organ which we
featured in the DVD of the same name.
Most keyboards have their common line spanning from C to C but some start on a different note so
their common lines span from E to E or some other starting point. The starting note name is
selected when you program the encoder so it doesn't matter which note your keyboard common
lines cover. If, for example you have two keyboards from different manufacturers and one spans C
to C and the other E to E you would simply connect the notes so that the lowest note connects to the
left most 'Note' input on the encoder and set the start note appropriately at the programming stage.

© Hauptwerk Hardware 2019 Page 4


The diagram above illustrates the case where two separate keyboards 'start' on different notes. The
keyboard on the left starts on C and this is connected to the first note input (1) on the decoder. The
keyboard on the right starts on F and this is connected to the same input (1) on the encoder. We
simply 'tell' the encoder which notes they start on when we program it.

Typically a keyboard consists of more than one octave and usually they have each of their
respective notes connected together via a diode and a separate common line for each octave; thus a
5 octave keyboard would have 17 connections. One for each of the 12 notes and one for each
octave.

© Hauptwerk Hardware 2019 Page 5


The way that the encoder works is that it sends out a signal onto each 'Scan Port' in turn and then
looks at each 'Input' to see which, if any have that signal on them. If any do then those switches are
made, keys pressed etc. It then simply sends the appropriate Midi 'On' or 'Off' signal for that note
value on the channel that was set for that keyboard. Stops and pistons work in exactly the same
way, that is why they must also be wired in groups of 12. It doesn't matter if there are less than 12
stops or pistons in a group but there can't be more.

That is basically how the encoder works and so you can see that it is not complicated to wire it up
but that due to the large number of keys, stops and so on that you are likely to have in your console
there are going to be lots of wires, particularly for the 12 note inputs. That is why there are four
rows of pins for these.

Each row is identical, it just allows you to connect more wires to these same inputs.

© Hauptwerk Hardware 2019 Page 6


Connections
The previous section covered how the encoder works and necessarily covered the majority of
connections that are used for keyboards and stops so there is little point in duplicating that data.
Referring to the picture below we will take a look at the connections available on the encoder and
what they are used for.

So looking at the picture we can see that we have:-


• Four rows of 12 inputs.
• 37 Scan Ports, distributed around the board.
• 8 Analog inputs.
• 2 power pins.
The 12 inputs and the scan inputs have all been discussed in the previous section, suffice to say that
the scan ports connect to the common lines or scan lines, and the inputs connect to the keys and
switches that form the keyboards, stops and pistons. It is necessary to have diodes connected to each
key or switch on the 'input' connection side as per the previous diagrams.
The 8 analog inputs are for the expression pedals such as swell and crescendo shoes. These expect
to see a signal between 0 and 5v and will send Midi data each time the value changes. It is
imperative that the voltage on these pins does not exceed the voltage applied to the processor on
the encoder board otherwise permanent damage to the encoder will occur. This is the reason for

© Hauptwerk Hardware 2019 Page 7


the two power pins next to the analog inputs. If the power for the expression pedals is taken from
these pins then the voltage will be correct. The voltage which appears on these pins is not
necessarily the same as the supply voltage to the encoder board! This is because the board can be
powered by either USB, in which case the input will be 5v and there isn't a problem, but there is
also a standard power jack on the encoder board which can accept between 7 and 12v. If this were
to be applied to the analog inputs it WILL fry the encoder – You have been warned...

The usual way to use the analog inputs is in conjunction with a


potentiometer, or variable resistor. One end being connected to
ground, the other end being connected to 5v and the wiper
connecting to the relevant analog input pin on the encoder board. So
the Vout connection shown here goes to one of the analog inputs.
When connecting to the analog inputs you must start with the
leftmost pin for the first pedal, then work across to the right as you
connect more pedals. This is because when you configure the
encoder to use these pedals it assumes that you have connected to
the leftmost pin first. So when it asks you 'How many pedals are
you configuring for' if you answer two it will use the first two
inputs starting on the left hand side.

© Hauptwerk Hardware 2019 Page 8


Programming
In order to program the encoder it needs to be connected to a free USB port of a PC running the
Windows Operating System. The encoder uses a CH340 USB Serial chip to communicate with the
PC. If you have ever connected a device which uses one of these chips then it is likely that your PC
already has the necessary drivers installed and you can simply connect the encoder and it will work
right away. If you have not previously used one of these and the drivers are not already installed on
your PC then you will need to install them before you can communicate with the encoder. This is a
simple operation.
1. Download the drivers from the downloads page of our website. From the menus at the top of
the page click on 'Support' followed by 'Downloads' and then click on the link called
'Driver'. Alternatively go to www.hauptwerkhardware.com/downloads.php
2. Once you have downloaded the file you need to run it. Your PC will ask you if you trust the
program and you need to answer yes, allow or whatever is the appropriate response to your
version of windows.
3. Once you have run the file the installer opens. Click the 'Install' button. Once it's complete
you can close it. NB: Windows 7 and newer seems to think that the driver hasn't installed
properly and says so in a message when you close the installation program. You can safely
choose the 'Program installed successfully' option.
4. Plug the encoder into any spare USB port. Windows will display a 'Found new Hardware'
message and eventually say that it's ready to use. It sees it as a CH240 Serial Device. It will
tell you which COM Port it is connected to and you need to take a note of this number as
you will need it later when we come to connect to it via the terminal. NB:you can safely
power the encoder from the USB connection to the PC, you do not need any other power
supply connected for the programming operations.
Once you have successfully connected the encoder to the PC you need to open a Terminal Program
in order to communicate with it. There are a number of free programs out there that you can use so
if you have a favourite one just use that. If you do not have a Terminal Program on your PC then I
recommend 'Putty'. This is the one I use. It is free, contains no adware or other nasties and works
just fine. There is a link to the Putty Download Page on the Downloads page of our website.
Alternatively go direct to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Once you have downloaded Putty go ahead and run it. You will be presented with a window where
you need to enter the communication settings for your encoder. In the 'Serial Line' box type the port
name that windows announced was in use by the encoder when you plugged it in. If you can't
remember what it was, or if you have plugged it into a different USB port since, go to the 'Windows
Device Manager' and look under the 'Ports – (COM & LPT). It will be displayed as 'USB-SERIAL
CH340 (COM x)' Where x is the port number. So if x was 4 the you need to type 'COM4' in the
'Serial Line' box in Putty. The 'Speed' needs to be 9600 and the Connection type is 'Serial'. Once
you have set these parameters click 'Open' and you will see a black window with a message from
the encoder. See Screen shots on next page. Once you press 'Enter' you should see the main menu
screen.

© Hauptwerk Hardware 2019 Page 9


© Hauptwerk Hardware 2019 Page 10
If you have already wired up your console and the encoder is connected to it then you can use the
self test utility, number 5 in the menu, to check that your wiring is all ok and identify any shorts.
Go ahead and press 5 then enter and if all is well you will see the screen below. NB: For technical
reasons pins shorted together which are not note inputs will show as shorted to ground, so use this
test as a guide only.

© Hauptwerk Hardware 2019 Page 11


If there are any shorts listed you need to fix them before continuing. Assuming that there are none
press enter to return to the Main Menu and select option 2 “Configure Keyboards and Pedal Board”
to get started with setting things up. You could start with Configuring stops & pistons (pistons are
identical to stops so just use the stops setup menu and substitute the word piston for stop in your
head!) or Expression Pedals but is seems logical to me to configure keyboards first.
The first thing it asks you is
“How many manuals (keyboards) do you have (Including Pedals)? (Min 0 - Max 7)”
The answer is obvious so type the number and press enter.
It responds with “All Existing Keyboard configs will be erased, Continue [y-n]”
Type Y or yes to continue.
Next it asks “How many octave pins will be used for this keyboard [1-6]”
This means how many common lines, scan lines, whatever you decide to call them. Type the
number and press enter.
It then asks “What is the Lowest Octave Number for this Keyboard? [0-9]”
Middle C is Midi Note 60 in Octave 5. So if your keyboard starts two octaves below middle C then
the answer is 3.
It then asks “What is the Lowest Note for this Keyboard? [0-11]”
This refers to what note your keyboard starts on – see page 5 of this manual for the discussion
pertaining to this. Type the relevant number and press enter.
Next it asks “Do your diodes face towards the common lines or away from them?”
You can either type the full words or you can type jut 'a' or 't'. Then press enter.
The next question is “Which MIDI channel will you assign to this Keyboard? [1-16]”
Type the channel you want to use then press enter. - Each keyboard, stop set and expression pedal
should use a different channel.
Next it wants to know which Scan Ports are connected to the common lines of the keyboard starting
with the lowest octave.
“Enter the pin number of the First octave line
valid pin numbers are 15-17, 20-53”
Type the number of the pin you connected the first (lowest) octave common line to. Refer to the
appendix at the end of this document for the numbers of the pins.
This last question is repeated for each octave, so if you answered 4 to the earlier question “How
many octave pins will be used for this keyboard [1-6]” it will ask you four times.
This sequence of questions is repeated for each keyboard and pedal-board you have.
Once you have configured these you are returned to the Main Menu. Pressing number 1 followed by
enter will show you the configuration you have just stored for your keyboards.
Next you can go ahead and configure your stops and pistons. The questions are very similar to the
ones for the keyboards, so go ahead and press 3 followed by enter.

© Hauptwerk Hardware 2019 Page 12


First question is “How many Sets of Stops are you configuring for?”
Remember a Set in this context is a group of 12 or less with one common scan line. Enter the
desired number and press enter.
Next is “All Existing Set of Stops configs will be erased, Continue [y-n]”
Answer Y or Yes.
Next is “How many Stop Common Lines [1-10]”
Enter the desired number and press enter. NB: There is a maximum of 10 scan lines per group of
stops. This is because Midi can only send a maximum of 128 different commands over one Midi
channel and 10 lots of 12 stops is 120. If you have more stops than this configure them as different
groups.
Next it asks about the diodes “Do your diodes face towards the common lines or away from them?”
Answer in full or abbreviate to A or T just as we did with the Keyboards configuration above.
Then it asks about the channel “Which MIDI channel will you assign to this Stop Bank? [1-16]”
Enter the desired channel number and press enter.
Finally it asks for the pin numbers of the scan ports you have used for these stops.
“Enter the pin number of the First Stop Common Line
valid pin numbers are 15-17, 20-53”
It repeats this question for each common line, so if you answered 5 to the question “How many Stop
Common Lines [1-10]” above then it will ask you five times. Refer to the appendix at the end of
this document for the numbers of the pins.
Once you have completed this configuration you are returned to the Main Menu screen.
Again pressing 1 and enter will display the full configuration of the keyboards and now the stops as
well.
The final part of the configuration task is to configure the expression pedals.
Press followed by enter.
The encoder will ask “How many Expression Pedals will be used for this Organ [0-5]”
Enter the number of expression pedals you have connected followed by enter.
It then reminds us that you have to connect the first pedal to the left most pin of the analog set – pin
A0. Then it asks for the Midi channel to use for this pedal.
“Enter MIDI Channel Number for Pedal on A0 [1-16]”
Enter the desired channel number and press return.
These questions are repeated for each pedal.
Once you have completed this configuration you are returned to the main menu.
Press 1 and enter to see the entire configuration for your organ.
That is all there is to it. You can change any of these configuration options at any time by simply
selecting the required config' number and re-entering the data or you can erase all your

© Hauptwerk Hardware 2019 Page 13


configurations by using option 6. Just type 6 and press enter then answer Y or yes and it will return
the encoder to it's as new state.
Once the configuration is complete you can press 7 followed by enter and the encoder will go into
normal mode transmitting the notes etc. from the 5 pin MIDI port.
You can now disconnect the encoder from your PC's USB port.
Now that the encoder is configured it can be powered by either a 9-12v power supply plugged into
the power socket on the board or from a USB power supply and cable. Plug a standard Midi cable
into the Midi socket on the encoder and plug the other end into the 'Midi In' socket of your
Hauptwerk computer or synth module or sequencer or whatever you plan to use your new console
with.

External Components Required


The encoder board requires a number of resistors to be connected to it in order for it to function
correctly. The Midi Out socket also needs a resistor connected to one of it's pins. If you use one of
our Interface cards to connect your encoder these components are already included and connected
so you can just go ahead and use it without having to worry about connecting these components. If
you are making your own interface or other method of connecting to the encoder then use the
diagram below to connect the resistors. Please remember that we do not recommend making any
soldered connections direct to the encoder board and that doing so invalidates any and all
warranties.

© Hauptwerk Hardware 2019 Page 14


The pin numbers for the scan lines, Inputs and analog inputs are shown below on our custom
Interface board.

Notes
The hardware used for the encoder board is an Atmel Mega 2560 AVR along with a CH340 USB to
serial device. These components are readily available as a ready assembled unit which can then be
programmed with whatever firmware you wish. These boards are what we use to build our
encoders. They use only our own production firmware and contain no boot loaders or other third
party code. This firmware remains our intellectual property. It is copyright and protected from
being read from the AVR.

© Hauptwerk Hardware 2019 Page 15

You might also like