Example #1
0
        public void PatternToConsole()
        {
            int    offset  = 0;
            int    channel = 0;
            byte   row     = 0;
            XMNote xmnote  = new XMNote();

            while (offset < PatternData.Length)
            {
                xmnote.TryParseNextNoteFrom(ref offset, PatternData);
                if (channel == 0)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.Write(row.ToString("D2"));
                    Console.ResetColor();
                    Console.Write("|");
                }
                xmnote.ToConsole();
                channel++;
                if (channel == xmheader.NumberOfChannels)
                {
                    channel = 0;
                    row++;
                    Console.WriteLine();
                }
            }
        }
Example #2
0
        private void PatternToArray()
        {
            patarr = new XMNote[NumberOfRows, xmheader.NumberOfChannels];
            int  offset  = 0;
            int  channel = 0;
            byte row     = 0;


            while (offset < PatternData.Length)
            {
                XMNote xmnote = new XMNote();
                PatArr[row, channel] = xmnote;
                xmnote.TryParseNextNoteFrom(ref offset, PatternData);
                channel++;
                if (channel == xmheader.NumberOfChannels)
                {
                    channel = 0;
                    row++;
                }
            }
        }