Пример #1
0
        public void CanCompressWithLimit(string name)
        {
            var c     = new MidiReader(name);
            var tones = c.GetTones().ToArray();

            Compress(tones, false, true, false, 256);
        }
Пример #2
0
        private void ReadMidiFile(string name, string number)
        {
            Console.WriteLine($"preparing {name}");
            var reader     = new MidiReader(name);
            var tones      = reader.GetTones().ToArray();
            var compressor = new ToneCompressor(tones, 253);

            tones = compressor.Compress();
            tones = tones
                    .Concat(new[]
            {
                new MediaToneMessage.Tone(34, 34, 34, 34, 0, 0, 0, 0, UInt16.MaxValue, 0, 0,
                                          (ushort)(tones.Length + 1)),
                new MediaToneMessage.Tone(34, 34, 34, 34, 0, 0, 0, 0, UInt16.MaxValue, 0, 0, (ushort)tones.Length)
            })
                    .ToArray();
            _audio.Add((number, tones));
        }