private float WaveValue(int timeIndex) { var value = 0f; for (var i = 0; i < this._instruments.Length; i++) { var instrument = this._instruments[i]; value += AudioMath.WaveValue( instrument.WaveFunction, null, timeIndex, AudioMath.GetFrequency(this.TargetStep + instrument.StepOffset), this.Volume * instrument.Volume * AudioMath.StandardVolume * (1 + .5f * Mathf.Sin(timeIndex * .00002f / (i + 1)))); } return(value); }
private void Update() { // TODO: Bend; this._frequency = AudioMath.GetFrequency(this.TargetStep); }
public void PlayNote(int step, float volume = 1f) { this._currentNotes.Add(new Note(Time.time + 1, AudioMath.GetFrequency(step), volume)); }