>>> stoney 17/July/1997 02:04pm >>> >hello pic guys > has any body tried to generate music using a pic 16c54 or55 >any suggestions are appreciated >mike johnston The note A below middle C is defined as 220 Hz Every semitone up, multiply by the factor k = twelth root of 2. Every semitone down, divide by k. e.g. middle C = 220*k*k*k Hz Use Microsoft Excel to do the following... 1. Convert the required frequence @ notes, into period, T = 1/f. 2. Calculate corresponding timer reload values for the reload timer and clock divisor. Usually an octave fits nicely into one clock divisor value, as an octave up/down corresponds to the frequency doubling/halving. Attached are C routines written for Hitachi's H8/300L 8-bit and H8/300H 16-bit microcontroller, not guaranteed to work with the PIC. The musical score strings are fully Microsoft QuickBasic "play" command compatible with some enhancements. Regards, Peter Tiang Design Engineer tiangcfoon@hitachi.com.my Attachment converted: wonderland:MELODY.ZIP (pZIP/pZIP) (0000414D)