Esempio n. 1
0
        void ProcessVibrato(Voice2 channel)
        {
            if (channel.vibratoRate != 0)
            {
                short temp = (short)(channel.curFreq + channel.curVibratoRate);
                channel.curOctave += (byte)((temp & 0xFF00) >> 8);
                channel.curFreq    = (byte)(temp & 0xFF);

                --channel.curVibratoUnk;
                if (channel.curVibratoUnk == 0)
                {
                    channel.curVibratoRate = (sbyte)(-channel.curVibratoRate);
                    channel.curVibratoUnk  = (sbyte)((channel.vibratoDepth & 0x0F) << 1);
                }
            }

            var output = channel.amplitudeOutput;

            output((byte)(((channel.curVolume >> 4) | (channel.curVolume & 0xF0)) & channel.channel));
            output = channel.freqOutput;
            output(channel.curFreq);
            output = channel.octaveOutput;
            output((byte)((((channel.curOctave << 4) | (channel.curOctave & 0x0F)) & _octaveMask) | ((~_octaveMask) & channel.octaveInput())));
        }
Esempio n. 2
0
        void ProcessVibrato(Voice2 channel)
        {
            if (channel.vibratoRate != 0)
            {
                short temp = (short)(channel.curFreq + channel.curVibratoRate);
                channel.curOctave += (byte)((temp & 0xFF00) >> 8);
                channel.curFreq = (byte)(temp & 0xFF);

                --channel.curVibratoUnk;
                if (channel.curVibratoUnk == 0)
                {
                    channel.curVibratoRate = (sbyte)(-channel.curVibratoRate);
                    channel.curVibratoUnk = (sbyte)((channel.vibratoDepth & 0x0F) << 1);
                }
            }

            var output = channel.amplitudeOutput;
            output((byte)(((channel.curVolume >> 4) | (channel.curVolume & 0xF0)) & channel.channel));
            output = channel.freqOutput;
            output(channel.curFreq);
            output = channel.octaveOutput;
            output((byte)((((channel.curOctave << 4) | (channel.curOctave & 0x0F)) & _octaveMask) | ((~_octaveMask) & channel.octaveInput())));
        }