You will need to slightly modify Schematics and Code to to increase number of keys.
On schematics you will have to replicate same 32 keys scan matrix and as already discussed you can organize it in several ways 8*8 or 16*4 scan matrix. Lets see how it is achieved in 8*8 rows/columns case
Assuming you already have a scan matrix with 64 keys or were able to extend 32 keys scan matrix to 64 keys you will have now 8 rows and 8 columns from original project 8*4. Now you need to do same extension on the Arduino side by adding 4 digital inputs to support extra 4 rows displayed as YELLOW group on the schematics. Hope this part does make sense. If it does not I suggest to read links that were posted on original blog post to understand how scan matrix works - that should make it clearer.
Below is modified code to handle the extra 4 rows. I've added comments to highlight the extra code added.
After modifying original sketch it should allow all 64 keys to be played at the same time (not that you would do it).
You may notice there is a lot repetition in the code. It was left intentionally that way to highlight parts that needs to be repeated. And in fact it could be made simpler by organizing rows and groupValue(s) in array. You can check the Velocity midi keyboard example as it makes use of array for rows and groupValue(s).
One of the steps you will need to do in the sketch is to Map keys to MIDI notes. You can use following resrouces:
Midi notes map (NOTE to NUMBER):
Generally good resource on MIDI:
Below is a sketch modification required to implement 8*8 matrix
Above we have discussed 8*8 martix to midi implementation.
I have not seen 16*4 matrix but if you got one, modifications will be more complex. We will not discuss details but roughly explain whats needed in this case and hopefully you will go for 8*8.
You will increase number of columns (extra 8) and will have to add one more 74HC595 to implement 8 more columns. Number of rows will remain 4. Code modifications required will be following. You will need to add values to bits array will to increase scan loop to 16 (8 more scans for new 8 columns). Disadvantages of 16*4 matrix is it will be about twice slower than 8*8 as it will require 8 more serial scans (while in 8*8 it requires only 4 more). Schematic is also more complex in 16*4 implementation as it will require extra 74HC595 unless you use a better serial to parallel chip that has 16 outputs instead of 8. And overall from 16*4 to 8*8 you will economy couple of I/Os only - not much difference.
In fact 8*8 matrix could be implemented without 74HC595 if you ok to use all I/Os on the Arduino but make scan matrix faster... I might put a short post on it. That would make sense in case of Arduino Mega where you have plenty of I/Os and simplicity of schematics and implementation speed is what you want to achieve...
Hope that makes things a bit clearer... :)