Exemplo n.º 1
0
        private static void Main()
        {
            MidiFile midiFile = MidiFile.Read("QuatuorCordes08_Opus59_Num2_Mvt3.mid");  //read for Melanchall
            TempoMap tempoMap = midiFile.GetTempoMap();


            NAudio.Midi.MidiFile myMidi = new NAudio.Midi.MidiFile("QuatuorCordes08_Opus59_Num2_Mvt3.mid"); //read for NAudio
            myMidi.Events.MidiFileType = 0;                                                                 //flatten to one track

            try
            {
                GetIntervals(ref myMidi, tempoMap);   //function to retrieve dominant in every interval
                var sW = new StreamWriter("MidiContent.txt");
                sW.Write(myMidi.ToString());
                sW.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }
Exemplo n.º 2
0
 // Token: 0x0600340C RID: 13324 RVA: 0x00017C8F File Offset: 0x00015E8F
 public static MidiFile Read(string filePath, ReadingSettings settings = null)
 {
     return(MidiFile.Read(FileUtilities.OpenFileForRead(filePath), settings));
 }