Netduino home hardware projects downloads community

Jump to content


Photo

And so the SoT was born...


  • Please log in to reply
10 replies to this topic

#1 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 06 April 2012 - 02:30 AM

Earlier this evening I did my usual round for new cool stuff at Sparkfun and I accidentally happened to see their so very cool blodeJazz project:

http://www.sparkfun.com/news/839

Basically, it’s an audio/visual representation of various network events and other stuff going on at Sparkfun. Anyway, this thing got me thinking that I could do something similar, however much simpler, with a Netduino.

Instead of just sitting around waiting for the PCBs for my USB Audio project to arrive, I decided to go ahead and make something with some of the parts I got laying around from various other projects now torn apart:

Attached File  nic.JPG   120.71KB   41 downloads 10$ ethernet board (enc28j60) from China

Attached File  1053.JPG   118.8KB   46 downloads vs1053b Sparkfun BOB (the old rectified version with a tiny wire on it)

Attached File  mini.JPG   115.5KB   30 downloads Good ol' mini!

I stuck the trusty Netduino mini into a breadboard, dusted of my old 10$ NIC and mashed these up with the vs1053b breakout. Thanks to the benefits of code re-use, I was able to put something together in just a few hours and I came up with this thing called the “Sound of Things” or “SoT” for short.

http://www.youtube.com/watch?v=skD6u05YQqo&context=C4c01323ADvjVQa1PpcFPx3kEZIm1eXdKhZlCV2xwBJbUOw69HJnk=

The SoT transforms network traffic on my LAN into some kind of very bad music or at least a series of very annoying sounds. It spoofs my LAN for Ethernet frames sent back and forth and converts each packet it sees into a sort of “musical” representation in the form of MIDI commands.These MIDI portions are then sent to the vs1053b for playback in Real-time mode to be heard as weird sounds Posted Image Here's a short mp3 recording of the output:


...and here's the full souce code:
Attached File  SoT.zip   18.21KB   12 downloads
A short explanation of which can be read here.

It’s getting really late here but luckily, the vs1053b has a built-in headphone driver and so I could listen to the “music” without waking up the rest of the family Posted Image In the video I had to stick the headphones to my iPhone so sound quality is lousy but in reality it’s actually quite good.

Possible next steps could be to improve visualization (eventually I'll get bored with that blinking led) with a 16x24 green led matrix that I haven’t found use for yet. Also, I could add a MIDI jack and hook it up to my wife’s digital piano which has really great sound.
Attached File  yamaha.JPG   88.04KB   14 downloads

I’m not at all familiar with computer generated music or MIDI for that matter, but if any of you guys are, maybe you could help me in writing a more decent Ethernet-2-MIDI transform? The code is really quick and dirty right now but if anyone is interested in helping with this, I could clean it up for upload.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7117 posts
  • LocationNew York, NY

Posted 06 April 2012 - 02:52 AM

I would love to see the video on this Hanzibal. Very creative :) Chris

#3 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 06 April 2012 - 03:27 AM

Thanks, got the idea from Sparkfun though so I can't really take credit for that. There's a video now, but Youtube is still processing it for rotation. It's a a lousy video, I keep babbling so that you can't really hear the "music". I'll make a better one later.

I was thinking maybe one could use this to "audiolize" all kinds of stuff, like electric consumption in your house or other weird things that could be fun to listen to. Maybe hook the headphone to line-in on a PC and use VLC to stream it onto the internet Posted Image If I get a better transformation routine it could really become music. BlodeJazz actually sounds pretty ok!

#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 07 April 2012 - 12:00 PM

For your discomfort, I made a 1.17Mb mp3 recording of the "music" generated:

Enjoy the sound of my network Posted Image

#5 Gorf

Gorf

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 07 April 2012 - 01:48 PM

...and still there's more melody than most of the stuff by Depeche Mode..

#6 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 07 April 2012 - 11:23 PM

...and still there's more melody than most of the stuff by Depeche Mode..

Very flattering but could be an insult to some people Posted Image

