Software Contribution to EEVBlog - Page 1
Forum section: electronics / projects

author: Veramacor
author_rank: Regular Contributor
timestamp: November 24, 2009, 05:30:28 pm
content: Since Dave's latest Video was all about pic micros, I though I'd share with everyone a utility I wrote for the pic.I'd like to keep it simple, but I am looking for good suggestions to improve it. I've been experimenting with pic micros myself recently, And I had a desire to program songs or melodies into the pic and drive a tiny radioshack speaker.I couldn't find anything on the internet directly, so I came up with a utility that allows you to compose your song or melody, and convert those notes and durations into syntax compilers can understand.This utility has a quick keyboard that allows you to directly input the notes, and when your done composing, just click 'Generate Syntax' and your off! I tried to make the notes entry as painless as possible. You are limited to one sound channel currently and probably want to keep it one channel for simplicity.I'm thinking of a midi import routine next.If anyone would be kind enough to donate sound generation syntax for their favorite compiler, I would be more than happy to include in the next release. Particularly a good 'C' routine as that is not my first language. All variants are welcome as it will make it easy for everyone.I dubbed it 'Picano' (Piano + Pic) Dave can make fun of me even more than the 'Arduino' brand, I'm ready for itSoftware is FREE and you can make it better by checking it out and "Takin it Apaaaaaaght!"Here is the link:http://acstech.serveftp.com/PicanoSetup.exeOh yea, I included a sample file created using picano called "Waltzing Matilda" lol. Its a real hacked (bad) version so dont expect too much. Share your own creations back to EEVBlog.

author: armandas
author_rank: Frequent Contributor
timestamp: November 24, 2009, 10:35:27 pm
content: How are people supposed to make it better, if you don't provide the source code? By saying "take it apart" you don't actually mean "reverse engineer", do you?

author: Veramacor
author_rank: Regular Contributor
timestamp: November 25, 2009, 01:05:52 am
content: Be glad to provide the source!Its a VB6 project - not the latest .net or C, but I've recently heard the saying, "The best language is the one you learned".Have fun.

author: Simon
author_rank: Unknown
timestamp: November 30, 2009, 09:22:40 pm
content: this is a great idea, can you include the mikroe basic sytax as well ?

author: adam1213
author_rank: Regular Contributor
timestamp: January 02, 2010, 05:38:29 am
content: Have a look athttp://www.beyondlogic.org/pic/ringtones.htmI tried to run your program but was put off by having an installer and requiring a restart.

author: Simon
author_rank: Unknown
timestamp: January 04, 2010, 12:52:51 pm
content: whats wrong with having an installer ? its a neat program, all you have is a written assembly program, this IS a computer program that will generate the code for several languages, a great help to beginners and fast development

author: jahonen
author_rank: Super Contributor
timestamp: January 08, 2010, 07:03:38 pm
content: I posted this as comment to Dave's "Useful Resistor Calculation Tool" post on the main page. I'll post it here too in case all people don't read all the comments.Here is another resistor calculator (optimizer) for Windows I wrote, and has become quite standard tool at my work for choosing the optimal regulator feedback resistors, opamp feedback resistors or something similar.http://koti.mbnet.fi/jahonen/Electronics/ResOptimizer/It doesn’t have series optimization (I might add it in the future), but it has some nice other features, like parallel resistor combinations with divider (of course the search space grows easily too large to complete the search in reasonable time), possibility to create custom resistor series (resistor series are loaded from text files, so you can tweak them if necessary), and disabling of some not-wanted values. Or you can make list of the resistors you have to try to build the divider from using only those ones.Sorry if I hijacked this thread, but the title seemed somewhat generic.Regards,Janne

author: Brett
author_rank: Contributor
timestamp: January 26, 2010, 06:36:26 am
content: Valentine's Day musical card, here I come!

author: Veramacor
author_rank: Regular Contributor
timestamp: February 02, 2010, 01:40:41 pm
content: Quote from: Simon on November 30, 2009, 09:22:40 pmSimon,The mikroe MikroBasic syntax looks exactly the same as the MikroBasic syntax. Just take out the ';' characters at the end of each line and test. Not 100% sure the mikroe C syntax will work as I do not have the compiler, just looking at the reference manual. I'll make the change if it does work on your endV

author: Murphy
author_rank: Regular Contributor
timestamp: February 02, 2010, 05:12:08 pm
content: Hey that's kinda cool. I'll have to figure out how to make sounds in ASM.

