예제 #1
0
        protected void CheckTest02Score(Score score)
        {
            // Whole Notes
            int beat = 0;

            foreach (var duration in Enum.GetValues(typeof(Duration)))
            {
                Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].Fret);
                Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].String);
                Assert.AreEqual(duration, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Duration);
                beat++;

                Assert.AreEqual(2, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].Fret);
                Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].String);
                Assert.AreEqual(duration, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Duration);
                beat++;

                Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].Fret);
                Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].String);
                Assert.AreEqual(duration, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Duration);
                beat++;

                Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].Fret);
                Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Notes[0].String);
                Assert.AreEqual(duration, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Duration);
                beat++;

                Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[beat].IsRest);
                Assert.AreEqual(duration, score.Tracks[0].Bars[0].Voices[0].Beats[beat].Duration);
                beat++;
            }
        }
예제 #2
0
 public MidiFileGenerator(Score score, IMidiFileHandler handler, bool generateMetronome = false)
 {
     _score = score;
     _currentTempo = _score.Tempo;
     _handler = handler;
     GenerateMetronome = generateMetronome;
 }
예제 #3
0
 public void ShowScoreInfo(Score score)
 {
     ScoreInfoViewModel viewModel = new ScoreInfoViewModel(score);
     ScoreInfoWindow window = new ScoreInfoWindow();
     window.DataContext = viewModel;
     window.ShowDialog();
 }
예제 #4
0
        public MidiPlaybackController(Score score)
        {
            _score = score;

            ShouldPlay = true;
            Index = 0;
            CurrentTick = 0;
        }
예제 #5
0
 protected void CheckAccentuation(Score score, bool includeHeavy)
 {
     Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].IsGhost);
     Assert.AreEqual(AccentuationType.Normal, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].Accentuated);
     if (includeHeavy)
     {
         Assert.AreEqual(AccentuationType.Heavy, score.Tracks[0].Bars[0].Voices[0].Beats[2].Notes[0].Accentuated);
     }
     Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[3].Notes[0].IsLetRing);
 }
예제 #6
0
 public ScoreInfoViewModel(Score score)
 {
     _tab = score.Tab;
     _words = score.Words;
     _title = score.Title;
     _subTitle = score.SubTitle;
     _notices = score.Notices;
     _music = score.Music;
     _instructions = score.Instructions;
     _copyright = score.Copyright;
     _artist = score.Artist;
     _album = score.Album;
 }
예제 #7
0
 public ScoreInfoWindow(Score score)
 {
     InitializeComponent();
     txtAlbum.Text = score.Album;
     txtArtist.Text = score.Artist;
     txtCopyright.Text = score.Copyright;
     txtLyrics.Text = score.Words;
     txtMusic.Text = score.Music;
     txtNotes.Text = score.Notices;
     txtSubTitle.Text = score.SubTitle;
     txtTab.Text = score.Tab;
     txtTitle.Text = score.Title;
 }
예제 #8
0
        public override Score ReadScore()
        {
            _trackById = new FastDictionary<string, Track>();

            var xml = Std.ToString(_data.ReadAll());
            var dom = Std.LoadXml(xml);

            _score = new Score();
            _score.Tempo = 120;
            ParseDom(dom);
            _score.Finish();
            return _score;
        }
예제 #9
0
        /// <summary>
        /// Initializes the song with some required default values.
        /// </summary>
        /// <returns></returns>
        private void CreateDefaultScore()
        {
            _score = new Score();
            _score.Tempo = 120;
            _score.TempoLabel = "";

            _track = new Track();
            _track.PlaybackInfo.Program = 25;
            _track.PlaybackInfo.PrimaryChannel = TrackChannels[0];
            _track.PlaybackInfo.SecondaryChannel = TrackChannels[1];
            _track.Tuning = Tuning.GetDefaultTuningFor(6).Tunings;

            _score.AddTrack(_track);
        }
예제 #10
0
        public static MidiFile GenerateMidiFile(Score score, bool generateMetronome = false)
        {
            var midiFile = new MidiFile();
            // create score tracks + metronometrack
            for (int i = 0, j = score.Tracks.Count; i < j; i++)
            {
                midiFile.CreateTrack();
            }
            midiFile.InfoTrack = 0;

            var handler = new MidiFileHandler(midiFile);
            var generator = new MidiFileGenerator(score, handler, generateMetronome);
            generator.Generate();
            return midiFile;
        }
