Main Site Documentation

Can't get FEZ Music Shield working


#1

I am an experienced avionics hardware guy with a little C++ experience, but am trying to learn C# for some hobby projects and would really really HUGELY appreciate some help. Visual Studio 2010 is so far baffling to me.

When I try to use the test code for the music shield, I encounter the following errors. http://i.imgur.com/t4DqH.jpg

Here is the file in my Resources http://i.imgur.com/X551H.jpg[/IMG]

Looking at my Resources.Designer.cs, there seems to be some problems with my System reference. Since this is automatically generated, and I haven’t changed anything, I don’t know what I could have done wrong ??? http://i.imgur.com/E76LE.jpg


#2

Hmmmm… started over from scratch, and was encountering a different error. http://i.imgur.com/sXxYH.jpg

Changed the line from

byte[] data = Resources.GetBytes(Resources.BinaryResources.song);

to

byte[] data = Music.Resources.GetBytes(Music.Resources.BinaryResources.song);

And it seems to be working. Doesn’t match up with the example code though, and I’m not a huge fan of fixing a problem by accident!


#3

In the latest screenshot, you changed (or copy/pasted) the namespace to be FEZMusicShield. I’d bet that the resources file has a different namespace.

If things are in the same namespace, you don’t have to qualify where they’re from. If they’re in different namespaces, you either have to qualify references with the namespace or add a ‘using’ statement up at the top of the file to bring in stuff from a different namespace…


#4

Have a look at this
http://code.tinyclr.com/project/344/music-shield-extension-playing-streams/


#5

Ahhhh now I see how the Namespace affected it!!! I’ve got a book and I’m trying to learn the object oriented lingo, but I find I need to learn by doing or it’s in one ear and out the other.

Sweet. I had been working on some PWM controlled LED strips in a different project, and now I have that running with added music playback!

I’m sure there will be more questions, but thanks for now!


#6

I’ve been bitten by that one more than a few times in the past… :slight_smile:

Changing the namespaces is fine, as long as you remember to go back and change all the files that care about it. It’s usually a good idea to make sure things compile cleanly before changing a namespace - that’ll make it a lot easier to track down what needs to be updated.

If you go to the projects properties (right-click in the Solution Explorer -> Properties) there’s a setting for the default namespace. Changing that won’t modify your existing code but will change the namespace it uses on new, generated code.


#7

Think we need to update the wiki with note on namespace do it is easier for new users.


#8

Gus, maybe that would help… but I’m not sure.

From a new users perspective, this is what I’m seeing. I imagine a lot of people with various coding experience see what the FEZ can do, and want to start learning .net micro right away. The wikis, e books, CLR code page, all have useful information.

But when it comes to the various cool shields like the Music shield, there is no basic how to project that takes you from start to finish. I did go through the C# Level 1 and 2 parts of the ebook before trying to use the Music shield. Although I had read about namespaces, when I created a new project the way the eBook taught me, then copied in the example code from the code page, I didn’t see a difference between my project and the example project.

When I’m a little better at this maybe I can help out and make a step by step for a total new user to get a music shield running. I don’t imagine it would take very long, and I’d think it would be a pretty popular shield for first time users.


#9

Thanks for feedback. By the way this is taken to a whole new level even more than you suggested in the new gadgeteer platform. Take a look at the music module. The “arduino shield” concept is not ideal for many reasons. This is totally covered in gadgeteer.


#10

I am sure gadgeteer is a bit more accessible, but I’m sort of building art pieces I might sell… And I think ultimately the Panda II with a soldered breadboard will make for a cleaner (and cheaper!) internal assembly.


#11

Thanks again for the help gents.

I took the Streaming driver Geir linked, and added track repeat, fast forward, and rewind capability. I’m also going to work on it a bit tonight and see if I can’t get it to retain playing position through a power cycle. Shouldn’t be too hard.

If anybody is interested, when I find some time I’ll upload my work to the Code page after I clean it up a bit.


#12

I would be very interested in seeing your code. I would like to use this in a project that I will be working on in a few weeks.