Music Module stops if any other code runs

Hi all,

I have a problem with music module and midi files. When I debug my code line by line and just run music.Play(…), it plays well. But when I run next statement, music stops immediately.
Here is my code. I tried both Gadgeteer App and MFConsole App. Nothing changed. Mucis stops when run “bool ledState = true;” line.

Thanks a lot for your help.

I tried with Hydra and mp3 files. I works properly. But it doesn’t behave same with cerberus…

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.Gadgeteer;
using Gadgeteer;
using System.IO;
using System.Threading;
using GTM = Gadgeteer.Modules;

namespace MFConsoleApplication1
	public class Program
		public static Mainboard Mainboard { get; set; }
		static Gadgeteer.Modules.GHIElectronics.Music music;

		public static void Main()
			Mainboard = new GHIElectronics.Gadgeteer.FEZCerberus();
			music = new GTM.GHIElectronics.Music(6);


			bool ledState = true;
			while (true)
				Mainboard.SetDebugLED(ledState = !ledState);

I suggest you read and follow this tutorial GHI Electronics – Where Hardware Meets Software

your program is organized incorrectly for a gadgeteer project.