Hello,
I'm currently building the hardware & software around a Fatar TP/9S keyboard I got from a friend. It has 63 keys with velocity sensing. Its keys are connected together to form two separate 8x8 scan matrices, which I managed to handle by modifying the BLM module in MIOS. I can currently send the correct MIDI note on/off events, and I'm really happy about this.
My problem arises now that I want to implement velocity sensing. Since the BLM code scans the whole matrix in 8 SRIO cycles, it has a resolution of 7-8ms, which is too much as far as I see. I'd like a net resolution of 1ms, that means that MIOS should update its SRIOs every 125us, but MIOS_SRIO_UpdateFrqSet uses milliseconds as units. What is the better way to do?
- modify the MIOS code to let MIOS_SRIO_UpdateFrqSet use a smaller time unit?
- setup a user timer with a 125us period and force MIOS to update the SRIOs 7 out of 8 times?
- ...what else?
- surrender and live with that resolution? (not recommended :P)
Many thanks for any help!
RAZ
Sub-millisecond SRIO? (for fast matrix scanning w/ velocity)
Started by
ris8_allo_zen0
, Sep 23 2009 22:20
5 replies to this topic
#1
Posted 23 September 2009 - 22:20
#2
Posted 24 September 2009 - 05:11
Hi raz, I'm interested in this as I'll be doing the same thing with a 25 keys fatar keyboard for a mono synth, with 1 8x8 matrix.
the 7-8ms resolution is for the two matrices or for each one?
it feels too slow?
and yeah, any light on the subjet is welcome!
the 7-8ms resolution is for the two matrices or for each one?
it feels too slow?
and yeah, any light on the subjet is welcome!
#3
Posted 24 September 2009 - 07:55
Hi all,
it seems as if this problem could perhaps be solved with help of search. Try to search this forum for qbas and scanmatrix.
Best regards,
clem!
it seems as if this problem could perhaps be solved with help of search. Try to search this forum for qbas and scanmatrix.
Best regards,
clem!
#4
Posted 26 September 2009 - 14:07
It's for both, because I'm using only one DOUT for two DINs.the 7-8ms resolution is for the two matrices or for each one?
I didn't do any "real" test yet (i.e. playing the piano) but I see that this resolution allows only to discriminate between two velocities, not more (an interval of 15-16ms or more means a really slow press).it feels too slow?
Thank you. I know about QBAS's code, but some time ago I preferred not use it because I didn't understand how to customize it with my hardware and decided to write the code by myself modifying the BLM module.it seems as if this problem could perhaps be solved with help of search. Try to search this forum for qbas and scanmatrix.
QBAS's code directly controls the shift registers without using the MIOS functions; therefore it can scan the matrix much faster than 1ms per row. Instead, BLM relies on the MIOS functions having an unchangeable 1ms update rate (changing it would bring too many side effects, I think). I have to find a solution for myself, either with the above ideas or by re-evaluating QBAS's code.
RAZ
#5
Posted 26 September 2009 - 16:18
You are going to have to go to a lower level than MIOS control of the DIN and DOUT to achieve sub-millisecond scanning of a matrix. You either need to get comfortable with what QBAS has done or find TK's earlier sm_8x8 code that QBAS used as a basis for his project. As for using the QBAS code, can you not just ignore the boards you aren't using?
#6
Posted 26 September 2009 - 18:24
The DIN and DOUT modules are connected serially to the PIC..
Scanning these takes time, and processing the results takes time as well.
It sounds like you're ready to leave MIOS and go straight into ASM code.
Choose a chip (maybe PIC, maybe something else) with enough pins so that
you can directly access every row and column without using DIN and DOUT
shift registers. The clock speed of the chip will set your capability.
If the only task is scanning your keyboard and sending MIDI, you will
have a great introduction to assembly language programming.
If the quality of your output depends on how fast you can scan the matrix,
then get off the shift registers and write your own code.
Well, that's one opinion, anyway. :-)
Have Fun,
LyleHaze
Scanning these takes time, and processing the results takes time as well.
It sounds like you're ready to leave MIOS and go straight into ASM code.
Choose a chip (maybe PIC, maybe something else) with enough pins so that
you can directly access every row and column without using DIN and DOUT
shift registers. The clock speed of the chip will set your capability.
If the only task is scanning your keyboard and sending MIDI, you will
have a great introduction to assembly language programming.
If the quality of your output depends on how fast you can scan the matrix,
then get off the shift registers and write your own code.
Well, that's one opinion, anyway. :-)
Have Fun,
LyleHaze
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