예제 #11
0
        public static BoundsLookup FromJson(object json, Score score)
        {
            var lookup = new BoundsLookup();

            var staveGroups = json.Member("StaveGroups").As<FastList<StaveGroupBounds>>();
            foreach (var staveGroup in staveGroups)
            {
                var sg = new StaveGroupBounds();
                sg.VisualBounds = staveGroup.VisualBounds;
                sg.RealBounds = staveGroup.RealBounds;
                lookup.AddStaveGroup(sg);

                foreach (var masterBar in staveGroup.Bars)
                {
                    var mb = new MasterBarBounds();
                    mb.IsFirstOfLine = masterBar.IsFirstOfLine;
                    mb.VisualBounds = masterBar.VisualBounds;
                    mb.RealBounds = masterBar.RealBounds;
                    sg.AddBar(mb);

                    foreach (var bar in masterBar.Bars)
                    {
                        var b = new BarBounds();
                        b.VisualBounds = bar.VisualBounds;
                        b.RealBounds = bar.RealBounds;
                        mb.AddBar(b);

                        foreach (var beat in bar.Beats)
                        {
                            var bb = new BeatBounds();
                            bb.VisualBounds = beat.VisualBounds;
                            bb.RealBounds = beat.RealBounds;
                            bb.Beat = score
                                .Tracks[beat.Member("TrackIndex").As<int>()]
                                .Staves[beat.Member("StaffIndex").As<int>()]
                                .Bars[beat.Member("BarIndex").As<int>()]
                                .Voices[beat.Member("VoiceIndex").As<int>()]
                                .Beats[beat.Member("BeatIndex").As<int>()];

                            b.AddBeat(bb);
                        }
                    }
                }
            }

            return lookup;
        }
예제 #12
0
        protected void CheckTest03Score(Score score)
        {
            Assert.AreEqual(4, score.MasterBars[0].TimeSignatureNumerator);
            Assert.AreEqual(4, score.MasterBars[0].TimeSignatureDenominator);

            Assert.AreEqual(3, score.MasterBars[1].TimeSignatureNumerator);
            Assert.AreEqual(4, score.MasterBars[1].TimeSignatureDenominator);

            Assert.AreEqual(2, score.MasterBars[2].TimeSignatureNumerator);
            Assert.AreEqual(4, score.MasterBars[2].TimeSignatureDenominator);

            Assert.AreEqual(1, score.MasterBars[3].TimeSignatureNumerator);
            Assert.AreEqual(4, score.MasterBars[3].TimeSignatureDenominator);

            Assert.AreEqual(20, score.MasterBars[4].TimeSignatureNumerator);
            Assert.AreEqual(32, score.MasterBars[4].TimeSignatureDenominator);
        }
        private void TestRepeat(Score score, int[] expectedIndexes)
        {
            var controller = new MidiPlaybackController(score);
            int i = 0;
            while (!controller.Finished)
            {
                var index = controller.Index;
                controller.ProcessCurrent();
                if (controller.ShouldPlay)
                {
                    Trace.WriteLine(string.Format("Checking index {0}, expected[{1}]", i, expectedIndexes[i]));
                    Assert.AreEqual(expectedIndexes[i], index);
                    i++;
                }
                controller.MoveNext();
            }

            Assert.AreEqual(expectedIndexes.Length, i);
            Assert.IsTrue(controller.Finished);
        }
예제 #14
0
        public override Score ReadScore()
        {
            _trackById = new FastDictionary<string, Track>();

            var xml = Std.ToString(Data.ReadAll());
            IXmlDocument dom ;
            try
            {
                dom = Std.LoadXml(xml);
            }
            catch (Exception)
            {
                throw new UnsupportedFormatException();
            }

            _score = new Score();
            _score.Tempo = 120;
            ParseDom(dom);
            _score.Finish();
            return _score;
        }
예제 #15
0
파일: MidiUtils.cs 프로젝트: vmoll/alphaTab
        public static MidiTickLookup BuildTickLookup(Score score)
        {
            var lookup = new MidiTickLookup();

            var controller = new MidiPlaybackController(score);
            while (!controller.Finished)
            {
                var index = controller.Index;
                controller.Process();

                if (controller.ShouldPlay)
                {
                    var bar = new BarTickLookup();
                    bar.Bar = score.MasterBars[index];
                    bar.Start = controller.RepeatMove + bar.Bar.Start;
                    bar.End = bar.Start + bar.Bar.CalculateDuration();
                    lookup.Bars.Add(bar);
                }
            }

            return lookup;
        }
