Music Box / Wavetable Synthesizer / DDS January 16, 2012, 02:18:05 pm Hi,being inspired by another project of ChaN [1] I decided to build my own music box. The theory is described in detail on ChaN's page, so I won't repeat it here. Instead of an ATtiny, mine uses a PIC32 and has therefore enough processing power to play up to 64 notes simultaneously:[attachment=5]As a case I used a pair of cheap active speakers for the very competitive price of 3.50 €. They can be seen here together with the breadboarded circuit:[attachment=4]Since I wanted to fit everything inside the speaker-case, the soldered circuit is quite minimalistic:[attachment=3][attachment=2]Here the inside of the case can be seen without and with my circuit installed:[attachment=1][attachment=0]A video of the device in action is available on YouTube: http://youtu.be/dt3rpgWyKnoPlease find the source code attached to the next post, as there seems to be a limit of 6 attachments per posting.Have fun,Markus[1] http://elm-chan.org/works/mxb/report.html Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #1 – January 16, 2012, 02:18:37 pm As promised, here is the source code. Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #2 – January 16, 2012, 03:16:31 pm 1337 soldering skills ;) Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #3 – January 16, 2012, 04:48:01 pm Amazing work as always. The source is pretty simple, it looks like most work went into the audio conversion scripts. Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #4 – January 16, 2012, 04:59:19 pm @Sjaak: Thanks. It's not close to your QFN soldering skills, but sufficient for this basic stuff :)@ian: It's always just a matter of getting the numbers right ;) Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #5 – January 16, 2012, 05:06:39 pm dedbug lives! Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #6 – January 16, 2012, 05:20:05 pm Great! How can write other tunes? Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #7 – January 16, 2012, 05:21:25 pm [quote author="Markus Gritsch"]@Sjaak: Thanks. It's not close to your QFN soldering skills, but sufficient for this basic stuff :)[/quote]Haha also thanks ;) Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #8 – January 16, 2012, 08:53:33 pm [quote author="Gianni"]Great! How can write other tunes?[/quote]By taking a look into the source code :) In the 'dds' folder you can find a script called 'midi2h.py'. Prepare a nice MIDI file (stripping the percussion track for exampe is a good idea), and use the script to generate the data which you can put into the tune header file. Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #9 – January 16, 2012, 09:32:25 pm Yes, I'm just looking at it now.. I'm new to python scripting.I've tried to run midi2h.py with the still_alive.mid tune but the numbers script gave me are very different from those in the source code. Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #10 – January 19, 2012, 08:09:35 pm I don't understand why the music on my prototype is played slower than the video... Schematic and code are the same... Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #11 – January 19, 2012, 08:25:24 pm @Markus awsome project !!! and it sounds pretty good too !:-) Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #12 – January 19, 2012, 08:33:07 pm [quote author="Gianni"]I don't understand why the music on my prototype is played slower than the video... Schematic and code are the same...[/quote]Is it only slower or also deeper? How much slower? Twice as slow? Are you using the exact same MCU? Different MCU and different config bits for generating the clock? Further: are you using the provided MPLAB X project, or have you created your own project? It must be compiled with -O1 to get 64 oscillators. What happens if you reduce to e.g. 32? Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #13 – January 19, 2012, 08:46:03 pm Twice as slow, and deeper. yes. I've created a new project using MPLAB IDE 8.80, MCU is the same.If I use "OSCILLATOR_COUNT 32" works same as yours. Last Edit: January 01, 1970, 01:00:00 am by Guest
Re: Music Box / Wavetable Synthesizer / DDS Reply #14 – January 19, 2012, 08:48:07 pm Sorry!! Doesn't work exactly the same!!I've Just put the optimization level to 1 and now works great! Last Edit: January 01, 1970, 01:00:00 am by Guest