In the zip file, I've included a screenshot of a sample circuit.  I improved
kahdeg's midi device, making it faster and more responsive, adding ability to
change instrument and channel, and adding default capability in case you don't
want to wire up volume line, etc.  If using kahdeg's original midi device, some
changes would be required (7 bit note value, and volume and maybe on/off lines
added), and it won't be as responsive.

In my midi keyboard, you can select which keyboard channel the output goes on
by using the parameter attributes at the lower left side of Logisim window, or
clicking on the appropriate square on the channel selector (red and yellow
boxes), or providing a 3-bit input on the channel line.  The channel line
overrides the channel selector which overrides the parameter attribute.

You can press each keyboard key for a short time, or a long time, or even drag
across many keys (just like a real piano/synthesizer).

You can also use the sound buzzer JAR library instead of kahdeg's midi device.
EXCEPT, the sound buzzer won't work in Logisim Evolution (If I had access to
the source code, I could make it work, but I don't have the source).

If you have more than one keyboard in the circuit, one keyboard (randomly
chosen each time you load the circuit) will have the keys color painted
perfectly when pressed, the other keyboards will have a slight overlapping
error when pressed.  I'm pretty sure this is a Logisim problem and not a
problem with my code.  I think it has to do with the way most things in
Logisim are somewhat transparent.  You can see this in my channel selector -
I first paint a black box fully filled in with black, then paint colored
squares on top.  If you notice, the colored squares show the background
underneath even though what should technically be underneath is black.  I
believe, in certain cases, Logisim gets confused about what should be "on top",
see-through, etc.  I have noticed this random overlapping change in other
components as well.

BTW, if you choose to have a keyboard which, for example, uses the full 11
octave range, you will probably want to zoom out by clicking on the arrows at
the bottom-left area of the Logisim window.


Mark Craig
