/// <summary> /// このパートに割当てられている設定値をリセットします。 /// </summary> public void Reset() { this.waveform = new Square(); this.volume = (float)(1.0 / 1.27); this.expression = 1.0f; this.gain = 1.0f; this.panpot = new Panpot(1.0f, 1.0f); this.vibrateDepth = 4.0; this.vibrateFreq = 4.0; this.vibrateDelay = 0.0; this.vibratePhase = 0.0; this.portamentSpeed = 1.0 * 0.001; this.portament = false; this.vibrate = false; this.velocity = 1.0f; this.sampleTime = 0; this.notePhase = 0.0; this.noteFreq = 0.0; this.noteFreqOld = 0.0; this.finetune = 1.0; this.keyShift = 0; this.envelope.Reset(); }
/// <summary> /// このパートにハンドルを適用します。 /// </summary> /// <param name="handle">適用されるハンドル。</param> public void ApplyHandle(Handle handle) { switch (handle.Type) { //パラメータリセット case HandleType.Reset: this.Reset(); break; //サイレンス case HandleType.Silence: this.Silence(); break; //ボリューム設定 case HandleType.Volume: this.ApplyForVolume(handle.Data1, handle.Data2); break; //パンポット case HandleType.Panpot: this.panpot = new Panpot(handle.Data2); break; //ビブラート case HandleType.Vibrate: this.ApplyForVibrate(handle.Data1, handle.Data2); break; //波形追加 case HandleType.Waveform: this.ApplyForWaveform(handle.Data1, handle.Data2); break; //波形編集 case HandleType.EditWaveform: this.waveform.SetParameter(handle.Data1, handle.Data2); break; //エンベロープ case HandleType.Envelope: this.envelope.SetParameter(handle.Data1, handle.Data2); break; //ファインチューン case HandleType.FineTune: this.finetune = handle.Data2.Clamp(float.MaxValue, 0.0f); break; //キーシフト case HandleType.KeyShift: this.keyShift = handle.Data1.Clamp(128, -128); break; //ポルタメント case HandleType.Portament: this.ApplyForPortament(handle.Data1, handle.Data2); break; //ゼロゲート case HandleType.ZeroGate: this.ZeroGate(handle.Data1); break; //ノートオフ case HandleType.NoteOff: this.Release(); break; //ノートオン case HandleType.NoteOn: this.Attack(handle.Data1); this.velocity = handle.Data2.Clamp(1.0f, 0.0f); break; default: break; } }