Exemplo n.º 1
0
        public OpenMptMusic(string path)
        {
            // Load file and get handle to music.
            m_moduleExt = OpenMptUtility.LoadModuleExt(path);
            if (m_moduleExt == null)
            {
                throw new System.ArgumentException("Error when loading MOD music at path: " + path);
            }
            // parse the info (number of channels etc.) from the message.
            m_info = MusicInfoParser.ParseMusicInfo(m_moduleExt);

            // Init sections.
            m_sectionVolumes = new double[m_info.GetNumberSections()];
            m_sectionVolumes.Fill(1.0);

            m_sectionMuted = new bool[m_info.GetNumberSections()];
            m_sectionMuted.Fill(false);
        }
Exemplo n.º 2
0
        public OpenMptInstrument(string path, int numberVoices)
        {
            m_moduleExt = OpenMptUtility.LoadModuleExt(path);
            if (m_moduleExt == null)
            {
                throw new System.ArgumentException("Error when loading MOD music at path: " + path);
            }

            // Looping over the whole thing.
            // There should be no New Note commands in the Module anyway.
            m_moduleExt.GetModule().SetRepeatCount(-1);

            // parse info
            m_info = MusicInfoParser.ParseInstrumentInfo(m_moduleExt);

            m_areChannelsSet = false;
            SetNumberVoices(numberVoices);

            ResetVolume();
        }