ris8_allo_zen0 Posted September 23, 2009 Report Share Posted September 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
sineSurfer Posted September 24, 2009 Report Share Posted September 24, 2009 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! Quote Link to comment Share on other sites More sharing options...
clem! Posted September 24, 2009 Report Share Posted September 24, 2009 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! Quote Link to comment Share on other sites More sharing options...
ris8_allo_zen0 Posted September 26, 2009 Author Report Share Posted September 26, 2009 the 7-8ms resolution is for the two matrices or for each one?It's for both, because I'm using only one DOUT for two DINs.it feels too slow?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 seems as if this problem could perhaps be solved with help of search. Try to search this forum for qbas and scanmatrix.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.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 Quote Link to comment Share on other sites More sharing options...
jimhenry Posted September 26, 2009 Report Share Posted September 26, 2009 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? Quote Link to comment Share on other sites More sharing options...
lylehaze Posted September 26, 2009 Report Share Posted September 26, 2009 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 thatyou 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.