Phew, another rewrite of the whole code.. This time I changed pretty much all variables to chars, which is 8bits wide, the size that the processor use native. I also increased the clock speed to 32MHz, which is the highest frequency with the built in oscillator.
Now I cannot provoke an overrun error, or buffer overflow. This means that it's now time to add the pitch bend feature along with the trigger output (and then it's done ; ) .