Expanding the Repatcher

I've been studying the code and schematics of the repatcher Repatcher | Open Music Labs trying to understand how it functions. I've more or less grasped the whole thing and what I actually wanna do is expand it, cause six pins are a bit too few for a modular synthesizer...
I have a small idea of expanding pins on the Arduino, either with shift registers or multiplexers (I've managed a couple of things), but I'm really not sure in the first place if this (the repatcher) is really expandable, and secondly, how to go about it. My first though is shift registers, as the whole processing is being done with the digital pins, but I can't really think of a way. First of all, I think that the more pins you use the larger the numbers you need to manipulate, meaning that quite fast you could reach Arduino's limits. Then, the pins that are responsible for the processing are being switched from input to output inside a for loop. Could that be done with shift registers?
Any ideas, hints or directions are welcome.

P.S. the repatcher is an Arduino shield that functions as a modular synth interface, controlling Pure Data or Max/MSP.

this is possible, and shift registers are probably the way to go. the only thing to watch out for, is that it will end up needing a lot of diodes. each output needs a diode. so if you make a 16 x 16 patch bay (and want to have 16 outs per row) you will need 256 diodes the speed will be fine as well, it doesnt take much processing to scan the array. look around for a project with shift registers and see what they used for code.

I don't really care to have as many outs per row as the inputs. My only concern is the limitation you get with every pin you add. In the given code, the number representing connections is a 6bit number (the same number with the inlets/outlets). If you wanna have, say, 32 pins, then you need an unsigned long to represent the possible connections for each pin. Does Arduino due support 64bit numbers?

Plus, does the arduino have enough space for 32 unsigned longs? I guess there are remedies if it doesn't, just asking..

does the arduino have enough space for 32 unsigned longs?

That's only 128 bytes. As long as you're careful elsewhere, shouldn't be a problem

you will want to change the code so the connection information is stored across a number of bytes. so rather than put them all in a long, just do 4 bytes. you then setup Pure Data to repack them, or just use them as they come in.

I'm checking stuff about shift registers and one thing I've noticed is that everyone uses a different chip for shifting out than for shifting in ( e.g. 74HC595 for shifting out and 74HC165 for shifting in). Can someone use the same chip and have it switch between shifting in and out? Cause that's what six pins are doing in the repatcher code..Or are the chips designed to do only one of the two?

they do make shift registers that can switch between parallel to serial, and serial to parallel, but i dont think that helps in this case. you need one shift register to hold a voltage, while the other shift register clocks the data in.