More fun:

I thought I'd see if I could figure out the AlphaSyntauri keyboard:

[Linked Image from i.imgur.com]

Hacking on the apple2e driver, I think I've figured it out:

If I put the keyboard interface in slot 7, the i/o addresses would be c0f0-c0ff (c080+70 to c08f + 70) and it looks like it's actually pretty simple (though getting there was hard and exasperating, I don't know how you guys figure out the really hard stuff).

Using the AlphaSyntauri alphaplus software as my testing ground,
There are 61 keys for a 5 octave keyboard, 12 for each octave * 5 plus the start of one extra octave.

The lower 8 bytes (c0f0-c0f7) are the key off bits.
The upper 8 bytes (c0f8-c0ff) are the key on bits.

(corrected this - oops - need more sleep)

c0f0,c0f8 bit 0 = lowest octave c
c0f0,c0f8 bit 1 = + 8 half tones from c (c#,d,d#,e,f,f#,g,g#) g#
c0f0,c0f8 bit 2 = + 8 half tones (a,a#,b,c,c#,d,d#,e) e
c0f0,c0f8 bit 3 = + 24 half tones (f,f#,g,g#,a,a#,b,c) ( 2 octaves higher c)
c0f0,c0f8 bit 4 = + 32 half tones g#
c0f0,c0f8 bit 5 = + 40 half tones e
c0f0,c0f8 bit 6 = + 48 half tones ( 4 octaves higher c)
c0f0,c0f8 bit 7 = + 56 half tones
...

c0f1 - starts at c#, bits increment at +8 half tones
c0f2 - starts at d, bits increment at +8 half tones


and etc.

I haven't figured everything out yet, like how you can do velocity sensitive key testing? or how the pedals map into this, but it's a start.

According to an article I found:
Quote
Velocity sensing. Each key on the alphaSyntauri keyboard has two electrical contacts, one of which makes [contact] about one-third of the key-down travel, the other of which makes [contact] at the bottom. When a key is pressed, the following occurs:

The lower contact closes. A count register in the Apple II's memory which is assigned and maintained for each key is set to zero. No other action takes place.
The upper contact closes. The accumulated count value in the key's timing register is used to index into the velocity assignment table. Attack rate and attack target volume (envelope) of the oscillators are determined. (Note, both attack rate and attack volume are varied. Psychoacoustic research tells us that we perceive loudness to increase not only with absolute loudness increase, but also as a function of the rate of increase and the linearity of the curve.)
A new oscillator is assigned for the key which has been pressed.


I added a bunch more buttons to the apple joystick so now I have 16 buttons to map:

(I just don't have enough keys on the keyboard, I'm gonna have to figure out how to do multiple keyboards on Ubuntu)

Code
      PORT_START("joystick_buttons")
        PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)  PORT_PLAYER(1)            PORT_CODE(KEYCODE_0_PAD)    PORT_CODE(JOYCODE_BUTTON1)
        PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2)  PORT_PLAYER(1)            PORT_CODE(KEYCODE_ENTER_PAD)PORT_CODE(JOYCODE_BUTTON2)
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1)  PORT_PLAYER(2)            PORT_CODE(JOYCODE_BUTTON1)
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2)  PORT_PLAYER(2)            PORT_CODE(JOYCODE_BUTTON2)
        PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON3)
        PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON4)
        PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON5)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON5)
        PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON6)
        PORT_BIT( 0x20000, IP_ACTIVE_HIGH, IPT_BUTTON7)  PORT_PLAYER(1)         PORT_CODE(JOYCODE_BUTTON7)
        PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_BUTTON8)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON8)
        PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_BUTTON9)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON9)
        PORT_BIT( 0x400, IP_ACTIVE_HIGH, IPT_BUTTON10)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON10)
        PORT_BIT( 0x800, IP_ACTIVE_HIGH, IPT_BUTTON11)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON11)
        PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON12)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON12)
        PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON13)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON13)
        PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON14)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON14)
        PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON15)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON15)
        PORT_BIT( 0x10000, IP_ACTIVE_HIGH, IPT_BUTTON16)  PORT_PLAYER(1)            PORT_CODE(JOYCODE_BUTTON16)

and then mangled READ8_MEMBER(apple2e_state::c080_r) some more:

Code
if ((offset<=0x70) && (offset<=0x7f))  if (m_joybuttons->read() & 0x20000) printf("m_joybuttons = %x\n",m_joybuttons->read());
if ((offset>=0x70) && (offset<=0x70)) return ((m_joybuttons->read() & 0x10) ? 0xff : 0); 
else if ((offset==0x71)) return ((m_joybuttons->read() & 0x20) ? 0xff : 0);  
else if ((offset==0x72)) return ((m_joybuttons->read() & 0x40) ? 0xff : 0); 
else if ((offset==0x73)) return ((m_joybuttons->read() & 0x80) ? 0xff : 0); 
else if ((offset==0x74)) return ((m_joybuttons->read() & 0x01) ? 0xff : 0); 
else if ((offset==0x75)) return ((m_joybuttons->read() & 0x02) ? 0xff : 0); 

etc.


returning 0xff from c0f8
[Linked Image from i.imgur.com]

returning 0xff from c0fc

(hey I hit the high c! note that there are 5 octaves, 12 tones per octave, each bar is 3 lo-res pixels wide. Screen display has 5 rows, each with 12 bars, top most row has 13 bars)
[Linked Image from i.imgur.com]

returning 0xff from c0f8 to c0fe: (do you think I can be the organist for the movie Interstellar?)
[Linked Image from i.imgur.com]

and had to map all of the buttons in the ui:
(so many buttons to map, I didn't want the side effect of pressing keys on the emulated keyboard, the numeric pad came in handy)

[Linked Image from i.imgur.com]

What would be really awesome is to get a real midi keyboard and map that to an emulated AlphaSyntauri keyboard.

Last edited by Golden Child; 05/09/19 05:23 PM.