/// <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)); }
/// <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); }