Author Topic: Musical PIC MCU code - Chiptune on a PIC - any resources?  (Read 14096 times)

0 Members and 1 Guest are viewing this topic.

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Musical PIC MCU code - Chiptune on a PIC - any resources?
« on: January 30, 2011, 08:14:21 pm »
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 :)
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19649
  • Country: gb
  • 0999
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #1 on: January 30, 2011, 09:34:20 pm »
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.
 

Offline adam1213

  • Regular Contributor
  • *
  • Posts: 120
  • Country: au
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #2 on: January 30, 2011, 11:18:43 pm »
Generate Ring Tones on your PIC16F87x Microcontroller - http://www.beyondlogic.org/pic/ringtones.htm
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #3 on: January 30, 2011, 11:36:22 pm »
I've visited both the links, and although I am very grateful it isn't quite what I am looking for. Chiptunes are 8 bit, with samples etc etc - you can see what I mean, here:



« Last Edit: January 30, 2011, 11:38:35 pm by glossywhite »
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #4 on: January 31, 2011, 12:13:17 am »
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.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #5 on: January 31, 2011, 12:18:40 am »
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.

That't the spirit! Give up before you've even started :P
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #6 on: January 31, 2011, 12:21:26 am »
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.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #7 on: January 31, 2011, 12:27:52 am »
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.

Are you kidding me? You built in in 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 :)
« Last Edit: January 31, 2011, 12:38:34 am by glossywhite »
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #8 on: January 31, 2011, 01:17:18 am »
If you interested in doing it yourself here is a great resource for mod files format and how to play them http://www.dcee.net/Files/Programm/Sound/
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #9 on: January 31, 2011, 01:42:41 am »
If you interested in doing it yourself here is a great resource for mod files format and how to play them http://www.dcee.net/Files/Programm/Sound/

Thank you very much :)
 

Offline johnmx

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: pt
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #10 on: January 31, 2011, 08:00:36 pm »
Interesting topic.
Annotated in my ‘to do’ list.
Best regards,
johnmx
 

Offline Murphy

  • Regular Contributor
  • *
  • Posts: 54
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #11 on: February 01, 2011, 02:39:30 am »
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
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #12 on: February 02, 2011, 08:48:43 am »
Are you kidding me? You built in in 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 :)

Ok, 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 ?
« Last Edit: February 02, 2011, 08:57:25 am by dimlow »
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #13 on: February 02, 2011, 03:47:48 pm »
How far have you got ?
dont ask him... ask me. plsss.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #14 on: February 02, 2011, 08:54:10 pm »
How far have you got then?
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #15 on: February 03, 2011, 04:00:09 am »
nothing! i dont even have it built in my mind yet! i only know how to talk out of my arse! ;D ;)
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #16 on: February 03, 2011, 04:01:54 am »
Well, im now playing sine waves from samples
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #17 on: February 03, 2011, 04:04:54 am »
well, that, i know how it sounds in my mind though. i will prefer 10-20Hz sine sound.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #18 on: February 03, 2011, 04:07:41 am »
Well its sounds like this right now
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #19 on: February 03, 2011, 04:14:08 am »
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.
« Last Edit: February 03, 2011, 04:21:20 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #20 on: February 09, 2011, 02:20:06 pm »
Update!
A Work In progress Pic

 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #21 on: February 24, 2011, 03:03:12 am »
Bread Boarding now, It seems to have got a bit crazy, i was only testing out the extra ram for the pic chip.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #22 on: February 24, 2011, 04:28:31 am »
i intended to make a long story... but just... nice! you are really serious into this.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #23 on: March 06, 2011, 06:11:32 am »
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
« Last Edit: March 06, 2011, 06:27:11 am by dimlow »
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11700
  • Country: my
  • reassessing directives...
Re: Musical PIC MCU code - Chiptune on a PIC - any resources?
« Reply #24 on: March 06, 2011, 09:57:09 am »
so i guess you've not started yet
same here ;D. but i'll keep my pickit2 for later.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf