Main Site Documentation

FEZ Raptor and Tunes Module


#1

Hello,

I am having a very unstable behavior using the Tunes Module and FEZ Raptor.
I am using the testapp that you can find with the Tunes driver.
What I notice is that only sometime the test plays the sound.
Anyone have some experience with this device?

Thanks in advance


#2

Tried a different cable?

Welcome to the community.


#3

I did the test with another cable, but nothing is changed.

follow the test program i am using:

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            button.ButtonPressed += button_ButtonPressed;
            new Thread(() =>
            {
                PlayTest();
            }).Start();
        }

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            new Thread(() =>
            {
                tunes.DebugPrintEnabled = true;
                PlayTest();
            }).Start();
        }

        void PlayTest()
        {
            Tunes.MusicNote note = new Tunes.MusicNote(Tunes.Tone.C4, 400);

            tunes.AddNote(note);

            // up
            PlayNote(Tunes.Tone.C4);
            PlayNote(Tunes.Tone.D4);
            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.F4);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.A4);
            PlayNote(Tunes.Tone.B4);
            PlayNote(Tunes.Tone.C5);

            // back down
            PlayNote(Tunes.Tone.B4);
            PlayNote(Tunes.Tone.A4);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.F4);
            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.D4);
            PlayNote(Tunes.Tone.C4);

            // arpeggio
            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.C5);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.C4);

            tunes.Play();

            Thread.Sleep(100);

            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.C5);
            PlayNote(Tunes.Tone.G4);
            PlayNote(Tunes.Tone.E4);
            PlayNote(Tunes.Tone.C4);

            tunes.Play();

            Thread.Sleep(5000);

            Tunes.Melody melody = new Tunes.Melody();

            // up
            melody.Add(Tunes.Tone.C4, 200);
            melody.Add(Tunes.Tone.D4, 200);
            melody.Add(Tunes.Tone.E4, 200);
            melody.Add(Tunes.Tone.F4, 200);
            melody.Add(Tunes.Tone.G4, 200);
            melody.Add(Tunes.Tone.A4, 200);
            melody.Add(Tunes.Tone.B4, 200);
            melody.Add(Tunes.Tone.C5, 200);
            melody.Add(Tunes.Tone.B4, 200);
            melody.Add(Tunes.Tone.A4, 200);
            melody.Add(Tunes.Tone.G4, 200);
            melody.Add(Tunes.Tone.F4, 200);
            melody.Add(Tunes.Tone.E4, 200);
            melody.Add(Tunes.Tone.D4, 200);
            melody.Add(Tunes.Tone.C4, 200);
            melody.Add(Tunes.Tone.E4, 200);
            melody.Add(Tunes.Tone.G4, 200);
            melody.Add(Tunes.Tone.C5, 200);
            melody.Add(Tunes.Tone.G4, 200);
            melody.Add(Tunes.Tone.E4, 200);
            melody.Add(Tunes.Tone.C4, 200);

            tunes.Play(melody);
        }

        void PlayNote(Tunes.Tone tone)
        {
            Tunes.MusicNote note = new Tunes.MusicNote(tone, 200);

            tunes.AddNote(note);
        }

furthermore, in order to avoid some ThreadAbortException, i used a lock around playList.


#4

@ jack_it - Into what socket number do you have the Tunes module plugged?

:-[ Never mind… I realized that there is only one PWM socket, 18.


#5

@ jack_it - We are currently looking into the issue, we will report as soon as possible.


#6

@ aron - Do you need I do some other test?


#7

@ jack_it - We can reproduce the issue. It appears that the G400 PWM stops responding after it is changed a variable number of times. We do not have a fix at this time however. We will let you know when we do.


#8

@ john - I just bought the Motor Driver L298 Module, your answer means that also this module doesn’t work on FEZ Raptor?


#9

@ jack_it - It should partially work, but if you change the PWM settings enough, it will eventually stop working until you reset.


#10

@ john - Any news?


#11

@ jack_it - We believe it should be fixed for the next SDK. However, there is an issue in NETMF when you change the frequency but not the duty cycle. The way calculations are done internally, the duty cycle drifts when you change the frequency. Left alone after many changes, it will eventually become completely corrupted. As long as duty cycle is updated when frequency is updated, it will work. The Tunes module should update both.


#12

@ John - Thanks, I will wait for the update.