author: Simon
author_rank: Unknown
timestamp: February 02, 2010, 05:55:48 pm
content: Quote from: Veramacor on February 02, 2010, 01:40:41 pmThanks, also I expect I could use asm and incorporate it into a mikroebasic program as they alow you to do that

author: Veramacor
author_rank: Regular Contributor
timestamp: February 02, 2010, 09:05:16 pm
content: ASM would be a great addition - If anyone wants to figure out how to create frequence tones in ASM I'll include the syntaxIf you could take into account the clock speed (4Mhz, 10Mhz, 20Mhz etc) that would be really coolJ

author: Murphy
author_rank: Regular Contributor
timestamp: February 09, 2010, 01:09:57 am
content: How long is the silent space between notes when Picano is playing a song, 30ms or so?

author: Veramacor
author_rank: Regular Contributor
timestamp: February 09, 2010, 02:11:31 pm
content: When the notes are played on the pic, they run together. I included a 'Rest' key so you can get around that. I defaulted the 1/4 note to be around 250 milliseconds. All that does is generate the syntax for creating a 250ms delay (ex. waitms 250)So if you have a song for example, Jingle Bells...Sound_Play(114, 250)Sound_Play(114, 250)Sound_Play(114, 500)Sound_Play(114, 250)Sound_Play(114, 250)Sound_Play(114, 500)Sound_Play(114, 250)...the first 7 notes will all run together so the result will be a long note 2.25 seconds long. I probably should put in a delay, but I would have to put delay lines so the syntax would be...Sound_Play(114, 250){wait 30ms}Sound_Play(114, 250){wait 30ms}Sound_Play(114, 500){wait 30ms}Sound_Play(114, 250){wait 30ms}Sound_Play(114, 250){wait 30ms}Sound_Play(114, 500)Sound_Play(0, 30)Sound_Play(114, 250){wait 30ms}Assuming 30 ms sounds good. What do you think? Maybe have an option to include a short 30ms delay?Been playing around with a midi import routine, Most imports currently fall flat on their face, I'm a ways away from getting it right, but attached is metallica's song 'No remorse'. Parts of the rhythm and lead guitars are in it. Play it on the PC speaker. Your PC speaker never sounded so rockin!Here is Picano with my first attempt at Midi Import btw:http://acstech.serveftp.com/PicanoSetup.exeYou would probably need a EEPROM chip if you have a mid range pic like I do to fit the whole song in.V

author: Simon
author_rank: Unknown
timestamp: February 10, 2010, 12:54:12 pm
content: you should put dekays in between notes, I can play the recorder and keyboard a little and can tell you that your reproductions will be laughable at best without the pause

author: Veramacor
author_rank: Regular Contributor
timestamp: February 10, 2010, 05:59:18 pm
content: 30 milliseconds sounds about right -Here is the update...http://acstech.serveftp.com/PicanoSetup.exe* added a 30ms pause between every noteV

author: Murphy
author_rank: Regular Contributor
timestamp: February 11, 2010, 11:19:43 pm
content: I've been working on an ASM program that produces the same notes as the keyboard on Picano but It's different I don't think it would fit into the code generator as is. I'll post it once its a little bit more complete though.Why is the ID for a rest -10? All the other notes are positive numbers.

author: Veramacor
author_rank: Regular Contributor
timestamp: February 16, 2010, 01:02:54 pm
content: No reason other than to separate from the rest of the notes. Index 0 I think is used for the first note. The keys are a VB control array and zero is used I believe already.Just added Great Cow Basic!http://acstech.serveftp.com/PicanoSetup.exeI'm going to talk to the guys who maintain GCB to see if I can include their free compiler into the program. I don't see why not, since this program is free anyway.What that would let the program do is compile a .hex file that plays music on the port of choice. All that is left is to download the .hex file to the pic using your programmer.J

author: Murphy
author_rank: Regular Contributor
timestamp: February 16, 2010, 10:10:22 pm
content: That would be really cool. Especially if you combine it with commands to turn other pins on or off (can just insert them between notes).I'm done with my program and probably won't work on it anymore for a whole bunch of reasons, mainly because I'm not musically talented enough to get the tune I wanted it to play to sound right. =PIt's functional if anyone wants it but doing this in assembly just isn't that practical unless you're trying to make it do a whole bunch of stuff at the same time its playing music, and in that case it would make more sense to use a PWM module. Was a cool learning exercise though.

author: Simon
author_rank: Unknown
timestamp: February 17, 2010, 07:38:08 am
content: the basis of music are not that difficult especially for a programmers mind, all you need is the sheet music for a tune and to be able to ready it and you will very easily get it to play on the micro