예제 #16
0
        protected void CheckBend(Score score)
        {
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints.Count);

            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[0].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[0].Value);

            Assert.AreEqual(15, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[1].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[1].Value);

            Assert.AreEqual(60, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[2].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].BendPoints[2].Value);

            Assert.AreEqual(7, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints.Count);

            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[0].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[0].Value);

            Assert.AreEqual(10, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[1].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[1].Value);

            Assert.AreEqual(20, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[2].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[2].Value);

            Assert.AreEqual(30, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[3].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[3].Value);

            Assert.AreEqual(40, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[4].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[4].Value);

            Assert.AreEqual(50, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[5].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[5].Value);

            Assert.AreEqual(60, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[6].Offset);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].BendPoints[6].Value);
        }
예제 #17
0
        private void ParseDom(IXmlDocument dom)
        {
            var root = dom.DocumentElement;
            if (root == null) return;

            // the XML uses IDs for referring elements within the
            // model. Therefore we do the parsing in 2 steps:
            // - at first we read all model elements and store them by ID in a lookup table
            // - after that we need to join up the information.
            if (root.LocalName == "GPIF")
            {
                Score = new Score();

                // parse all children
                root.IterateChildren(n =>
                {
                    if (n.NodeType == XmlNodeType.Element)
                    {
                        switch (n.LocalName)
                        {
                            case "Score":
                                ParseScoreNode(n);
                                break;
                            case "MasterTrack":
                                ParseMasterTrackNode(n);
                                break;
                            case "Tracks":
                                ParseTracksNode(n);
                                break;
                            case "MasterBars":
                                ParseMasterBarsNode(n);
                                break;
                            case "Bars":
                                ParseBars(n);
                                break;
                            case "Voices":
                                ParseVoices(n);
                                break;
                            case "Beats":
                                ParseBeats(n);
                                break;
                            case "Notes":
                                ParseNotes(n);
                                break;
                            case "Rhythms":
                                ParseRhythms(n);
                                break;
                        }
                    }
                });
            }
            else
            {
                throw new UnsupportedFormatException();
            }

            BuildModel();
        }
예제 #18
0
 public void ScoreLoaded(Score score)
 {
     Score = score;
     TriggerEvent("loaded", score);
     Render();
 }
예제 #19
0
        public void SetNotes(GeneticMIDI.Representation.Track track)
        {
            if (track.Length < 1)
                return;

            var mel = track.GetMelodySequence();

            //return;

            score = new Score();

            Track t = new Track();

            MasterBar mb = new MasterBar();
            score.AddMasterBar(mb);
            mb.KeySignature = 2;

            Bar b = new Bar();
            t.AddBar(b);
            score.AddTrack(t);

            Voice v = new Voice();
            b.AddVoice(v);

            t.Name = track.Instrument.ToString().Replace("_", " ");

            //t.IsPercussion = true;
            if(t.IsPercussion)
            {

                b.Clef = Clef.Neutral;
            }

            int i = 0;

            int qn_per_bar = 4;

            int durs = 0;
            int avg_octave = mel.CalculateAverageOctave();
            int dist4 = 4 - avg_octave;
            foreach (var n in mel.Notes)
            {
                Beat be = new Beat();
                be.Index = i++;

                GeneticMIDI.Representation.Durations dur;
                int remainder;

                n.GetClosestLowerDurationAndRemainder(out dur, out remainder);

                int dots = n.GetNumberOfDots();

                durs += n.Duration;

                /*        if(durs >= qn_per_bar * (int)GeneticMIDI.Representation.Durations.qn)
                        {
                            durs = 0;
                            b = new Bar();
                            t.AddBar(b);
                            v.Bar = b;
                            b.Finish();
                        }*/

                switch (((GeneticMIDI.Representation.Durations)n.Duration))
                {
                    case GeneticMIDI.Representation.Durations.bn:
                        be.Duration = AlphaTab.Model.Duration.Whole;
                        dots = 2;
                        break;
                    case GeneticMIDI.Representation.Durations.en:
                        be.Duration = AlphaTab.Model.Duration.Eighth;
                        break;
                    case GeneticMIDI.Representation.Durations.hn:
                        be.Duration = AlphaTab.Model.Duration.Half;
                        break;
                    case GeneticMIDI.Representation.Durations.qn:
                        be.Duration = AlphaTab.Model.Duration.Quarter;
                        break;
                    case GeneticMIDI.Representation.Durations.sn:
                        be.Duration = AlphaTab.Model.Duration.Sixteenth;
                        break;
                    case GeneticMIDI.Representation.Durations.tn:
                        be.Duration = AlphaTab.Model.Duration.ThirtySecond;
                        break;
                    case GeneticMIDI.Representation.Durations.wn:
                        be.Duration = AlphaTab.Model.Duration.Whole;
                        break;
                    default:
                        break;
                }
                be.Dots = dots;

                Note note = new Note();

                if (!n.IsRest())
                {
                    note.Tone = n.NotePitch;
                    note.Octave = n.Octave + dist4;

                    be.AddNote(note);
                    be.IsEmpty = false;
                }

                if (n.IsRest() && n.Duration < 2)
                {

                }
                else
                    v.AddBeat(be);

                be.RefreshNotes();

            }

            v.Bar = b;

            v.Finish();

            b.Finish();

            t.Finish();

            score.Finish();

            //TablatureControl

            _renderer.Render(t);
            return;

            /*TablatureControl.Track = t;
            TablatureControl.InvalidateVisual();
            TablatureControl.InvalidateTrack();        */
        }
