NScumm.Core.Audio.SoftSynth.TownsAudioInterfaceInternal.PcmKeyOn C# (CSharp) Метод

PcmKeyOn() приватный Метод

private PcmKeyOn ( int chan, int note, int velo ) : int
chan int
note int
velo int
Результат int
        int PcmKeyOn(int chan, int note, int velo)
        {
            if (chan < 0x40 || chan > 0x47)
                return 1;

            if (((note & 0x80) != 0) || ((velo & 0x80) != 0))
                return 3;

            chan -= 0x40;
            byte noteT = (byte)note;
            TownsAudio_PcmChannel p = _pcmChan[chan];

            if (p._reserved || p._keyPressed)
                return 2;

            TownsAudio_WaveTable w;
            int res = p.InitInstrument(ref noteT, _waveTables, _numWaveTables, out w);
            if (res != 0)
                return res;

            p.LoadData(w);
            p.KeyOn(noteT, (byte)velo, w);

            return 0;
        }