# more question about the emu10k instruction

Discussion in 'Effects and the DSP' started by JoshuaChang, May 11, 2011.

1. ### Max M.h/h member-shmember

Joined:
Dec 7, 2002
Messages:
2,690
9
Trophy Points:
63
Îòâåò: more question about the emu10k instruction

This is basicaly a "fractional delay line". The macintw stuff "extracts" fractional part of delay time value (which is in "TRAM scale" i.e: 1 sample = 0x800) and scales it to "normal" 32-bit fixed-point value (1 sample = unsigned(0x80000000)) to be used as an interpolation coefficient.

For example if delay time is 13.25 samples (TRAM address: 13.25 * 0x800 = 0x6a00) we take two delay outputs at 13 and 14 sample times and mix them as: virtual_delay[13.25] = delay * (1 - 0.25) + delay * 0.25;
So it's macintw that converts 0x6a00 to 0.25 (0x20000000) and 0x100000 multiplier there is just "unsigned(0x80000000) / 0x800".

edit: if you prefer shifts you can think of
macintw R, 0, X, 0x100000
as
R = ((X << 31) >> 11) & 0x7fffffff; // assuming positive values

Last edited: May 16, 2011
2. ### RussWell-Known Member

Joined:
Jan 17, 2005
Messages:
5,722
Great explanation... Thanks Max  