Anyway, I've added the complete source code now. If you want to make your own MIDI transform, either change my EthernetEventPlayer class or implement your own derivate of the EventPlayer class and change the main program to use that instead. If you like, you could post your transform here and maybe I'll make a recording of it for you.

The code is your typical asynchronous producer/consumer construct using two individual threads. One of these reads off incoming Ethernet packages from the NIC and puts them in a queue of events. The other thread eats events off the queue, transforms them into MIDI which is then played by the vs1053b.

Btw, if you are more of a shield kind of person, there are lots of MIDI stuff out there. These are only some:
http://www.sparkfun.com/products/10587
http://www.sparkfun.com/products/10628
http://www.sparkfun.com/products/9595 (a real MIDI shield)

For input you could probably use any old Ethernet shield or what have you. Why not connect a hall effect sensor to the incoming mains cable of your home and "see" what that sounds like?

#7 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 10 April 2012 - 05:59 PM

I've updated the source code and rewired h/w to free some pins in order to make room for this:
Attached File  24x16_LED.JPG   141.51KB   26 downloads 24x16 green LED matrix from China
I'm looking to use it for improved visualization. It's a bit tricky since it uses non-standard SPI bit length but should be far more interesting than just a blinking red LED Posted Image

#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1717 posts
  • LocationVenezia, Italia

Posted 13 April 2012 - 03:25 AM

I've updated the source code and rewired h/w to free some pins in order to make room for this:
Attached File  24x16_LED.JPG   141.51KB   26 downloads 24x16 green LED matrix from China
I'm looking to use it for improved visualization. It's a bit tricky since it uses non-standard SPI bit length but should be far more interesting than just a blinking red LED Posted Image


Hello Hanzy!
Did you make it working? I have one similar, by Sure Electronics as well, but I dropped sooner the attempt of interfacing directly.
Maybe there's some way to light the leds, but it will be slow. AFAIK, the only decent way is using some satellite MCU as helper.
Cheers
Biggest fault of Netduino? It runs by electricity.

#9 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 April 2012 - 07:13 AM

Did you make it working?

Hi Mario! No, I haven't gotten that far yet so there's no code for it.

Each led is addressable in a linear address space so I'm planning on using it like a framebufffer and transfer the whole series of 24x16 on/off bits in a single (or few) SPI write.

Also, I'm looking to use a synchronized double buffering scheme on the Netduino with a separate thread acting as a kind of RAMDAC responsible for refreshing the display while the "main thread" can freely draw stuff into the other buffer. The "RAMDAC" won't have a fixed refresh rate, rather it will only refresh when the main thread signals it's done.

Refreshrate will be slow...

EDIT: Here's the "datasheet" for my LED matrix:
http://www.sure-elec...1_Ver2.0_EN.pdf

The framebuffer would be 48 bytes and thanks to the so colled "successive write mode" it should be possible to transfer the whole buffer with a single 1 + 48 byte SPI write.

#10 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1717 posts
  • LocationVenezia, Italia

Posted 13 April 2012 - 11:42 AM

My board is a bit different. It's a bi-color (R+G) 32x16 matrix, also chainable. It uses the same chip of your's, but I think to have four of them (if I remember well). In my case the driving is more difficult, because the "protocol" has to keep in sync the four chips as well. They done a very smart way to do that, although it get me crazy for using the board with the Netduino. Basically, each SS pulse will switch automatically the next chip in chain. If you had several boards chained together, simply continue to SS-pulsing the SPI, and the data are routed accordingly. Very nice! At the moment I dropped this attempt, because -yes- few spare time, and mostly because a pure-managed way only will not yield a decent speed, IMHO. There are tons of pulses to create, and such a complex SPI protocol should be realized bit-banging via C#. Of sure, you won't be able to create any decent demo, game, or whatever else. Anyway, if you're trying on it, let me know. Cheers
Biggest fault of Netduino? It runs by electricity.

#11 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 17 April 2012 - 01:43 PM

Anyway, if you're trying on it, let me know.

Will do!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2010-2014 Secret Labs LLC  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.