Пример #1
0
        public override ChartFormat DecodeChart(FormatData data, ProgressIndicator progress)
        {
            if (!data.HasStream(this, ChartName) || !data.HasStream(this, SectionsName))
            {
                throw new FormatException();
            }

            progress.NewTask(6 + 8);

            Stream chartstream   = data.GetStream(this, ChartName);
            Stream sectionstream = data.GetStream(this, SectionsName);

            PakFormat format     = NeversoftMetadata.GetSongItemType(data.Song);
            SongData  song       = NeversoftMetadata.GetSongData(data.PlatformData, NeversoftMetadata.GetSongItem(data));
            Pak       chartpak   = new Pak(new EndianReader(chartstream, Endianness.BigEndian));     // TODO: Endianness based on format?
            FileNode  chartfile  = chartpak.Root.Find(song.ID + ".mid.qb.ngc", SearchOption.AllDirectories, true) as FileNode;
            QbFile    qbsections = new QbFile(sectionstream, format);
            QbFile    qbchart    = new QbFile(chartfile.Data, format);

            NoteChart chart = new NoteChart();

            chart.PartGuitar = new NoteChart.Guitar(chart);
            chart.PartBass   = new NoteChart.Bass(chart);
            chart.Events     = new NoteChart.EventsTrack(chart);
            chart.Venue      = new NoteChart.VenueTrack(chart);
            chart.Beat       = new NoteChart.BeatTrack(chart);

            progress.Progress();

            DecodeChartFretbars(song, qbchart, chart);

            progress.Progress();

            DecodeChartMarkers(song, qbsections, qbchart, chart);

            progress.Progress();

            for (NoteChart.TrackType track = NoteChart.TrackType.Guitar; track <= NoteChart.TrackType.Bass; track++)
            {
                for (NoteChart.Difficulty difficulty = NoteChart.Difficulty.Easy; difficulty <= NoteChart.Difficulty.Expert; difficulty++)
                {
                    DecodeChartNotes(data, song, qbchart, chart, track, difficulty, data.Song.Data.GetValue <bool>("GH3ChartCoop"));
                    progress.Progress();
                }
            }

            progress.Progress();

            DecodeChartDrums(song, qbchart, chart);

            progress.Progress();

            DecodeChartVenue(song, qbchart, chart);

            ImportMap.ImportChart(data.Song, chart);

            progress.Progress();

            data.CloseStream(chartstream);
            data.CloseStream(sectionstream);

            progress.EndTask();

            return(new ChartFormat(chart));
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.Title         = "FastGH3";
            Console.CursorVisible = false;
            Console.WindowWidth   = 41;
            Console.WindowHeight  = 19;
            Console.BufferWidth   = 41;
            Console.BufferHeight  = 19;
            parameters            = Environment.GetCommandLineArgs();
            if (args.Length == 0)
            {
                if (File.Exists(@"C:\Windows\fastgh3\CONFIGS\startupmsg"))
                {
                    if (File.ReadAllText(@"C:\Windows\fastgh3\CONFIGS\startupmsg").ToString() == "on")
                    {
                        Console.CursorVisible = false;
                        Console.WriteLine(@" 
 FastGH3 is an advanced mod of
 Guitar Hero 3 designed to be played
 as fast as possible. With this mod, you
 can play customs without any technical
 setup and even associate chart or mid
 files with the game so you can access
 your charts quickly.

 To access settings,
 use -settings in parameters.

 If you want to disable this welcome
 message, you can do so by using
 these parameters:
 -startupmsg off

 Press any key to load a chart.");
                        Console.ReadKey();
                    }
                }
                else
                {
                    Directory.CreateDirectory(@"C:\Windows\fastgh3\CONFIGS\");
                    File.WriteAllText(@"C:\Windows\fastgh3\CONFIGS\startupmsg", "on");
                }
                if (openchart.ShowDialog() == DialogResult.OK && args.Length == 0)
                {
                    Console.WriteLine("FASTGH3 by donnaken15");
                    Console.WriteLine("Checking file extension...");

                    if (!openchart.SafeFileName.Contains(".fsp") || !openchart.SafeFileName.Contains(".zip"))
                    {
                        if (openchart.SafeFileName.Contains(".chart") && !openchart.SafeFileName.Contains(".mid"))
                        {
                            Console.WriteLine("Detected chart file.");
                            currentchart = openchart.FileName;
                        }
                        else
                        {
                            Console.WriteLine("Detected midi file.");
                            Process.Start("mid2chart.exe", "-e " + openchart.FileName);
                            currentchart = openchart.FileName.Replace(openchart.SafeFileName, "") + openchart.SafeFileName.Replace(".chart", " (editable) .chart");
                        }
                        chart = File.ReadAllText(currentchart).Replace("}", "").Replace("{", "");
                        File.WriteAllText("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.chart", chart);
                        IniFile chartini = new IniFile();
                        chartini.Load("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.chart");
                        Console.WriteLine("Generating QB template.");
                        File.Delete("C:\\Windows\\fastgh3\\DATA\\SONGS\\song.qb");
                        File.Copy("C:\\Windows\\fastgh3\\DATA\\SONGS\\.qb", "C:\\Windows\\fastgh3\\DATA\\SONGS\\song.qb", true);
                        File.SetAttributes("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb", FileAttributes.Normal);
                        Console.WriteLine("Opening song pak.");
                        disallowGameStartup();
                        PakFormat pakformat = new PakFormat("C:\\Windows\\FastGH3\\DATA\\SONGS\\test_song.pak.xen", "", "", PakFormatType.PC);
                        PakEditor buildsong = new PakEditor(pakformat);
                        Console.WriteLine("Compiling chart.");
                        QbFile     songdata   = new QbFile("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb", pakformat);
                        QbItemBase array_easy = new QbItemArray(songdata);
                        array_easy.Create(QbItemType.SectionArray);
                        array_easy.ItemQbKey.Crc.Equals("BDA2A669");
                        QbItemInteger notes_easy = new QbItemInteger(songdata);
                        maxnotes = chartini.GetSection("EasySingle").Keys.Count;
                        File.WriteAllText("C:\\Windows\\FastGH3\\DATA\\SONGS\\maxarraysize", maxnotes.ToString());
                        notes_easy.Create(QbItemType.ArrayInteger);
                        notes_easy.Values[0] = 1;
                        foreach (IniSection.IniKey k in chartini.GetSection("EasySingle").Keys)
                        {
                            Console.WriteLine(k.GetValue().Replace("N ", "").EndsWith(" ") + " note @ " + k.GetName() + "");
                        }
                        Console.ReadKey();
                        songdata.AddItem(array_easy);
                        array_easy.AddItem(notes_easy);
                        songdata.AlignPointers();
                        songdata.Write("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb");
                        Console.WriteLine("Compiling pak.");
                        buildsong.ReplaceFile("6BE19E2F", "C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb");
                        Console.WriteLine("Encoding song.");
                        disallowGameStartup();
                        Console.WriteLine("Speeding up.");
                        Console.ReadKey();
                        Process gh3 = new Process();
                        gh3.StartInfo.FileName         = "C:\\Windows\\FastGH3\\gh3.exe";
                        gh3.StartInfo.WorkingDirectory = "C:\\Windows\\FastGH3\\";

                        /*gh3.Start();
                         * //*/
                    }
                    else
                    {
                        MessageBox.Show("TEST");
                    }
                }
            }
            //try
            //{
            if (parameters.Length >= 0)
            {
                if (parameters[1] == "-startupmsg" && args[2] == "off")
                {
                    File.WriteAllText(@"C:\Windows\fastgh3\CONFIGS\startupmsg", "off");
                }
                if (parameters[1] == "-startupmsg" && args[2] == "on")
                {
                    File.WriteAllText(@"C:\Windows\fastgh3\CONFIGS\startupmsg", "on");
                }
                if (parameters[1] == "-settings")
                {
                    Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;
                    //Application.Run(new settings());
                    settings options = new settings();
                    options.ShowDialog();
                }
                if (File.Exists(parameters[1]))
                {
                    Console.WriteLine("FASTGH3 by donnaken15");
                    Console.WriteLine("Checking file extension...");
                    if (Path.GetFileName(parameters[1]).Contains(".chart") && !Path.GetFileName(parameters[1]).Contains(".mid"))
                    {
                        Console.WriteLine("Detected chart file.");
                        currentchart = parameters[1];
                    }
                    else
                    {
                        Console.WriteLine("Detected midi file.");
                        Process.Start("mid2chart.exe", "-e " + parameters[1]);
                        currentchart = parameters[1].Replace(Path.GetFileName(parameters[1]), "") + Path.GetFileName(parameters[1]).Replace(".chart", " (editable) .chart");
                    }
                    Console.WriteLine("Reading chart file.");
                    chart = File.ReadAllText(currentchart).Replace("}", "").Replace("{", "");
                    File.WriteAllText("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.chart", chart);
                    if (chart.Contains("= S "))
                    {
                        Process.Start("C:\\Windows\\FastGH3\\sed.exe", "sed - i '/ = S /d' C:\\Windows\\fastgh3\\DATA\\SONGS\\song.chart");
                        Process.Start("C:\\Windows\\FastGH3\\sed.exe", "sed - i '/ = TS /d' C:\\Windows\\fastgh3\\DATA\\SONGS\\song.chart");
                    }
                    IniFile chartini = new IniFile();
                    chartini.Load("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.chart");
                    chartiniexpert = chart.After("[ExpertSingle]").Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    File.WriteAllText("C:\\Windows\\FastGH3\\PLUGINS\\CODE\\notelimit\\notelimitfix.cpp", "#include \"noteLimitFix.h\"\n#include \"core\\Patcher.h\"\n#include <stdint.h>\n\nconst uint32_t MAX_NOTES " + chartini.GetSection("ExpertSingle").Keys.Count + ";//5DA666\nconst uint32_t GH3_MAX_PLAYERS = 2;\nvoid* const SIZEOP_NOTE_ALLOCATION = (void*)0x0041AA78;\nvoid* const ADDROP_SUSTAINARRAY_1 = (void*)0x0041EE33;\nvoid * const ADDROP_SUSTAINARRAY_2 = (void*)0x00423CD4;\nvoid * const ADDROP_SUSTAINARRAY_3 = (void*)0x00423D02;\nvoid * const ADDROP_FCARRAY = (void*)0x00423D14;\nvoid * const ADDROP_NOTEOFFSETARRAY = (void*)0x00423D22;\n\n\nstatic float* fixedSustainArray = nullptr;\nstatic float* fixedFcArray = nullptr;\nstatic uint32_t* fixedOffsetArray = nullptr;\n\n\nstatic GH3P::Patcher g_patcher = GH3P::Patcher(__FILE__);\n\n\nvoid FixNoteLimit()\n{\nif(fixedSustainArray == nullptr)\nfixedSustainArray = new float[MAX_NOTES * GH3_MAX_PLAYERS];\n\n\nif(fixedFcArray == nullptr)\nfixedFcArray = new float[MAX_NOTES * GH3_MAX_PLAYERS];\n\nif(fixedOffsetArray == nullptr)\nfixedOffsetArray = new uint32_t[MAX_NOTES * GH3_MAX_PLAYERS];\n\n\ng_patcher.WriteInt32(SIZEOP_NOTE_ALLOCATION, MAX_NOTES);\n\ng_patcher.WriteInt32(ADDROP_SUSTAINARRAY_1, reinterpret_cast<uint32_t>(fixedSustainArray));\ng_patcher.WriteInt32(ADDROP_SUSTAINARRAY_2, reinterpret_cast<uint32_t>(fixedSustainArray));\ng_patcher.WriteInt32(ADDROP_SUSTAINARRAY_3, reinterpret_cast<uint32_t>(fixedSustainArray));\ng_patcher.WriteInt32(ADDROP_FCARRAY, reinterpret_cast<uint32_t>(fixedFcArray));\ng_patcher.WriteInt32(ADDROP_NOTEOFFSETARRAY, reinterpret_cast<uint32_t>(fixedOffsetArray));\n}\n\n");
                    disallowGameStartup();
                    Console.WriteLine("Generating QB template.");
                    File.Delete("C:\\Windows\\fastgh3\\DATA\\SONGS\\song.qb");
                    File.Copy("C:\\Windows\\fastgh3\\DATA\\SONGS\\.qb", "C:\\Windows\\fastgh3\\DATA\\SONGS\\song.qb", true);
                    File.SetAttributes("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb", FileAttributes.Normal);
                    disallowGameStartup();
                    Console.WriteLine("Opening song pak.");
                    PakFormat pakformat = new PakFormat("C:\\Windows\\FastGH3\\DATA\\SONGS\\song_song.pak.xen", "", "", PakFormatType.PC);
                    PakEditor buildsong = new PakEditor(pakformat, false);
                    Console.WriteLine("Compiling chart.");
                    QbFile     songdata   = new QbFile("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb", pakformat);
                    QbItemBase array_easy = new QbItemArray(songdata);
                    array_easy.Create(QbItemType.SectionArray);
                    QbItemInteger notes_expert = new QbItemInteger(songdata);
                    File.WriteAllText("C:\\Windows\\FastGH3\\DATA\\SONGS\\maxarraysize", (3 * chartiniexpert.Length).ToString());
                    notes_expert.Create(QbItemType.ArrayInteger);
                    pushinteger = 0;
                    foreach (string note in chartiniexpert)
                    {
                        uint.TryParse(note.Before(" = N"), out notes_expert.Values[pushinteger]);
                        notes_expert.Values[pushinteger] *= Convert.ToUInt32(2.8125);
                        int.TryParse(note.After(" = N ").Before(" "), out notecolor);
                        uint.TryParse(note.After(" = N ") + notecolor + " ", out notes_expert.Values[pushinteger + 1]);
                        if (notes_expert.Values[pushinteger + 1] == 0)
                        {
                            notes_expert.Values[pushinteger + 1] = 1;
                        }
                        if (notecolor == 0)
                        {
                            try
                            {
                                if (notes_expert.Values[pushinteger - 1] == 2 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 3;
                                }
                                if (notes_expert.Values[pushinteger - 1] == 4 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 5;
                                }
                                if (notes_expert.Values[pushinteger - 1] == 8 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 9;
                                }
                                if (notes_expert.Values[pushinteger - 1] == 16 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 17;
                                }
                                if (notes_expert.Values[pushinteger - 3] != notes_expert.Values[pushinteger] && notes_expert.Values[pushinteger + 3] != notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 1;
                                }
                                if (notes_expert.Values[pushinteger + 5] == 2 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 3;
                                }
                                if (notes_expert.Values[pushinteger + 5] == 4 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 5;
                                }
                                if (notes_expert.Values[pushinteger + 5] == 8 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 9;
                                }
                                if (notes_expert.Values[pushinteger + 5] == 16 && notes_expert.Values[pushinteger - 3] == notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 17;
                                }
                                if (notes_expert.Values[pushinteger + 4] != notes_expert.Values[pushinteger] && notes_expert.Values[pushinteger + 3] != notes_expert.Values[pushinteger])
                                {
                                    notes_expert.Values[pushinteger + 2] = 1;
                                }
                            }
                            catch
                            {
                            }
                        }
                        if (notecolor == 1)
                        {
                            notes_expert.Values[pushinteger + 2] = 2;
                        }
                        if (notecolor == 2)
                        {
                            notes_expert.Values[pushinteger + 2] = 4;
                        }
                        if (notecolor == 3)
                        {
                            notes_expert.Values[pushinteger + 2] = 8;
                        }
                        if (notecolor == 4)
                        {
                            notes_expert.Values[pushinteger + 2] = 16;
                        }
                        Console.WriteLine(notes_expert.Values[pushinteger] + Environment.NewLine + notes_expert.Values[pushinteger + 1] + Environment.NewLine + notes_expert.Values[pushinteger + 2]);
                        pushinteger += 3;
                    }

                    /*foreach (IniSection s in chartini.Sections)
                     * {
                     *  foreach (IniSection.IniKey k in s.Keys)
                     *  {
                     *      if (s.Name == "ExpertSingle")
                     *      {
                     *          //Console.WriteLine("note @ " + k.GetName() + " that is " + k.GetValue().Substring(5) + " milliseconds long");
                     *          notes_expert.Values[pushinteger] = Convert.ToUInt32(k.Name);
                     *          notes_expert.Values[pushinteger + 1] = Convert.ToUInt32(k.Value.Substring(5)) + 1;
                     *          notes_expert.Values[pushinteger + 2] = 1;
                     *          pushinteger += 3;
                     *      }
                     *  }
                     * }*/
                    //Console.WriteLine(chartini.GetSection("ExpertSingle").Keys.Count+" notes in expert chart.");
                    Console.ReadKey();
                    songdata.AddItem(array_easy);
                    array_easy.AddItem(notes_expert);
                    songdata.AlignPointers();
                    songdata.Write("C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb");
                    Console.WriteLine("Compiling pak.");
                    buildsong.ReplaceFile("6BE19E2F", "C:\\Windows\\FastGH3\\DATA\\SONGS\\song.qb");
                    Console.WriteLine("Encoding song.");
                    disallowGameStartup();
                    Console.WriteLine("Speeding up.");
                    Process dxwnd = new Process();
                    dxwnd.StartInfo.FileName         = "C:\\Windows\\FastGH3\\WINDOWED\\dxwnd.exe";
                    dxwnd.StartInfo.WorkingDirectory = "C:\\Windows\\FastGH3\\WINDOWED\\";
                    dxwnd.StartInfo.WindowStyle      = ProcessWindowStyle.Minimized;
                    dxwnd.Start();
                    Process gh3 = new Process();
                    gh3.StartInfo.FileName         = "C:\\Windows\\FastGH3\\gh3.exe";
                    gh3.StartInfo.WorkingDirectory = "C:\\Windows\\FastGH3\\";

                    /*dxwnd.Start();
                     * gh3.Start();
                     * //*/
                }
            }

            GC.Collect();
        }
Пример #3
0
        public ChartFormat DecodeChart(FormatData data, ProgressIndicator progress, params Stream[] chartstreams)
        {
            progress.NewTask(5 + 12);

            PakFormat format = NeversoftMetadata.GetSongItemType(data.Song);
            SongData  song   = NeversoftMetadata.GetSongData(data.PlatformData, NeversoftMetadata.GetSongItem(data));

            List <Pak> chartpaks = new List <Pak>();

            foreach (Stream stream in chartstreams)
            {
                chartpaks.Add(new Pak(new EndianReader(stream, Endianness.BigEndian)));                 // TODO: Endianness based on format?
            }

            FileNode chartfile = null;

            foreach (Pak pak in chartpaks)
            {
                chartfile = pak.FindFile(song.ID + ".mid.qb.ngc") ?? chartfile;
                chartfile = pak.FindFile(song.ID + ".mid.qb") ?? chartfile;
            }
            if (chartfile == null)
            {
                foreach (Pak pak in chartpaks)
                {
                    chartfile = chartfile ?? pak.FindFileType(0xa7f505c4);
                }
            }
            QbFile qbchart = null;

            if (chartfile != null)
            {
                qbchart = new QbFile(chartfile.Data, format);
            }

            StringList strings = new StringList();

            foreach (Pak pak in chartpaks)
            {
                foreach (Pak.Node n in pak.Nodes)
                {
                    if (!n.Filename.HasValue())
                    {
                        strings.ParseFromStream(n.Data);
                    }
                }
            }

            QbFile   qbsections    = null;
            FileNode qbsectionfile = null;

            foreach (Pak pak in chartpaks)
            {
                qbsectionfile = pak.FindFile(song.ID + ".mid_text.qb.ngc") as FileNode ?? qbsectionfile;
                qbsectionfile = pak.FindFile(song.ID + ".mid_text.qb") as FileNode ?? qbsectionfile;
            }
            if (qbsectionfile != null)
            {
                qbsections = new QbFile(qbsectionfile.Data, format);
            }

            Notes    notes     = null;
            FileNode notesfile = null;

            foreach (Pak pak in chartpaks)
            {
                notesfile = notesfile ?? pak.FindFileType(0xa9d5bc8f);
                notesfile = pak.FindFile(song.ID + ".note.ngc") as FileNode ?? notesfile;
                notesfile = pak.FindFile(song.ID + ".note") as FileNode ?? notesfile;
            }
            if (notesfile == null)
            {
                foreach (Pak pak in chartpaks)
                {
                    notesfile = pak.FindFileType(0xa9d5bc8f) ?? notesfile;
                }
            }
            if (notesfile != null)
            {
                notesfile.Data.Position = 0;
                notes = Notes.Create(new EndianReader(notesfile.Data, Endianness.BigEndian));
            }

            NoteChart chart = new NoteChart();

            chart.PartGuitar = new NoteChart.Guitar(chart);
            chart.PartBass   = new NoteChart.Bass(chart);
            chart.PartDrums  = new NoteChart.Drums(chart);
            chart.PartVocals = new NoteChart.Vocals(chart);
            chart.Events     = new NoteChart.EventsTrack(chart);
            chart.Venue      = new NoteChart.VenueTrack(chart);
            chart.Beat       = new NoteChart.BeatTrack(chart);

            bool   gh4v2      = NeversoftMetadata.IsGuitarHero4(data.PlatformData.Game) && data.PlatformData.Game != Game.GuitarHeroWorldTour;
            string drumconfig = gh4v2 ? "drums3" : "drums2";

            chart.PartDrums.Mixing.Add(new Pair <NoteChart.Point, Pair <NoteChart.Difficulty, string> >(new NoteChart.Point(0), new Pair <NoteChart.Difficulty, string>(NoteChart.Difficulty.Easy, drumconfig + "easy")));
            chart.PartDrums.Mixing.Add(new Pair <NoteChart.Point, Pair <NoteChart.Difficulty, string> >(new NoteChart.Point(0), new Pair <NoteChart.Difficulty, string>(NoteChart.Difficulty.Medium, drumconfig)));
            chart.PartDrums.Mixing.Add(new Pair <NoteChart.Point, Pair <NoteChart.Difficulty, string> >(new NoteChart.Point(0), new Pair <NoteChart.Difficulty, string>(NoteChart.Difficulty.Hard, drumconfig)));
            chart.PartDrums.Mixing.Add(new Pair <NoteChart.Point, Pair <NoteChart.Difficulty, string> >(new NoteChart.Point(0), new Pair <NoteChart.Difficulty, string>(NoteChart.Difficulty.Expert, drumconfig)));

            progress.Progress();

            DecodeChartFretbars(song, qbchart, notes, chart);

            progress.Progress();

            DecodeChartSections(song, qbchart, strings, qbsections, notes, chart);

            progress.Progress();

            for (NoteChart.TrackType track = NoteChart.TrackType.Guitar; track <= NoteChart.TrackType.Drums;)
            {
                for (NoteChart.Difficulty difficulty = NoteChart.Difficulty.Easy; difficulty <= NoteChart.Difficulty.Expert; difficulty++)
                {
                    DecodeChartNotes(song, qbchart, notes, chart, track, difficulty);
                    progress.Progress();
                }
                switch (track)
                {
                case NoteChart.TrackType.Guitar: track = NoteChart.TrackType.Bass; break;

                case NoteChart.TrackType.Bass: track = NoteChart.TrackType.Drums; break;

                case NoteChart.TrackType.Drums: track = NoteChart.TrackType.Events; break;
                }
            }

            // Automatic Drum Fills - 1-measure fills every 4 measures, if there's no overdrive overlap
            FillSections(chart, 1, 4, 3, chart.PartDrums.DrumFills, chart.PartDrums.Overdrive);

            progress.Progress();

            if (DecodeChartVocals(song, qbchart, strings, notes, chart))
            {
                DecodeChartVocalPhrases(song, qbchart, notes, chart);
            }

            ImportMap.ImportChart(data.Song, chart);

            progress.Progress();

            progress.EndTask();

            return(new ChartFormat(chart));
        }