chr1s

Adding MIDI output to broken e-piano
« on: October 10, 2017, 03:37:57 PM »
I have a broken Technics PX-103 e-piano, or more precise the piano without most of the electronics. Still there is the keyboard along with its board for scanning the keys.
What I'd like to have in the end would be midi output for the keyboard (and maybe the pedals but this shouldn't be hard).

Instead of scanning the keys by hand I hoped I could use the existing gate array and connect it to a (atmega16) micro controller from where I can read out the key states and do the processing to note on/off messages.

The gate array's connection is shown in this service manual (edit: correct link) on page 27 C1/2.
The board also contains an EEPROM (1 kb) whose purpose I don't understand (maybe to identify the board from the control board).

As the pins in the service manual are labled rather clear (data, request, !reset, acknowledge, ready and value) I hoped to be able to more or less easily access the key states.
Having connected the pins and written a program to remotely set the outputs and read the inputs I was able to read some data which at least depends on different output bit settings. The ready bit is never set though, and I also must also admit that I'm not sure which purpose the value input should have.

Of course, I could alternatively do the scanning by hand but if possible, I'd like to use the existing gate array.

So after this not too short text my question would be if anyone has any info about how the gate array should be addressed and also if this is a feasible approach in the first place.

Edit: fixed link to service manual which only was the normal manual.
« Last Edit: November 01, 2017, 11:36:03 AM by chr1s »


Re: Adding MIDI output to broken e-piano
« Reply #1 on: October 12, 2017, 07:30:12 AM »
Hello

Did you Have a look at Midibox/UCapps.de ?
Check for MB_NG and MB_KB

Best
Zam

chr1s

Re: Adding MIDI output to broken e-piano
« Reply #2 on: October 13, 2017, 04:11:51 PM »
Hi Zam,

Thanks for the reply, I didn't know ucapps.de.
I mainly hoped to avoid re-soldering the matrix but at the moment it doesn't look very promising to use the existing gate array for scanning.

I think I'll try to hook up the matrix and build the scanning part myself. The Midibox stuff seems to be much more versatile but as I only need some note on/off output and messages for the piano pedals it looks a bit overkill.

It will take some time to continue but I'll post again as soon as I have some results. If it won't work I'll probably switch to MidiBox KB.

Chris

Re: Adding MIDI output to broken e-piano
« Reply #3 on: October 14, 2017, 08:40:09 AM »
Hello Chris

How is done the matrix scanning ? if by chance it use 75HC595/74HC165 you can maybe hook them up directly to DIO port of  STM32F4 runing MIOS...
The price cost for a core and DIOmatrix pcb is low... I won't hesitate to take the midibox route.
MidiboxKB app have an optimized scanning rate, 260uS for a 64 keys matrix !
Best
Zam

chr1s

Re: Adding MIDI output to broken e-piano
« Reply #4 on: October 14, 2017, 12:03:28 PM »
Hi Zam,

The scanning is done by a (I suppose) proprietary IC which is called Technics MSM74U042-016.  I just had a look at the switches which aren't toggles but seem to be like the Fatar DR type (just as a further info; I expected toggles).

It seemed to me that the Midibox PCBs aren't available directly but need to be manufactured by oneself.  Also, I'm not sure whether using Midibox gets a faster result for me as there are quite a few points that are new to me (assembling the board, connecting with the keyboard and then using MIOS to get the correct output).

My idea for scanning was to use two atmega16 to convert a 6 bit word into 44 (2x 22) outputs of which only one bit (1 << input) is set.  I'd then use a further atmega to do the scanning (output 6-bit address, input 8 bits of switch data).
The electronics side should be quite easy (hooking up 3 atmegas, some connectors and MIDI in/out) and also the programming hopefully isn't too hard.

Chris

Re: Adding MIDI output to broken e-piano
« Reply #5 on: October 14, 2017, 03:12:34 PM »
Hello

PCB available here:
https://modularaddict.com/manufacturer/midibox

If you'll take midibox route you need DIOmatrix and Core, and a STM32F407VG disco
all programming already done  ::)

easy config and then USB midi, plug and play !

Best
Zam

chr1s

Re: Adding MIDI output to broken e-piano
« Reply #6 on: November 01, 2017, 11:45:06 AM »
I added the midi scanning using one atmega16 as multiplexer (didn't need two as the matrix is only 22x8) and another atmega32 for the scanning. It was a bit of trial and error but I now have it working with velocity although I might need to fine-tune the velocity mapping. I took some very rough measurements for different velocities and fitted a log function time vs. velocity.

The pedals aren't implemented yet but this shouldn't be too hard.