当前位置: 首页>>代码示例>>C#>>正文


C# Beat.CalculateDuration方法代码示例

本文整理汇总了C#中AlphaTab.Model.Beat.CalculateDuration方法的典型用法代码示例。如果您正苦于以下问题:C# Beat.CalculateDuration方法的具体用法?C# Beat.CalculateDuration怎么用?C# Beat.CalculateDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AlphaTab.Model.Beat的用法示例。


在下文中一共展示了Beat.CalculateDuration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBrushIncrement

 private int GetBrushIncrement(Beat beat)
 {
     if (beat.BrushDuration == 0) return 0;
     var duration = beat.CalculateDuration();
     if (duration == 0) return 0;
     return (int)((duration / 8.0) * (4.0 / beat.BrushDuration));
 }
开发者ID:eriser,项目名称:alphaTab,代码行数:7,代码来源:MidiFileGenerator.cs

示例2: AddBeatSpring

 public Spring AddBeatSpring(Beat beat, float beatSize, float preBeatSize)
 {
     return AddSpring(beat.AbsoluteStart, beat.CalculateDuration(), beatSize, preBeatSize);
 }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:4,代码来源:BarLayoutingInfo.cs

示例3: GenerateBeat

        private void GenerateBeat(Beat beat, int barStartTick)
        {
            // TODO: take care of tripletfeel 
            var beatStart = beat.Start;
            var duration = beat.CalculateDuration();

            var track = beat.Voice.Bar.Track;

            for (int i = 0, j = beat.Automations.Count; i < j; i++)
            {
                GenerateAutomation(beat, beat.Automations[i], barStartTick);
            }

            if (beat.IsRest)
            {
                _handler.AddRest(track.Index, barStartTick + beatStart, track.PlaybackInfo.PrimaryChannel);
            }
            else
            {
                var brushInfo = GetBrushInfo(beat);

                for (int i = 0, j = beat.Notes.Count; i < j; i++)
                {
                    var n = beat.Notes[i];
                    if (n.IsTieDestination) continue;

                    GenerateNote(n, barStartTick + beatStart, duration, brushInfo);
                }
            }
        }
开发者ID:eriser,项目名称:alphaTab,代码行数:30,代码来源:MidiFileGenerator.cs

示例4: GenerateBeat

        private void GenerateBeat(Beat beat, int barStartTick)
        {
            // TODO: take care of tripletfeel
            var beatStart = beat.Start;
            var duration = beat.CalculateDuration();

            var beatLookup = new BeatTickLookup();
            beatLookup.Start = barStartTick + beatStart;
            beatLookup.End = barStartTick + beatStart + duration;
            beatLookup.Beat = beat;
            TickLookup.AddBeat(beatLookup);

            var track = beat.Voice.Bar.Staff.Track;

            for (int i = 0, j = beat.Automations.Count; i < j; i++)
            {
                GenerateAutomation(beat, beat.Automations[i], barStartTick);
            }

            if (beat.IsRest)
            {
                _handler.AddRest(track.Index, barStartTick + beatStart, track.PlaybackInfo.PrimaryChannel);
            }
            else
            {
                var brushInfo = GetBrushInfo(beat);

                for (int i = 0, j = beat.Notes.Count; i < j; i++)
                {
                    var n = beat.Notes[i];

                    GenerateNote(n, barStartTick + beatStart, duration, brushInfo);
                }
            }

            if (beat.Vibrato != VibratoType.None)
            {
                const int phaseLength = 240; // ticks
                const int bendAmplitude = 3;

                GenerateVibratorWithParams(beat.Voice.Bar.Staff.Track, barStartTick + beatStart, beat.CalculateDuration(), phaseLength, bendAmplitude);
            }
        }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:43,代码来源:MidiFileGenerator.cs


注:本文中的AlphaTab.Model.Beat.CalculateDuration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。