Can I make midi music with a PIC16F873a


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1

    Exclamation Can I make midi music with a PIC16F873a

    Hi Everyone,

    I'm new here. I'm looking for a way to make music with my PIC16F873a. And I don't mean the beep beep sound, but real midisound. I have a casio synthesiser and I would like to copy a short tune into my pic, to play it over and over again. I know that I need PWM to make a "natural" sound, and I looked at some schematics for use with a little loudspeaker.

    Along with the music some lights have to flash, but that part works allready.

    Is there anyone who knows how this works? I would love to hear from you.

    Thanks,
    Mathy

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mathy Knaapen View Post
    Hi Everyone,
    I'm new here. I'm looking for a way to make music with my PIC16F873a. And I don't mean the beep beep sound, but real midisound. I have a casio synthesiser and I would like to copy a short tune into my pic, to play it over and over again. I know that I need PWM to make a "natural" sound, and I looked at some schematics for use with a little loudspeaker.
    Along with the music some lights have to flash, but that part works allready.
    Is there anyone who knows how this works? I would love to hear from you.
    Thanks,
    Mathy
    A) double posting isn't going to get you anywhere any faster

    B) A PIC isn't made for making music. The SOUND command in PBP works, not very well, but it works. Run this thru a decent filter on the output, and you might have something. I'd think your best bet is a melody generator IC. The first few links aren't too bad, kinda rudimentary, but they might work...
    http://www.google.com/search?num=100...y+generator+IC
    Show us some code. I'm sure we can help.
    Last edited by skimask; - 17th May 2007 at 20:53.

  3. #3


    Did you find this post helpful? Yes | No

    Default I don't have code yet

    Hi skymask,

    I'm quite new in this PIC an BASIC world. I can put some LEDs on now and that took a week for me to program. I have to learn a lot, I know....

    The sound command generates the BEEP BEEP sound on one sertain frequency. Midi is playing more notes at the same time.

    I searched a melody generator on the web. But in Holland there's no reseller for less than 1000 IC's!!! So I tought that PBP and a PCI could do the job. I want to play Brahms Lullaby for 5 minutes and fade out the music.

    And about the double posting, there are more forums. I was looking for my first posting, but could not find it back..... Yep, I know....

    There must be a way to play music with a PIC. It's just a matter of programming, right?


    Mathy

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mathy Knaapen View Post
    There must be a way to play music with a PIC. It's just a matter of programming, right?
    Mathy
    MIDI programming with a PIC, sure...
    MIDI-like generation with a PIC only, without an external MIDI-source?
    Not without a good, relatively high speed A/D converter, and enough memory in the PIC, or attached to it, to send out to the A/D converter at a decent sampling rate to sound like decent music.
    The key here is being able to transfer in/out of the external memory and shoot the data out to the A/D converter.

    My advice...
    Break it down to the lowest level you can possibly break it down to. Sure, you can light some LEDs, can you do any PWM with them? Can you create a variable duty cycle, variable frequency output on a pin? Can you make and use an interrupt driven program (something you'll need to send out audio at a specific sample rate).

    Yes, (and this is the way I'd do it) you can record MP3 data to a file on a flash card and funnel that data thru a PIC out to a STA013 or VS1001k. But, I get the feeling that accessing flash cards and I2C control of a STA013 is a bit above your knowledge at the moment.

    And there aren't any Melody Generator's here in North Dakota either, but I can sure get them from here:
    http://www.maplin.co.uk/Search.aspx?...source=15&SD=Y
    and that's across 2,500 miles of land and Xx,xxx miles of ocean.
    Last edited by skimask; - 17th May 2007 at 21:30.

  5. #5


    Did you find this post helpful? Yes | No

    Angry

    I'll gues I'll have to buy 1000 melody generators.......

    Mathy

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mathy Knaapen View Post
    I'll gues I'll have to buy 1000 melody generators.......

    Mathy
    Or you could do as suggested...learn PBP, learn the PIC, learn a bit of electronics, sprinkle in some other components, and eventually have exactly what you want, built by YOU, with YOUR name on it.
    Nothing better than that...

  7. #7
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Mathy Knaapen View Post
    I'll gues I'll have to buy 1000 melody generators.......

    Mathy

    Gotta take it one step at a time. I suggest "beep beep"ing for a little bit. Then use FREQOUT command which CAN use multiple frequencies.

    There are lots of ways of doing it, and not all of them are tooo complicated, and some of them wont cost you anything but time.

    Experiment with FREQOUT. When I have time maybe I can give you a starting point. But for now, I have got to go to work ^^

Similar Threads

  1. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  2. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  3. Replies: 3
    Last Post: - 10th April 2008, 10:02
  4. How come they make electronics hard as poss
    By George in forum Off Topic
    Replies: 9
    Last Post: - 13th July 2007, 23:54
  5. Play Music (MP3, WAV,...) for greeting card
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th January 2007, 15:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts