Musical PIC MCU code - Chiptune on a PIC - any resources? - Page 1
Forum section: electronics / general

author: glossywhite
author_rank: Regular Contributor
timestamp: January 30, 2011, 08:14:21 pm
content: Hi guys. I've long been a fan of "chiptunes" - the 8-bit tracker music often found in retro games (Mario, SNES, gameboy) and often released in "the SCENE" - surely someone will know what I mean, without my having to post exact information, which could be construed as condoning "warez" etc, as these tunes are often incorporated into software that bypasses software licences.Some guys on YouTube have had success getting PIC MCUs to generate 8(?) bit music - does anyone have an idea where there is any source to do so? I have attached one of my favourite "chiptune" music files - "Bright Eyes" by Radix (You need MODplug Tracker/VLC to play this). If you smart chaps have any ideas how I'd make my PICs sing in this way, please do tell.Thank you

author: Zero999
author_rank: Super Contributor
timestamp: January 30, 2011, 09:34:20 pm
content: Here's one over on instructables.http://www.instructables.com/id/Musical-Greeting-Card/Attached are the files you need to be a member to have. I hate instructables, they're often poor quality (this is an exception), to get essential pieces of information (schematic and source code) you need to sign up and they're constantly begging you to pay. I think it's disgusting they make so much money off people who submit their projects for free.

author: adam1213
author_rank: Regular Contributor
timestamp: January 30, 2011, 11:18:43 pm
content: Generate Ring Tones on your PIC16F87x Microcontroller -http://www.beyondlogic.org/pic/ringtones.htm

author: glossywhite
author_rank: Regular Contributor
timestamp: January 30, 2011, 11:36:22 pm
content: I've visited both the links, and although I am very grateful it isn'tquitewhat I am looking for. Chiptunes are 8 bit, with samples etc etc - you can see what I mean, here:

author: dimlow
author_rank: Frequent Contributor
timestamp: January 31, 2011, 12:13:17 am
content: Just the other day I was thinking about doing this for fun. Was going to use a pic, r2r ladder for the DAC, and couple of op amps, was going to code it from scratch. But I was also thinking of useing the same hardware as a low freq function generator.The Hardware is not the big deal here most of the work will be the software.After about 30 mins of research I got bored.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 31, 2011, 12:18:40 am
content: Quote from: dimlow on January 31, 2011, 12:13:17 amThat't the spirit! Give up before you've even started

author: dimlow
author_rank: Frequent Contributor
timestamp: January 31, 2011, 12:21:26 am
content: No, no, you got it wrong there. After 30 mins my super fast intellect had mentally completed the project and i was done with it. Time to move on to the next one.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 31, 2011, 12:27:52 am
content: Quote from: dimlow on January 31, 2011, 12:21:26 amAre you kidding me? You built inin your mind, but not physically, ergo you didn't build it. I could "theoretically" build ANYTHING in my MIND, but where's the fun? You can't show it off to someone in your mind... Build it, or don't tell me about it

author: dimlow
author_rank: Frequent Contributor
timestamp: January 31, 2011, 01:17:18 am
content: If you interested in doing it yourself here is a great resource for mod files format and how to play themhttp://www.dcee.net/Files/Programm/Sound/

author: glossywhite
author_rank: Regular Contributor
timestamp: January 31, 2011, 01:42:41 am
content: Quote from: dimlow on January 31, 2011, 01:17:18 amThank you very much

author: johnmx
author_rank: Frequent Contributor
timestamp: January 31, 2011, 08:00:36 pm
content: Interesting topic.Annotated in my ‘to do’ list.

author: Murphy
author_rank: Regular Contributor
timestamp: February 01, 2011, 02:39:30 am
content: Somebody made a tool for this in an old thread, for simple tunes at least.https://www.eevblog.com/forum/index.php?topic=93.15

