QBAS Posted March 22, 2006 Report Share Posted March 22, 2006 Dear ThorstenI have a keyboard matrix 5 octaves, velocity.I would like to connect it with core module, but I don`t know how. In the project "DIN Velocity UnMuxed" you said"Note that this application is not able to scan a keyboard matrix, but it could be useful to realize some simple drumpads" I have a hand draw scheme, but I do something wrong and you cannot see it. :-X(when I put the shortcut /home/qb/Desktop/1.jpg between insert image points the result is bad ; Linux FC4) So how to use keyboard matrix with core module?There are 2 connectors : IN 12 wires and OUT 11 wires.Each key from bottom has 2 switches (sensor with gum), and 2 diodes (1N4 148 or IN4 I48)C1 : signal from 1 wire IN go to 1diode , next to 1 switch and next to 1 OUT wireC1 : signal from 2 wire IN go to 2diode , next to 2 switch and next to 1 OUT wireC1# : signal from 3 wire IN go to 3diode , next to 1 switch and next to 1 OUT wireC1# : signal from 4 wire IN go to 4diode , next to 2 switch and next to 1 OUT wireD1 : signal from 5 wire IN go to 5diode , next to 1 switch and next to 1 OUT wireD1 : signal from 6 wire IN go to 6diode , next to 2 switch and next to 1 OUT wireD1# : signal from 7 wire IN go to 7diode , next to 1 switch and next to 1 OUT wireD1# : signal from 8 wire IN go to 8diode , next to 2 switch and next to 1 OUT wireE1 : signal from 9 wire IN go to 9iode , next to 1 switch and next to 1 OUT wireE1 : signal from 10 wire IN go to 10diode , next to 2 switch and next to 1 OUT wireF1 : signal from 11 wire IN go to 11diode , next to 1 switch and next to 1 OUT wireF1 : signal from 12 wire IN go to 12diode , next to 2 switch and next to 1 OUT wireF1# : signal from 1 wire IN go to 13diode , next to 1 switch and next to 2 OUT wireF1# : signal from 2 wire IN go to 14diode , next to 2 switch and next to 2 OUT wireG1 : signal from 3 wire IN go to 15diode , next to 1 switch and next to 2 OUT wireG1 : signal from 4 wire IN go to 16diode , next to 2 switch and next to 2 OUT wireG1# : signal from 5 wire IN go to 17diode , next to 1 switch and next to 2 OUT wireG1# : signal from 6 wire IN go to 18diode , next to 2 switch and next to 2 OUT wireA1 : signal from 7 wire IN go to 19diode , next to 1 switch and next to 2 OUT wireA1 : signal from 8 wire IN go to 20diode , next to 2 switch and next to 2 OUT wireB1 : signal from 9 wire IN go to 21diode , next to 1 switch and next to 2 OUT wireB1 : signal from 10 wire IN go to 22diode , next to 2 switch and next to 2 OUT wireH1 : signal from 11 wire IN go to 23diode , next to 1 switch and next to 2 OUT wireH1 : signal from 12 wire IN go to 24diode , next to 2 switch and next to 2 OUT wireC2 : signal from 1 wire IN go to 25diode , next to 1 switch and next to 3 OUT wireC2 : signal from 2 wire IN go to 26diode , next to 2 switch and next to 3 OUT wireC2# : signal from 3 wire IN go to 27diode , next to 1 switch and next to 3 OUT wireC2# : signal from 4 wire IN go to 28diode , next to 2 switch and next to 3 OUT wireD2 : signal from 5 wire IN go to 29diode , next to 1 switch and next to 3 OUT wireD2 : signal from 6 wire IN go to 30diode , next to 2 switch and next to 3 OUT wireD2# : signal from 7 wire IN go to 31diode , next to 1 switch and next to 3 OUT wireD2# : signal from 8 wire IN go to 32diode , next to 2 switch and next to 3 OUT wireE2 : signal from 9 wire IN go to 33diode , next to 1 switch and next to 3 OUT wireE2 : signal from 10 wire IN go to 34diode , next to 2 switch and next to 3 OUT wireF2 : signal from 11 wire IN go to 35diode , next to 1 switch and next to 3 OUT wireF2 : signal from 12 wire IN go to 36diode , next to 2 switch and next to 3 OUT wire. . . . . . . . . . . . .. . . . . . . . . . ..F5# : signal from 1 wire IN go to 109diode , next to 1 switch and next to 10 OUT wireF5# : signal from 2 wire IN go to 110diode , next to 2 switch and next to 10 OUT wireG5 : signal from 3 wire IN go to 111diode , next to 1 switch and next to 10 OUT wireG5 : signal from 4 wire IN go to 112diode , next to 2 switch and next to 10 OUT wireG5# : signal from 5 wire IN go to 113diode , next to 1 switch and next to 10 OUT wireG5# : signal from 6 wire IN go to 114diode , next to 2 switch and next to 10 OUT wireA5 : signal from 7 wire IN go to 115diode , next to 1 switch and next to 10 OUT wireA5 : signal from 8 wire IN go to 116diode , next to 2 switch and next to 10 OUT wireB5 : signal from 9 wire IN go to 117diode , next to 1 switch and next to 10 OUT wireB5 : signal from 10 wire IN go to 118diode , next to 2 switch and next to 10 OUT wireH5 : signal from 11 wire IN go to 119diode , next to 1 switch and next to 10 OUT wireH5 : signal from 12 wire IN go to 120diode , next to 2 switch and next to 10 OUT wireC6 : signal from 1 wire IN go to 121diode , next to 1 switch and next to 3 OUT wireC6 : signal from 2 wire IN go to 122diode , next to 2 switch and next to 3 OUT wireIn worse case I`ll sctch a board and separate each switch IN (from only 12 to 122 :-\),connect all OUT "groundes" togetcher and use 4 DIN4 modules.But is this to possible to use orginal matrix, for free DIN for additional switches, encoders?How about latency ?Thank you T.K. Quote Link to comment Share on other sites More sharing options...
TK. Posted March 22, 2006 Report Share Posted March 22, 2006 Hi QBAS,I'm not an expert in this topic, and I can not help that much for finding the perfect implementation to control a keyboard matrix with velocity sensitivity, especially because I don't own such hardware.I created an assembly based example which demonstrates, how to scan a matrix (-> sm_example2_v1.zip, see MIOS download page). The latency is about 80 uS for 64 buttons. The code for velocity detection needs to be added.If additional switches and encoders should be used in parallel, it would be required to connect the DIN/DOUT chain to seperate pins (thats possible, the pins are defined in sm_fast.inc) - I would propose J6 and J7, since these ports are designed for such purposesBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 6, 2006 Author Report Share Posted April 6, 2006 Thank you very very much T.K. for fast respense.For me You are an expert.Yes! With my keyboard matrix (orginally from damaged evolution mk361) the sm_example2_v1 work! Now I try change the code :D.If additional switches and encoders should be used in parallel, it would be required to connect the DIN/DOUT chain to seperate pins (thats possible, the pins are defined in sm_fast.inc) - I would propose J6 and J7, since these ports are designed for such purposesWhere to connect in this case AIN modules? What is the reason to use separate pins to the DIN/DOUT chain when I would like to work with additional encoders?Will it be bigger latency when I use also SRIO (DIN/DOUT modules not in chain) together with chain?Thank you very muchQBAS Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 6, 2006 Report Share Posted April 6, 2006 Hi QBAS,Thanks for testing that code out :) I've been wanting to do so for a long time, and you may not know this, but you are the first to use the code and confirm that it works, aside from TK! I hope that you wouldn't mind taking a few minutes to share some details of how you did this, because many people ask about it. Perhaps if you could even share photos, that would be fantastic... But either way, thanks for testing it!I think you will need to expand the matrix because yours is 12x10. You can use a timer to measure the time between the first switch on the key and the second switch. This will tell you the speed of the press of the key, which can then be applied to the velocity of the note. It could be tricky to do this with the scanning matrix.It might pay for you to setup the first half of the matrix for the "1 Switch"'s and the 2nd half to the "2 Switch"s. This will mean that the matrix will be scanned for the initial movement first, and then for the end of the keypress next, which will give more accurate times.One tricky thing is... for polyphonic velocity sensitivity, you will need a timer for each key which is depressed. I'm sure there is a way around this, just haven't thought of one yet ;) Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 7, 2006 Author Report Share Posted April 7, 2006 Hi Stryd_oneThank you for your suggestions.I glad that I could be first person who tested it.I would like to share photos, but I don`t know how (I know it`s funny).When I press button for "Insert Image" and between this "][" I put path for photos - after presing preview I see no images. ???So if you can please tell me how to insert images on linux system.I need expand matrix to 16x16 because 12x11 it is need for scaning the keyboard matrix and 4x5 for 20 the buttons matrix on panel.One tricky thing is... for polyphonic velocity sensitivity, you will need a timer for each key which is depressed.Yes I`ll try to do a timer for each key. I will seek in T.K. code din_velocity_unmuxed_v1_0 but it`s a example in C ::) :-X. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 7, 2006 Report Share Posted April 7, 2006 Hiya QBAS. Thanks for trying it out mate! The images need to be hosted on a webserver somewhere, rather than on your HDD. If you would like to email them to me, I will get them online someplace and then you can link to them in the message :) Just PM me and I'll give you my email address. I will try and help with expanding the code if you need the help, although it seems you are quite good at this, so please don't think that I offer you help because I think you are incapable :) Just want to assist you in any way that you need.You know, I completely forgot that TK had done that code already! He has a solution to the multiple clock thing I was talking about:Velocity measuring works in the following way: so long the "depressed"contact is closed, a velocity counter is preloaded with 127Once it is released, this counter will be decremented each milliseconduntil the "pressed" contact is closed (see din_vel.c, DIN_VEL_Tick())Don't worry that the code is in C. We can port it to ASM if you prefer, or C and ASM code can be mixed in a single application.I am making comments before I have really done my 'homework' with this subject, so I may make errors. I will do some reasearch over the weekend. Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 7, 2006 Author Report Share Posted April 7, 2006 Thank you Stryd_one for your propose with help. You are very kind.I have some photos but I don`t know is this really imprtant? Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 19, 2006 Author Report Share Posted April 19, 2006 Thorsten please help! Sm_fast working very good!Currently I extended matrix 8 dout x 16 din = 128 switches, but I need 16x16.Is that good way for scanning 16x16: RCLK for dout connected separatelly?Is really needing the debounce counter for velocity scan matrix? Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 23, 2006 Author Report Share Posted April 23, 2006 Ok - I`m lost.I try, and cry and nothing.Maybe can someone help me? Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 24, 2006 Report Share Posted April 24, 2006 Hi QBAS,You need a hand with adding the extra 8 DOUTs? Maybe if you could put the current code on the wiki, we can take a look... Quote Link to comment Share on other sites More sharing options...
TK. Posted April 24, 2006 Report Share Posted April 24, 2006 At the hardware side, you propably only need one additional DIN register, the same DOUT could be used to select the column.From the software side an extension of sm_fast.inc isn't something which could be typed into this posting within 5 minutes, it especially needs some extensive testing by the same guy who is doing the implementation - means: I cannot really help here, it has to be done by somebody who has access to the appr. hardwareBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
QBAS Posted May 3, 2006 Author Report Share Posted May 3, 2006 Hi Thorsten!I`m full of admiration for your idea to scan matrix buttons include in sm_fast project.When I understood haw it woorks then I could extended nombers of column and rows to 16 in both.It works fine, but now I`m going to add the code for velocity detection.Of course I suppose that extention (16x16) can include errors which I don`t see and also the code could be shorter.p.s. Can somebody give me the adress where I can put file for share? Quote Link to comment Share on other sites More sharing options...
QBAS Posted May 28, 2006 Author Report Share Posted May 28, 2006 Hi all!Succesfully today I was finished adding velocity counter. :)Now I`m in testing phase so early I`ll share the code.Thanx for all support. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted May 28, 2006 Report Share Posted May 28, 2006 Awesome news!!Good on you QBAS, that's a real achievement :) Quote Link to comment Share on other sites More sharing options...
QBAS Posted June 5, 2006 Author Report Share Posted June 5, 2006 I realize sm_matrix 16x16 with velocity based on sm_example2_v1.The Sm_handler is called from User_Tick - when nothing is to do.I added 3 pots.When I turn a pot and play on keyboard the midi note on/off are paused/stoped.What to solve this problem?I would like to do independent tasks:-scan matrix : send notes from keyboard + attendance the buttons from panel (now from User_Tick) -velocity decrease (from User_Timer)-pots: sending CC (AIN_NotifyChange)-driving 3 x 7 segment led display (?). Quote Link to comment Share on other sites More sharing options...
stryd_one Posted June 5, 2006 Report Share Posted June 5, 2006 Hi QBas,Does it only do this when the pot is configured to send MIDI? Or even if the pot is connected, but not doing anything? Quote Link to comment Share on other sites More sharing options...
TK. Posted June 5, 2006 Report Share Posted June 5, 2006 I realize sm_matrix 16x16 with velocity based on sm_example2_v1.The Sm_handler is called from User_Tick - when nothing is to do.I added 3 pots.When I turn a pot and play on keyboard the midi note on/off are paused/stoped.What to solve this problem?I would like to do independent tasks:-scan matrix : send notes from keyboard + attendance the buttons from panel (now from User_Tick) -velocity decrease (from User_Timer)-pots: sending CC (AIN_NotifyChange)-driving 3 x 7 segment led display (?).MIOS is already doing "preemptive multitasking". This means for example, that after all pot values have been checked for changes, Tick() will be called before the pots are checked again.Therefore I think that there must be a problem with your program - it's very important, that functions never block the main thread!Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
QBAS Posted June 11, 2006 Author Report Share Posted June 11, 2006 Stryd_oneDoes it only do this when the pot is configured to send MIDI? Or even if the pot is connected, but not doing anything?Pots are initialized but not connected.When I configure pots for sending CC -> keyboard sending note on/off is halted, droped.When I set pots for doing nothing, then no problem with sending note on/off. Thorsten.MIOS is already doing "preemptive multitasking". This means for example, that after all pot values have been checked for changes, Tick() will be called before the pots are checked again.Therefore I think that there must be a problem with your program - it's very important, that functions never block the main thread!Thank you for suggestion, I`m looking for Quote Link to comment Share on other sites More sharing options...
bill Posted June 16, 2006 Report Share Posted June 16, 2006 Hello QBAS, did you try to use the C based Scan matrix driver ?http://ucapps.de/mios/sm_c_example1_v1.ziphttp://ucapps.de/mios/sm_c_example2_v1.zipI'm working with those files, and i have some strange behaviors, that i suppose are on the hardware side, but i would like to compare with your results...Here is what i'm talking about :I did a keypressed counter, and it's counting fine 3 to 6 keys, but in some case, when i press, let's say 5 or 6 keys, the counter say 7,8, and sometimes more. (depending on which cols,rows)PLease, could you try to play large chords, and tell me if they allways sound ok ?CheerzbillPs : yes, i have signal diodes installed. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted June 16, 2006 Report Share Posted June 16, 2006 I can't wait to see your two different implementations of this :) I dunno why, I don't plan on using a keyboard.. Must be the geek in me ;D Quote Link to comment Share on other sites More sharing options...
moxi Posted June 16, 2006 Report Share Posted June 16, 2006 hi Qbas,can you share your programmation for a16*16 matrix, we are working on such a project here..thanks Quote Link to comment Share on other sites More sharing options...
stryd_one Posted June 16, 2006 Report Share Posted June 16, 2006 Secret French business? ;) Quote Link to comment Share on other sites More sharing options...
QBAS Posted June 27, 2006 Author Report Share Posted June 27, 2006 HiI almost everyday check news on this forum but I don`t know why I don`t see your question about the code.Bill I`m very new in C so I decide to work with assembler - becouse I try finish keyboard. Learning C will be later.I play both hands (6, 7 notes) I every was OK. I`ll try 10 notes.Moxi - I will be a pleasure for me to share the code , but I don`t know how !I can of course send you email with file - but will be better if you give me way how and where I can put files for share.I waiting for directions. :)If somebody can improve code - I`m open!Now I`m installing modules inside empty evolution keyboard.I finishing code for LED 7 segment 3 digit matrix (8 wires x 3 wires). Quote Link to comment Share on other sites More sharing options...
QBAS Posted July 11, 2006 Author Report Share Posted July 11, 2006 OK at this moment I finish work at sm16x16velocity project.In future I`ll improve code.If somebody need a file please send me message or email. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted July 12, 2006 Report Share Posted July 12, 2006 Hi guys I should apologise for not having QBAS' excellent app webhosted yet... I'm working on it, I swear! 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.