AlphaTab.Audio.Generator.MidiFileGenerator.GenerateTrill C# (CSharp) Метод

GenerateTrill() приватный Метод

private GenerateTrill ( Note note, int noteStart, int noteDuration, int noteKey, DynamicValue dynamicValue ) : void
note AlphaTab.Model.Note
noteStart int
noteDuration int
noteKey int
dynamicValue DynamicValue
Результат void
        private void GenerateTrill(Note note, int noteStart, int noteDuration, int noteKey, DynamicValue dynamicValue)
        {
            var track = note.Beat.Voice.Bar.Staff.Track;
            var trillKey = note.StringTuning + note.TrillFret;
            var trillLength = note.TrillSpeed.ToTicks();
            var realKey = true;
            var tick = noteStart;
            while (tick + 10 < (noteStart + noteDuration))
            {
                // only the rest on last trill play
                if ((tick + trillLength) >= (noteStart + noteDuration))
                {
                    trillLength = (noteStart + noteDuration) - tick;
                }
                _handler.AddNote(track.Index, tick, trillLength, (byte)(realKey ? trillKey : noteKey), dynamicValue, (byte)track.PlaybackInfo.PrimaryChannel);
                realKey = !realKey;
                tick += trillLength;
            }
        }