Jump to content

Keyboard matrix 5 octaves, velocity, only 12+11 wires. Need a help please!


QBAS
 Share

Recommended Posts

Dear Thorsten

I 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 wire

C1  : signal from 2 wire IN go to 2diode , next to 2 switch and next to 1 OUT wire

C1# : signal from 3 wire IN go to 3diode , next to 1 switch and next to 1 OUT wire

C1# : signal from 4 wire IN go to 4diode , next to 2 switch and next to 1 OUT wire

D1  : signal from 5 wire IN go to 5diode , next to 1 switch and next to 1 OUT wire

D1  : signal from 6 wire IN go to 6diode , next to 2 switch and next to 1 OUT wire

D1# : signal from 7 wire IN go to 7diode , next to 1 switch and next to 1 OUT wire

D1# : signal from 8 wire IN go to 8diode , next to 2 switch and next to 1  OUT wire

E1  : signal from 9 wire IN go to 9iode , next to 1 switch and next to 1  OUT wire

E1  : signal from 10 wire IN go to 10diode , next to 2 switch and next to 1 OUT wire

F1    : signal from 11 wire IN go to 11diode , next to 1 switch and next to 1 OUT wire

F1    : signal from 12 wire IN go to 12diode , next to 2 switch and next to 1 OUT wire

F1# : signal from 1 wire IN go to 13diode , next to 1 switch and next to 2 OUT wire

F1# : signal from 2 wire IN go to 14diode , next to 2 switch and next to 2 OUT wire

G1  : signal from 3 wire IN go to 15diode , next to 1 switch and next to 2 OUT wire

G1  : signal from 4 wire IN go to 16diode , next to 2 switch and next to 2 OUT wire

G1# : signal from 5 wire IN go to 17diode , next to 1 switch and next to 2 OUT wire

G1# : signal from 6 wire IN go to 18diode , next to 2 switch and next to 2 OUT wire

A1  : signal from 7 wire IN go to 19diode , next to 1 switch and next to 2 OUT wire

A1  : signal from 8 wire IN go to 20diode , next to 2 switch and next to 2 OUT wire

B1  : signal from 9 wire IN go to 21diode , next to 1 switch and next to 2 OUT wire

B1  : signal from 10 wire IN go to 22diode , next to 2 switch and next to 2 OUT wire

H1  : signal from 11 wire IN go to 23diode , next to 1 switch and next to 2 OUT wire

H1  : signal from 12 wire IN go to 24diode , next to 2 switch and next to 2 OUT wire

C2  : signal from 1 wire IN go to 25diode , next to 1 switch and next to 3 OUT wire

C2  : signal from 2 wire IN go to 26diode , next to 2 switch and next to 3 OUT wire

C2# : signal from 3 wire IN go to 27diode , next to 1 switch and next to 3 OUT wire

C2# : signal from 4 wire IN go to 28diode , next to 2 switch and next to 3 OUT wire

D2  : signal from 5 wire IN go to 29diode , next to 1 switch and next to 3 OUT wire

D2  : signal from 6 wire IN go to 30diode , next to 2 switch and next to 3 OUT wire

D2# : signal from 7 wire IN go to 31diode , next to 1 switch and next to 3 OUT wire

D2# : signal from 8 wire IN go to 32diode , next to 2 switch and next to 3 OUT wire

E2  : signal from 9 wire IN go to 33diode , next to 1 switch and next to 3 OUT wire

E2  : signal from 10 wire IN go to 34diode , next to 2 switch and next to 3 OUT wire

F2    : signal from 11 wire IN go to 35diode , next to 1 switch and next to 3 OUT wire

F2    : 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 wire

F5# : signal from 2 wire IN go to 110diode , next to 2 switch and next to 10 OUT wire

G5  : signal from 3 wire IN go to 111diode , next to 1 switch and next to 10 OUT wire

G5  : signal from 4 wire IN go to 112diode , next to 2 switch and next to 10 OUT wire

G5# : signal from 5 wire IN go to 113diode , next to 1 switch and next to 10 OUT wire

G5# : signal from 6 wire IN go to 114diode , next to 2 switch and next to 10 OUT wire

A5  : signal from 7 wire IN go to 115diode , next to 1 switch and next to 10 OUT wire

A5  : signal from 8 wire IN go to 116diode , next to 2 switch and next to 10 OUT wire

B5  : signal from 9 wire IN go to 117diode , next to 1 switch and next to 10 OUT wire

B5  : signal from 10 wire IN go to 118diode , next to 2 switch and next to 10 OUT wire

H5  : signal from 11 wire IN go to 119diode , next to 1 switch and next to 10 OUT wire

H5  : signal from 12 wire IN go to 120diode , next to 2 switch and next to 10 OUT wire

C6  : signal from 1 wire IN go to 121diode , next to 1 switch and next to 3 OUT wire

C6  : signal from 2 wire IN go to 122diode , next to 2 switch and next to 3 OUT wire

In 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.

Link to comment
Share on other sites

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 purposes

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 weeks later...

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 purposes

Where 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 much

QBAS

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

Hi Stryd_one

Thank 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.

Link to comment
Share on other sites

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 127

Once it is released, this counter will be decremented each millisecond

until 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.

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

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. hardware

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

  • 4 weeks later...

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 (?).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Stryd_one

Does 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

Link to comment
Share on other sites

Hello QBAS, did you try to use the C based Scan matrix driver ?

http://ucapps.de/mios/sm_c_example1_v1.zip

http://ucapps.de/mios/sm_c_example2_v1.zip

I'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 ?

Cheerz

bill

Ps : yes, i have signal diodes installed.

Link to comment
Share on other sites

  • 2 weeks later...

Hi

I 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).

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...