예제 #20
0
        protected void CheckDead(Score score)
        {
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].IsDead);
            Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].String);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].IsDead);
            Assert.AreEqual(2, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].String);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[2].Notes[0].IsDead);
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[2].Notes[0].String);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[3].Notes[0].IsDead);
            Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[3].Notes[0].String);
        }
예제 #21
0
        protected void CheckRanges(Score score)
        {
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[2].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[3].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[0].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[0].Notes[0].IsPalmMute);

            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[1].Notes[0].IsLetRing);
            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[2].Notes[0].IsLetRing);
            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[3].Notes[0].IsLetRing);
            Assert.IsTrue(score.Tracks[0].Bars[2].Voices[0].Beats[0].Notes[0].IsLetRing);
        }
예제 #22
0
 private void ScoreLoaded(Score score)
 {
     Score = score;
     var json = new JsonConverter();
     PostMessage(new { cmd = "loaded", score = json.ScoreToJsObject(score) });
     Render();
 }
예제 #23
0
        protected void CheckTremolo(Score score)
        {
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints.Count);

            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[0].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[0].Value);

            Assert.AreEqual(30, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[1].Offset);
            Assert.AreEqual(-4, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[1].Value);

            Assert.AreEqual(60, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[2].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[0].Voices[0].Beats[0].WhammyBarPoints[2].Value);

            Assert.AreEqual(3, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints.Count);

            Assert.AreEqual(0, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[0].Offset);
            Assert.AreEqual(-4, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[0].Value);

            Assert.AreEqual(45, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[1].Offset);
            Assert.AreEqual(-4, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[1].Value);

            Assert.AreEqual(60, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[2].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[1].Voices[0].Beats[0].WhammyBarPoints[2].Value);

            Assert.AreEqual(3, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints.Count);

            Assert.AreEqual(0, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[0].Offset);
            Assert.AreEqual(0, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[0].Value);

            Assert.AreEqual(45, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[1].Offset);
            Assert.AreEqual(-4, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[1].Value);

            Assert.AreEqual(60, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[2].Offset);
            Assert.AreEqual(-4, score.Tracks[0].Bars[2].Voices[0].Beats[0].WhammyBarPoints[2].Value);
        }
예제 #24
0
 protected void CheckStrings(Score score)
 {
     Assert.AreEqual(6, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes.Count);
     Assert.AreEqual(6, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(1).Fret);
     Assert.AreEqual(5, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(2).Fret);
     Assert.AreEqual(4, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(3).Fret);
     Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(4).Fret);
     Assert.AreEqual(2, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(5).Fret);
     Assert.AreEqual(1, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(6).Fret);
 }
예제 #25
0
 protected void CheckSlides(Score score)
 {
     Assert.AreEqual(SlideType.Legato, score.Tracks[0].Bars[0].Voices[0].Beats[0].GetNoteOnString(5).SlideType);
     Assert.AreEqual(SlideType.Shift, score.Tracks[0].Bars[0].Voices[0].Beats[2].GetNoteOnString(2).SlideType);
     Assert.AreEqual(SlideType.IntoFromBelow, score.Tracks[0].Bars[1].Voices[0].Beats[0].GetNoteOnString(5).SlideType);
     Assert.AreEqual(SlideType.IntoFromAbove, score.Tracks[0].Bars[1].Voices[0].Beats[1].GetNoteOnString(5).SlideType);
     Assert.AreEqual(SlideType.OutDown, score.Tracks[0].Bars[1].Voices[0].Beats[2].GetNoteOnString(5).SlideType);
     Assert.AreEqual(SlideType.OutUp, score.Tracks[0].Bars[1].Voices[0].Beats[3].GetNoteOnString(5).SlideType);
 }
