private void HandleTicked(double tickTime, int midiNoteNumber, double duration) { float pitch = MusicMath.MidiNoteToPitch(midiNoteNumber, MusicMath.MidiNoteC4); _samplerVoices[_nextVoiceIndex].Play(_audioClip, pitch, tickTime, _attackTime, duration, _releaseTime); _nextVoiceIndex = (_nextVoiceIndex + 1) % _samplerVoices.Length; }