Jump to content

Diamond MIDI Keyboard  / NTS-1 Patch editor Part 02




After playing with RND(NTS-1), it became apparent that the patch editor is going to need some way of sending MIDI NOTEON and NOTEOFF commands from the computer.  I tried to use characters to draw a horizontal keyboard, 2 keys per character. I  was not happy with the visual results.


Eventually the characters were rotated and used to create a keyboard Icon where the keys were orientated vertically. The improvement  was due more to its orientation then it was due to it being displayed as an icon.  It wasn't until I started programing the EVENTs that I realized how much easier my life got when the icon was used.


When the EVENT procedure is called, 5 memory locations are filled with the icon event data.


ICON event data

$9A93 EVENTTYPE     icon event = 1

$9A94 EVENTTYPE+1    icon#(0-31)

$9A95 EVENTTYPE+2    # clicks

$9A96 EVENTTYPE+3   X position

$9A97 EVENTTYPE+4   Y position


The EVENTTYPE locations are only changed when the EVENT procedure is called.  These three locations are updated with some regularity and quite often:




$9A82  CLICK  0=button up, 1=button down, 2 = 2 single click, 3 = double click


 KEY6.APP is the test program for the keyboard icon. There is nothing musical about it.  The program just puts the icon on the screen and then displays the memory locations as they change.  Clicking the "Q" in the lower right corner will return you to the DESKTOP.





 (Sorry no source code.  I turned it into icon data with the press of a button.)


This program demonstrates that when the mouse button was held down while the mouse is pointing to an icon, EVENTTYPE+2 and CLICK would both register 1. Then when released, CLICK became zero but EVENTTYPE+2 remained as one until the next EVENT call (Good to know #1)


As expected, the SCREENX and SCREENY were not equal to EVENTTYPE+3 and EVENTTYPE+4. The EVENTTYPE X and Y is in reference to the origin coordinates of the icon (Good to know #2).  Diamond does half the work of determining which key is being pressed within the icon. The Y position can then be scaled over the range of the keyboard.  (NOTE#=  -Y/4 + 81)


MIDIKEY1.APP is the program to be used with a MIDIMAX compatable interface and MIDI sound synthisizer set to receive data on Channel 1.




Click the infodialog box  to access the almost 4 octave keyboard.  Move the mouse onto the key you wish to play.  Middle C (60)  is indicated by a dot on the ivory. Hold down the mouse button to begin playing the note and then release for NOTEOFF.  Double click to latch the NOTEON and then single click anywhere on the keyboard icon for NOTEOFF.  


"Q" is still in the same location.


Don't expect to be playing Bach with this keyboard.  Its going to work for turning notes on and off to test settings in the patch editor.  I've included the MAC/65 source code 'cause there is always room for improvement.




Edited by k-Pack
clicked OK when not done



Recommended Comments

There are no comments to display.

Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...