BIT() public static method

public static BIT ( byte x, byte n, byte w ) : byte
x byte
n byte
w byte
return byte
Esempio n. 1
0
        public System.Collections.Generic.HashSet <byte> GetModulators(byte opNum, System.Collections.Generic.HashSet <byte> modulators = null)
        {
            if (modulators == null)
            {
                modulators = new System.Collections.Generic.HashSet <byte>(opCount);
            }
            var modulators_left = new System.Collections.Generic.HashSet <byte>(opCount);

            for (byte i = 0; i < opCount; i++)
            {
                if (i == opNum || modulators.Contains(i))
                {
                    continue;
                }
                if (Tools.BIT(connections[i], opNum) == 1)  //Target is connected to us.  Add it to the set.
                {
                    modulators.Add(i); modulators_left.Add(i);
                }
            }

            //For all the items currently in the set, find the modulators connected to it.
            foreach (byte m in modulators_left)
            {
                GetModulators(m, modulators);
            }

            return(modulators);
        }
Esempio n. 2
0
 public static byte attenuation_increment(byte rate, byte index)
 {
     return (byte) Tools.BIT(s_increment_table[rate], (byte) (4*index), 4);
 }