author: dimlow
author_rank: Frequent Contributor
timestamp: February 02, 2011, 08:48:43 am
content: Quote from: glossywhite on January 31, 2011, 12:27:52 amOk, I will build it!But its not going to be done fast. Im going to start slow, a simple sample player first, then the multichannel sample player / mixer. Then add some external memory to the pic and start working on the MOD player code. I got my schematics done and im halfway through the breadboarding. I have sorted the timer interrupts for the sample player, now working on the ISR, and ISR control routines.But im undecided on weather to use R2R ladder or PWM for the audio out, also not sure if i can pull off Stereo on the PIC. But testing has commenced on a 18f4550. Oh and i just discovered i can over clock this pic to 96 Mhz. I made an error setting up the PLL and found my code running to fast!How far have you got ?

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 02, 2011, 03:47:48 pm
content: Quote from: dimlow on February 02, 2011, 08:48:43 amdont ask him... ask me. plsss.

author: dimlow
author_rank: Frequent Contributor
timestamp: February 02, 2011, 08:54:10 pm
content: How far have you got then?

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 03, 2011, 04:00:09 am
content: nothing! i dont even have it built in my mind yet! i only know how to talk out of my arse!

author: dimlow
author_rank: Frequent Contributor
timestamp: February 03, 2011, 04:01:54 am
content: Well, im now playing sine waves from samples

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 03, 2011, 04:04:54 am
content: well, that, i know how it sounds in my mind though. i will prefer 10-20Hz sine sound.

author: dimlow
author_rank: Frequent Contributor
timestamp: February 03, 2011, 04:07:41 am
content: Well its sounds like this right now

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 03, 2011, 04:14:08 am
content: ok nice! now u got something working. let wait whats the OP got.edit: but wait. this is how its looks like in my editing software. its like 50-70Hz. no wonder i keep thinking for a sec, "it should be lower pitch than that". well anyway, dont bother.

author: dimlow
author_rank: Frequent Contributor
timestamp: February 09, 2011, 02:20:06 pm
content: Update!A Work In progress Pic

author: dimlow
author_rank: Frequent Contributor
timestamp: February 24, 2011, 03:03:12 am
content: Bread Boarding now, It seems to have got a bit crazy, i was only testing out the extra ram for the pic chip.

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 24, 2011, 04:28:31 am
content: i intended to make a long story... but just... nice! you are really serious into this.

author: dimlow
author_rank: Frequent Contributor
timestamp: March 06, 2011, 06:11:32 am
content: Im going from bread board to PCB now. PCB and Schematic 90% done. Software , well proof of concept done, hardware drivers 90%,overall implementation 10%. Ram used in PIC 95%, Program Memory 40%.Will be using Micro SD Card FAT 32, and 256k external SRAM,with some sort of LCD and 4 push buttons. SRAM is expandable to 1MB but mods are in the range of 50k - 200k so 256K should be enough.Still loads of work to do.Oh and Yes, they are TSOP 32 ram chips, not soldered anything like that before, but got hold of a bunch of these for next to nothing. Should be a challenge.@glossywhite how far have you got? oh right your selling you PIC programmers, so i guess you've not started yet

author: Mechatrommer
author_rank: Super Contributor
timestamp: March 06, 2011, 09:57:09 am
content: Quote from: dimlow on March 06, 2011, 06:11:32 amsame here. but i'll keep my pickit2 for later.

author: glossywhite
author_rank: Regular Contributor
timestamp: March 06, 2011, 08:10:24 pm
content: Quote from: dimlow on March 06, 2011, 06:11:32 amSmug, much?I don't recall having ever stated I was GOING to do what you're doing - I inquired as to how it was possible.

author: Mechatrommer
author_rank: Super Contributor
timestamp: March 07, 2011, 12:49:37 pm
content: my dream was to be a net social analystQuote from: glossywhite on January 31, 2011, 12:18:40 amQuote from: glossywhite on January 31, 2011, 12:27:52 am

author: glossywhite
author_rank: Regular Contributor
timestamp: March 07, 2011, 08:08:24 pm
content: Quote from: Mechatrommer on March 07, 2011, 12:49:37 pmYour second dream may have been to be a comedian... but you're not funny.

author: Simon
author_rank: Unknown
timestamp: March 08, 2011, 12:54:10 pm
content: Quote from: glossywhite on March 07, 2011, 08:08:24 pmbest we not hear about what your dream was/is we might loose the will to live