コード例 #1
0
 public static string CreateChordNameText(GuitarDifficulty difficulty, ChordNameMeta chordName)
 {
     return "[" + GetChordNameTextPrefix(difficulty) + " " + chordName.ToStringEx().GetIfEmpty(" ") + "]";
 }
コード例 #2
0
        public void CreateChordNameEvents(GuitarDifficulty difficulty,
                                          int[] GuitarTuning, int[] BassTuning, Track ownerTrack)
        {
            var x108 = Generate108().Where(x => x.Chord != null).ToList();

            foreach (var item in x108)
            {
                if (item.Chord.Notes.Count() > 1)
                {
                    ChordNameMeta name = null;
                    if (ownerTrack.Name.IsBassTrackName())
                    {
                        name = item.Chord.GetTunedChordName(BassTuning);
                    }
                    else
                    {
                        name = item.Chord.GetTunedChordName(GuitarTuning);
                    }

                    int data1            = -1;
                    var useUserChordName = false;
                    var chordName        = string.Empty;
                    var hideChordName    = false;

                    item.Chord.RootNoteConfig.IfNotNull(x => useUserChordName = x.UseUserChordName);
                    item.Chord.RootNoteConfig.IfNotNull(x => chordName        = x.UserChordName);
                    item.Chord.RootNoteConfig.IfNotNull(x => data1            = x.RootNoteData1);
                    item.Chord.RootNoteConfig.IfNotNull(x => hideChordName    = x.HideNoteName);

                    if (difficulty == GuitarDifficulty.Expert)
                    {
                        if (hideChordName || (data1 == -1 && (name == null || (name != null && name.ToneName.ToToneNameData1() == ToneNameData1.NotSet))))
                        {
                            ownerTrack.Insert(item.Ticks.Down, new ChannelMessage(ChannelCommand.NoteOn, Utility.ChordNameHiddenData1, 100 + item.Fret));
                            ownerTrack.Insert(item.Ticks.Up, new ChannelMessage(ChannelCommand.NoteOff, Utility.ChordNameHiddenData1, 0));
                        }
                        else
                        {
                            if (data1 == -1)
                            {
                                data1 = name.ToneName.ToToneNameData1().ToInt();
                            }
                            ownerTrack.Insert(item.Ticks.Down, new ChannelMessage(ChannelCommand.NoteOn, data1, 100 + item.Fret));
                            ownerTrack.Insert(item.Ticks.Up, new ChannelMessage(ChannelCommand.NoteOff, data1, 0));
                        }
                    }


                    var chordNameText = Utility.CreateChordNameText(item.Chord.Difficulty, useUserChordName ? chordName : name.ToStringEx());

                    if (chordNameText.IsNotEmpty())
                    {
                        ownerTrack.Insert(item.Chord.AbsoluteTicks, new MetaMessage(MetaType.Text, chordNameText));
                    }
                }
            }
        }
コード例 #3
0
 public static string CreateChordNameText(GuitarDifficulty difficulty, ChordNameMeta chordName)
 {
     return("[" + GetChordNameTextPrefix(difficulty) + " " + chordName.ToStringEx().GetIfEmpty(" ") + "]");
 }