Copy with no explict output will append all files to the first one. Try this:
for i in 1 2 3 4 5 6 7 8 9
do
cat IniD_0$i.spsd >> IniD_0$i.GENH
done
Now, back to the FEG business. Envelope part is rather easy - there are some things I'm not sure of but this can be tested once it actually works. And it doesn't because the filter part is beyond my skills I'm afraid. This from Neil's doc:
out = f * in + (1.0 - f + q) * prev_out - q * prev_prev_out
Where f and q are coefficients. Exactly how f and q are computed, I'm still
not 100% sure. I have a fairly good idea for f:
f = (((filtervalue & 0xFF) | 0x100) << 4) >> ((filtervalue>>8)^0x1F)
Where filtervalue is the filter envelope level, and f becomes a linear value
in the range of 0x0000 (0.0) to 0x1FFF (almost 1.0).
I'm less certain about q. For now, I intend to simply use the Q register
value, where 0x00=0.0 and 0x20=1.0 (max is 0x1F).
First of all, the equation is wrong. If it was like
(1.0 - (f + q)) it'd make more sense, but that's still no good. Most of the result comes from
f * in part - if the f is too big it won't do much filtering. If it's too small it will all but mute that channel. Since it's only 13 bits I think that
((filtervalue>>8)^0x1F) is a bit of overkill (shifts up to 31 bits).
In short: I'm lost. I've said it before that signal processing is not my forte - I don't really get the math behind IIR filters. I've tried some random changes, alas only ended up with unstable vibrato or noise generators
Any ideas?