Esempio n. 1
0
        /// <summary>
        ///キーオフ
        /// </summary>
        public virtual void KeyOff()
        {
            if (IsKeyOff)
            {
                return;
            }

            IsKeyOff = true;
            AdsrEngine?.Gate(false);

            TrySoundOff();

            SoundKeyOff?.Invoke(this, new SoundUpdatedEventArgs(NoteOnEvent.NoteNumber, NoteOnEvent.Velocity, lastPitch));
        }
Esempio n. 2
0
        /// <summary>
        /// サウンドオフ
        /// </summary>
        public virtual void SoundOff()
        {
            if (!IsKeyOff)
            {
                IsKeyOff = true;
                AdsrEngine?.Gate(false);

                SoundKeyOff?.Invoke(this, new SoundUpdatedEventArgs(NoteOnEvent.NoteNumber, NoteOnEvent.Velocity, lastPitch));
            }

            IsSoundOff = true;

            SoundOffTime = soundOffTimeCounter++;

            SoundSoundOff?.Invoke(this, EventArgs.Empty);
        }