Shop OBEX P1 Docs P2 Docs Learn Events
Need a bit of a point in the right direction for a project, that plays music. — Parallax Forums

Need a bit of a point in the right direction for a project, that plays music.

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-02-17 04:32 in Propeller 1
Ok so I just gave my girlfriend the usual valentines day stuff yesterday. Although belated I wanted to do something hand made and from the heart.

My mom is like a master at crocheting, she makes animal hats, stuffed animals, robots, jackets etc. She is really good at it, people actually request things and pay her for them all the time, especially those cutsie baby hats with ears and stuff.

So I had an idea and approached her for help, I want to make my girlfriend an alarm clock that has two screens, one for the time and another that displays custom scrolling messages. The displays will all be 7 segment type displays, driven with TI TLC5940 16 channel constant current PWM chips. The actual case for the clock is going to be a crocheted heart, basically im going to have my mom make to flat heart pieces, one with slits around the edge the other with buttons. This way the whole thing can be easily unbuttoned and stuffed for future repairs, code updates hardware add ons etc.

Now bedsides some of the custom crochet work going on what will make this clock stand out is the way it wakes you up. I want it to play songs in a midi/digitized manner. the original idea came from the Bs2 WAM book where a piezo is used to make songs. Now I figured if I made music this way I could have just saved a valuable propeller chip and used an Arduino. But I really started thinking about it and I want it to be a little nicer than that.

I need to get this done fairly quickly so I dont want to spend a whole lot of time learning how to write sound type code, I was hopping there was an easy library I could use. I went and got sidcog but that is a bit complicated I dont really follow it at all, not only that but with speakers over piezo comes the need for an amplifier. The only amp I have ever built was a CMOY headphone amp, which is a basic raw opamp circuit, but something like that need a - and positive voltage rail. I was thinking maybe some 2n222's would be loud enough for an alarm I dont know.

I guess what im asking is what is the fastest simplest way I can transcribe a modern song to be played in a more nintendoey music style, and if it requires a speaker, what is the simplest way to amplify it. I know there are probably tons of schematics for amps online but I just need to know whatever I build doesnt need a -vcc rail, has as much volume as a standard alarm clock, and will play the music without distortion.

I also had and idea to amplify piezos with a transistor, pretty simple. Maybe connect 2 or three off them to a prop and play the music that way, it would allow me to at least have a few more channels of sound....

simple, simple, simple, is the key here. If there is a library where I just feed it an array of notes and timings without doing anything else, and it sounds goo, that my man! I looked at jeffs sidplayer project thinking since it can load songs off SD it would be perfect, but then when I looked in to how to get a song in to SID format, this is where things got harry, and nothing I want this clock to play is in SID format, I cant even find midi files of some of the songs.

Comments

  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-02-15 19:22
    Hmmmm another thought, I have a musician friend with a pretty decent home studio 1000s of bucks in software, I know this guy loves writing songs using software, so im gussing he could make midi files for me. I dont know much about what midi is besides a data port and a format. I looked in obex and did not see anything for playing midi files, has this been done.

    Im sorry if this is a stupid question, im super illiterate when it comes to digitized/synth type music stuff and how it all works
  • RaymanRayman Posts: 14,665
    edited 2013-02-16 04:42
    I made (or really ported) a simple midi player a while ago:
    http://www.rayslogic.com/propeller/programming/WavetableMidi/WavetableMidi.htm

    But, others have made better ones since that...
  • Ahle2Ahle2 Posts: 1,179
    edited 2013-02-17 04:32
    "I guess what im asking is what is the fastest simplest way I can transcribe a modern song to be played in a more nintendoey music style"

    To create you own music and playback on the Prop. The easiest way is to create midi music in an editor of your choice on the PC and then play it back on the Prop using any of the "midi players" written for the Propeller over the years. I know that Ariba, Rayman and Michael Park has made midi players. I think there is a tool to convert midi music to HSS as well.
    Out of these, HSS is the only one that can give you nintendoey sounds.

    To play back "pre-made" music on the Prop, the easiest way is using a SD-card and playback any of the following file types, ".wav", ".mid", ".dmp", ".hss". ".dmp" is the easiest, taking only 4 rows of code for the main loop.
    Out of these ".wav", ".hss" and ".dmp" are capable of giving nintendoey sounds.

    There are other options, but they are either not easy to use or not finished yet.
Sign In or Register to comment.