/// <summary> /// Creates the beats. /// </summary> /// <param name="gpVoice">The gp voice.</param> /// <param name="masterBar">The master bar.</param> /// <returns></returns> private static TabLib.Beat[] CreateBeats(alphatab.model.Bar gpBar, TabLib.MasterBar masterBar) { var gpVoice = gpBar.voices[0] as alphatab.model.Voice; var beats = new TabLib.Beat[gpVoice.beats.length]; for (var i = 0; i < gpVoice.beats.length; i++) { var gpBeat = gpVoice.beats[i] as alphatab.model.Beat; if (gpBeat != null && !gpBeat.isEmpty) { var beat = new TabLib.Beat(); beat.Index = gpBeat.index; beat.Duration = GetDuration(gpBeat.duration); beat.Notes = CreateNotes(gpBeat); beat.Text = gpBeat.text; beat.Dots = gpBeat.dots; beat.TupletDenominator = gpBeat.tupletDenominator; beat.TupletNumerator = gpBeat.tupletNumerator; beat.CalculateDuration(masterBar.Tempo); beats[i] = beat; } } return(beats); }
/// <summary> /// Creates the beats. /// </summary> /// <param name="gpVoice">The gp voice.</param> /// <param name="masterBar">The master bar.</param> /// <returns></returns> private static TabLib.Beat[] CreateBeats(alphatab.model.Bar gpBar, TabLib.MasterBar masterBar) { var gpVoice = gpBar.voices[0] as alphatab.model.Voice; var beats = new TabLib.Beat[gpVoice.beats.length]; for (var i = 0; i < gpVoice.beats.length; i++) { var gpBeat = gpVoice.beats[i] as alphatab.model.Beat; if (gpBeat != null && !gpBeat.isEmpty) { var beat = new TabLib.Beat(); beat.Index = gpBeat.index; beat.Duration = GetDuration(gpBeat.duration); beat.Notes = CreateNotes(gpBeat); beat.Text = gpBeat.text; beat.Dots = gpBeat.dots; beat.TupletDenominator = gpBeat.tupletDenominator; beat.TupletNumerator= gpBeat.tupletNumerator; beat.CalculateDuration(masterBar.Tempo); beats[i] = beat; } } return beats; }