예제 #26
0
        protected void CheckVibrato(Score score, bool checkNotes)
        {
            if (checkNotes)
            {
                Assert.AreEqual(VibratoType.Slight, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].Vibrato);
                Assert.AreEqual(VibratoType.Slight, score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].Vibrato);
            }

            Assert.AreEqual(VibratoType.Slight, score.Tracks[0].Bars[0].Voices[0].Beats[2].Vibrato);
            Assert.AreEqual(VibratoType.Slight, score.Tracks[0].Bars[0].Voices[0].Beats[3].Vibrato);
        }
예제 #27
0
        protected void CheckTrills(Score score)
        {
            Assert.AreEqual(2, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].TrillFret);
            Assert.AreEqual(Duration.Sixteenth, score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].TrillSpeed);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[1].IsTremolo);
            Assert.AreEqual(Duration.ThirtySecond, score.Tracks[0].Bars[0].Voices[0].Beats[1].TremoloSpeed);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[2].IsTremolo);
            Assert.AreEqual(Duration.Sixteenth, score.Tracks[0].Bars[0].Voices[0].Beats[2].TremoloSpeed);

            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[3].IsTremolo);
            Assert.AreEqual(Duration.Eighth, score.Tracks[0].Bars[0].Voices[0].Beats[3].TremoloSpeed);
        }
예제 #28
0
        protected void CheckOtherEffects(Score score, bool skipInstrumentCheck = false)
        {
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[0].Notes[0].IsPalmMute);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[1].Notes[0].IsStaccato);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[2].Tap);
            Assert.IsTrue(score.Tracks[0].Bars[0].Voices[0].Beats[3].Slap);

            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[0].Pop);
            Assert.IsTrue(score.Tracks[0].Bars[1].Voices[0].Beats[1].FadeIn);

            Assert.IsTrue(score.Tracks[0].Bars[3].Voices[0].Beats[0].HasChord);
            Assert.AreEqual("C", score.Tracks[0].Bars[3].Voices[0].Beats[0].Chord.Name);
            Assert.AreEqual("Text", score.Tracks[0].Bars[3].Voices[0].Beats[1].Text);
            Assert.IsTrue(score.MasterBars[4].IsDoubleBar);
            Assert.IsTrue(score.Tracks[0].Bars[4].Voices[0].Beats[0].GetAutomation(AutomationType.Tempo) != null);
            Assert.AreEqual(120.0, score.Tracks[0].Bars[4].Voices[0].Beats[0].GetAutomation(AutomationType.Tempo).Value);
            if(!skipInstrumentCheck)
            {
                Assert.IsTrue(score.Tracks[0].Bars[4].Voices[0].Beats[0].GetAutomation(AutomationType.Instrument) != null);
                Assert.AreEqual(25.0, score.Tracks[0].Bars[4].Voices[0].Beats[0].GetAutomation(AutomationType.Instrument).Value);
            }
        }
예제 #29
0
 protected void CheckStroke(Score score)
 {
     Assert.AreEqual(BrushType.BrushDown, score.Tracks[0].Bars[0].Voices[0].Beats[0].BrushType);
     Assert.AreEqual(BrushType.BrushUp, score.Tracks[0].Bars[0].Voices[0].Beats[1].BrushType);
     Assert.AreEqual(PickStrokeType.Up, score.Tracks[0].Bars[0].Voices[0].Beats[2].PickStroke);
     Assert.AreEqual(PickStrokeType.Down, score.Tracks[0].Bars[0].Voices[0].Beats[3].PickStroke);
 }
예제 #30
0
        protected void CheckTuplets(Score score)
        {
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[0].TupletNumerator);
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[1].TupletNumerator);
            Assert.AreEqual(3, score.Tracks[0].Bars[0].Voices[0].Beats[2].TupletNumerator);

            Assert.AreEqual(5, score.Tracks[0].Bars[1].Voices[0].Beats[0].TupletNumerator);
            Assert.AreEqual(5, score.Tracks[0].Bars[1].Voices[0].Beats[1].TupletNumerator);
            Assert.AreEqual(5, score.Tracks[0].Bars[1].Voices[0].Beats[2].TupletNumerator);
            Assert.AreEqual(5, score.Tracks[0].Bars[1].Voices[0].Beats[3].TupletNumerator);
            Assert.AreEqual(5, score.Tracks[0].Bars[1].Voices[0].Beats[4].TupletNumerator);
        }