public Note() { Str = 0; Fret = 0; Velocity = 100; ResizeValue = 1.0f; IsVibrato = false; IsHammer = false; IsPalmMuted = false; IsMuted = false; Harmonic = HarmonicTypes.None; HarmonicFret = 0.0f; SlidesToNext = false; SlideInFromBelow = false; SlideInFromAbove = false; SlideOutUpwards = false; SlideOutDownwards = false; BendPoints = new List <BendPoint>(); Connect = false; TremoloBarPoints = new List <BendPoint>(); IsTremoloBarVibrato = false; IsSlapped = false; IsPopped = false; Index = 0; Duration = 0; Fading = Fadings.None; IsRhTapped = false; }
public Note(Note old) : this() { Str = old.Str; Fret = old.Fret; Velocity = old.Velocity; IsVibrato = old.IsVibrato; IsHammer = old.IsHammer; IsPalmMuted = old.IsPalmMuted; IsMuted = old.IsMuted; Harmonic = old.Harmonic; HarmonicFret = old.HarmonicFret; SlidesToNext = old.SlidesToNext; SlideInFromAbove = old.SlideInFromAbove; SlideInFromBelow = old.SlideInFromBelow; SlideOutDownwards = old.SlideOutDownwards; SlideOutUpwards = old.SlideOutUpwards; BendPoints.AddRange(old.BendPoints); TremoloBarPoints.AddRange(old.TremoloBarPoints); IsTremoloBarVibrato = old.IsTremoloBarVibrato; IsSlapped = old.IsSlapped; IsPopped = old.IsPopped; Index = old.Index; Duration = old.Duration; Fading = old.Fading; IsRhTapped = old.IsRhTapped; ResizeValue = old.ResizeValue; }
private List <int[]> CreateVolumeChanges(int index, int duration, int velocity, Fadings fading) { int segments = 20; List <int[]> changes = new List <int[]>(); if (fading == Fadings.FadeIn || fading == Fadings.FadeOut) { int step = velocity / segments; int val = fading == Fadings.FadeIn ? 0 : velocity; if (fading == Fadings.FadeOut) { step = (int)(-step * 1.25f); } for (int x = index; x < index + duration; x += (duration / segments)) { changes.Add(new int[] { x, Math.Min(127, Math.Max(0, val)) }); val += step; } } if (fading == Fadings.VolumeSwell) { int step = (int)(velocity / (segments * 0.8f)); int val = 0; int times = 0; for (int x = index; x < index + duration; x += (duration / segments)) { changes.Add(new int[] { x, Math.Min(127, Math.Max(0, val)) }); val += step; if (times == segments / 2) { step = -step; } times++; } } changes.Add(new int[] { index + duration, velocity }); //Definitely go back to normal return(changes); }