本文整理汇总了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));
}
示例2: AddBeatSpring
public Spring AddBeatSpring(Beat beat, float beatSize, float preBeatSize)
{
return AddSpring(beat.AbsoluteStart, beat.CalculateDuration(), beatSize, preBeatSize);
}
示例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);
}
}
}
示例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);
}
}