03 February 2001
MKCC152.HEX : new program for MKC (MIDI Keyboard Controller), 
replacing MKCC2.HEX and MKCC151.HEX.
---------------------------------------------

Where is this file from?
-----------------------
This file is part of MKC (MIDI Keyboard Controller) project.
You can find whole project at MKC homepage: 
www.geocities.com/jdpetkov/hardware


What is this for?
-----------------------
This HEX file replaces both previous versions of MKC firmware distributed
as MKCC2.HEX and MKCC151.HEX files maintaining all their functionality. 
Now user can decide wether AllNotesOff to be issued or not when all keys are 
released. New Program functions are added for this (Key9 and Key10). 
For more information about these functions see NOTES section at the 
bottom of this document.

Thus, user is now able to control at runtime:
MIDI channel, 
Starting octave, 
Starting note (Transposition),
default Velocity value,
AllNotesOff event!

The settings are stored and used until next change. This is possible 
due to PIC ability to store and hold a number of data bytes in its 
non-violative EEPROM memory.


How to use it?
------------------------
- First, you should change JP1 jumper (as shown on schematic) with any kind of
  pushbutton. This button wil be called "Program button".
- Second, you should download MKCC152.HEX file wich contains the new PIC program.
- Third, you should burn this program into PIC. At this moment you keyboard is
  almost ready to work. Default settings are:

MIDI channel   : 1        (MIDI channel number range is 1..16)
Starting octave: 4        (Octave number range is 1..11)
Starting note  : 41       (F-Fa, note number range is 0..127)
Velocity value : 127      (Velocity value range is 0..127)
AllNotesOff    : Disabled (possible values are Enabled/Disabled)

To adjust these values you should press Program button, and holding it down,
press once or more times some of first (leftmost) 10 keys on your keyboard. 
The meaning of these keys is:

Key1 : MIDI channel -1
Key2 : MIDI channel +1
Key3 : Starting octave -1
Key4 : Starting octave +1
Key5 : Starting note -1
Key6 : Starting note +1
Key7 : Velocity -1
Key8 : Velocity +1
Key9 : AllNotesOff message Disabled
Key10: AllNotesOff message Enabled

Every parameter you change this way becomes default until you change it next way.
You may experiment new values at runtime. The last change you make is memorized 
and remembered every time the keyboard is switched on.

EXAMPLES:
All examples consider that keyboard is connected to PC Joystick port and PC is on.
In order to hear changes you make, proper software (MIDIkey, MIDImon, MIDIox, 
Cakewalk etc.) must run on the PC. You can download my 'midikey.exe' or 
M$ 'midimon.exe' from MKC controller homepage. During adjustments, every time when 
changing some setting, you will hear sound, generated thru current MIDI channel 
and having new settings.

1. You want to use your keyboard to generate percussive sounds:
   Percussive sounds are placed on MIDI channel #10 (GM - General MIDI). 
   This means you have to change you keyboard's MIDI channel to #10.
   What to do:
   - press and hold down keyboard's Program button  
   - press Key2 as many times as needed to go to MIDI channel#10. 
   - release Program button

2. You want to transpose your keyboard a octave down. 
   What to do:
   - press and hold down keyboard's Program button  
   - press Key3 once
   - release Program button

3. Your keyboard first key is C (Do) starting while controller's 
   default starting note is      #41 (F-Fa), so you want to adjust 
   controller's starting note to C(Do).
   What to do:
   - press and hold down keyboard's Program button  
   - press Key5 5 (five) times to go to lower C(Do) - MIDI note #36 
     OR press Key6 7 (seven) times to go to upper C(Do) - MIDI note #47
   - release Program button
   
4. You want to change default keyboard Velocity.
   What to do:
   - press and hold down keyboard's Program button  
   - press Key7 as many times as needed to decrease Velocity
     OR press Key8 as many times as needed to increase Velocity
   - release Program button  

5. You want to enable/disable 'AllNotesOff' message to be generated 
   when all keys are released.
   What to do:
   - press and hold down keyboard's Program button  
   - press Key9 if you want to disable 'AllNotesOff' message
     OR press Key10 if you want to enable 'AllNotesOff' message
   - release Program button    

NOTES:
   MIDI channel and Velocity are open (linear) range settings. 
   When increasing such setting you reach it's maximum value, next increase 
   will not take effect. 
   When decreasing such settingthe you reach it's minimal value, next decrease
   will not take effect.

   Starting octave and Starting note are closed (circular) range settings. 
   When increasing such setting you reach it's maximum value, next increase 
   will set it to range staring value (minimal value). 
   When decreasing such setting you reach it's minimal value, next decrease
   will set it to range ending value (maximal value).

   Enabling/disabling AllNotesOff event is supported for compatibility with some 
   cheap soundcards (mine Yamaha for example). Such cards ocasionally miss 
   messages generated by controller (especially 'NoteOff' message). This causes 
   some notes to 'hang' (to continue even after the proper key was released). 
   To avoid this effect I designed MKCC152.HEX to be able to generate 'AllNotesOff' 
   event after the last key is released, breaking 'hanging notes'. 
   From the other side, if user wants to use keyboard controller along with 
   another keyboard controllers sharing the same MIDI channel, generating 
   'AllNotesOff' message by the first keyboard controller should break notes 
   generated by the second one.
   For this reason, I made this version wich allows user to decide wether to use 
   'AllNotesOff' or not. The main rule for usng it is: enable it only if you have 
   problems with 'hanging notes' and disable it if there are no such problems.


Jordan D.Petkov,
j.d.petkov@mailcity.com
www.geocities.com/jdpetkov