EEVblog Electronics Community Forum

General => General Technical Chat => Topic started by: david77 on February 24, 2012, 07:12:37 pm

Title: Melody generator IC - Are they still available?
Post by: david77 on February 24, 2012, 07:12:37 pm
Hi there.

Does anybody know of a simple easily available melody generator IC?
The only thing I could find that's still in production is the SAE800 but that sounds horribly like school bell, not exactly what I wanted.

I got hold of a couple of IC's made by UMC in the 80ies, the UM348x series. That is nearly what I'm looking for. They can each play 16 melodies, drive a small speaker and are low power and easy to implement. The only thing bugging me is you can't select which melody they play. It's either the first or all of them or one after another, etc.
And of course they are obsolete.

Are there still ICs like that available or does everybody use a micro for things like that? That'd be overkill for my application, I only need something like a Westminster chime or something that plays a few notes of some tune.


Title: Re: Melody generator IC - Are they still available?
Post by: Bored@Work on February 24, 2012, 08:02:02 pm
Google says, among other things, http://www.rapidonline.com/Electronic-Components/Melody-generator-IC-34481 (http://www.rapidonline.com/Electronic-Components/Melody-generator-IC-34481) No idea if that thing does what it says on the tin.
Title: Re: Melody generator IC - Are they still available?
Post by: Psi on February 24, 2012, 10:35:07 pm
Digikey list a whole lot. (just search for   MELODY TO-92  )

They're all non-stock but digikey only list stuff they can get, so give them a call or use the 24/7 online chat and ask what they cost.
Title: Re: Melody generator IC - Are they still available?
Post by: mikeselectricstuff on February 24, 2012, 11:15:56 pm
Rapid have a few
http://www.rapidonline.com/SearchResults.aspx?kw=melody (http://www.rapidonline.com/SearchResults.aspx?kw=melody)
Title: Re: Melody generator IC - Are they still available?
Post by: Psi on February 24, 2012, 11:40:29 pm
could also make your own with a shift register, and 556 timer (for clk and tone generator)

Or maybe rip apart a musical birthday card.
Title: Re: Melody generator IC - Are they still available?
Post by: SeanB on February 25, 2012, 06:25:38 am
Go down to the card shop and get some musical greeting cards. They run off either a single LR44 or a CR1220 cell, and have a built in strangled chipmunk speaker. Just apply the right voltage to it and use the one output to a smallish amplifier and you have a cheap tune. You can even audition them in store, but most only play the tune a few times then stop until reset.
Title: Re: Melody generator IC - Are they still available?
Post by: amyk on February 25, 2012, 08:43:14 am
Go down to the card shop and get some musical greeting cards. They run off either a single LR44 or a CR1220 cell, and have a built in strangled chipmunk speaker. Just apply the right voltage to it and use the one output to a smallish amplifier and you have a cheap tune. You can even audition them in store, but most only play the tune a few times then stop until reset.
They still make the ICs and this is where the majority of them end up, they're usually in a bare die for COB mounting.
Title: Re: Melody generator IC - Are they still available?
Post by: Zero999 on February 25, 2012, 03:06:17 pm
You could use a PIC10F200 as a melody generator.
http://www.instructables.com/id/Musical-Greeting-Card/ (http://www.instructables.com/id/Musical-Greeting-Card/)
Unfortunately you need to sign up to get the code so I obtained it using bugmenot.
Code: [Select]
;====================================================================
;
; Christhmas card Beeper using the 10F200/202/204/206/220/222
;
;         GP0  ---v---  GP3
;            -|1     6|-----------------------+
;     |   Vss |       | Vdd                   |
;  +--||-(-) -|2     5|-----+(+ 3 to 5 Volts) |
;  |  |       |       |     |     |  |        |
;  |  3V     -|3     4|-----------|[]|--------+
;  |      GP1  -------  GP2 |     |  |
;  |                        | piezo element
;  +------------------------+
;
;====================================================================
; processor type declaration
 LIST   P=10F200
; include file for register file name definitions
#include<P10F200.inc>
; configuration bits
 __CONFIG _MCLRE_OFF&_CP_OFF&_WDT_OFF
; default radix - hex for compact representation of note table
 radix hex
;--------------------------------------------------------------------
; variables in RAM
 cblock 10
flags
count1
count2
note
COUNTER
 endc
;--------------------------------------------------------------------
; flag bit definitions
rest    equ 0
tmrh    equ 1
;--------------------------------------------------------------------
; note equates - loop overhead is 21 counts, so the note delay is
; the equated value plus 21

;Note  equated   Delay  Chromatic
;Name   value    cycles   note
La  equ  0ff    ; 276   - A2
Le  equ  0ef    ; 230   - A2#
Te  equ  0e1    ; 246   - B2
do  equ  0d3    ; 232   - C2
di  equ  0c6    ; 219   - C2#
ra  equ  0ba    ; 207   - D2
re  equ  0ae    ; 195   - D2#
mi  equ  0a3    ; 184   - E2
fa  equ  099    ; 174   - F2
fe  equ  08f    ; 164   - F2#
so  equ  086    ; 155   - G2
se  equ  07d    ; 146   - G2#
la  equ  075    ; 138   - A3
le  equ  06d    ; 130   - A3#
te  equ  066    ; 123   - B3
dO  equ  05f    ; 116   - C3
dI  equ  059    ; 110   - C3#
rA  equ  052    ; 103   - D3
rE  equ  04c    ;  97   - D3#
mI  equ  047    ;  92   - E3
;    The above note table is based on data
;  provided by Don Lancaster at [url=http://www.tinaja.com]www.tinaja.com[/url]
;         "Equally tempered Music"
; 116-123-130-138-146-155-164-174-184-195-207-219-232
;--------------------------------------------------------------------
; Program overhead is 54 instructions leaving 202 locations available
; for notes in the pic10f200/204/220.
; 255 notes can be fitted into the pic10f202/206/222.
;                              ***** tested with 200 & 206 only.*****
;====================================================================
; Program code starts here
 org 0
 goto    continue    ; program code is placed after table entries
; because table entries must be in the first 256 locations
;--------------------------------------------------------------------
table   ; table of values for note delay - 1 = rest, 0 = end.
 addwf  PCL,F
 ;scale Te  doh ray mi  fa  so  la  te  dOh rest end
 ;dt    0e1,0d3,0ba,0a3,099,086,075,066,05f,001, 0
;--------------------------------------------------------------------
song1
 ;dt mi,mi,mi,mi,ra,mi,fa,fa,mi,mi,mi,ra,do,do,mi,mi
 ;dt ra,ra,ra,do,Te,Te,ra,ra,do,do,do,1
 ;dt so,so,so,la,so,fa,mi,fa,so,1
 ;dt so,la,so,fa,mi,fa,so,1
 ;dt so,la,so,fa,mi,so,fa,mi,ra,ra,do,ra
 ;dt mi,mi,mi,mi,ra,mi,fa,fa,mi,mi,mi,ra,do,do,mi,mi
 ;dt ra,ra,ra,do,Te,Te,ra,ra,do,do,do,1,1,0
;--------------------------------------------------------------------
song2
 ;dt dO,te,dO,dO,so,1,fa,mi,fa,fa,ra,1
 ;dt mi,fa,so,so,so,fa,mi,ra,mi,mi,1,1
 ;dt ra,mi,fa,fa,fa,1,mi,ra,mi,mi,mi,1
 ;dt do,1,do,mi,ra,1,do,Te,do,do,do,1,1
 ;dt so,so,so,1,so,1,so,so,so,1,so,1
 ;dt fa,fa,la,la,1,la,so,fa,fa,fa,1,1
 ;dt so,fa,mi,mi,mi,1,fa,mi,ra,ra,ra,1
 ;dt mi,ra,do,do,Te,La,Te,do,do,do,1,1,0
;--------------------------------------------------------------------
song3
;  dt do,do,ra,ra,1,fa,so,fa,so,so,so,1
;  dt fa,fa,so,so,1,te,dO,te,dO,dO,dO,1
;  dt dO,rA,le,le,la,so,so,1,so,la,fa,fa,mi,ra,ra,1
;  dt ra,ra,so,fa,mi,fa,ra,mi,do,do,do,1
;  dt do,do,ra,fa,so,fa,so,so,1,la,le,la,la,so,so,1
;  dt fa,fa,so,so,1,te,dO,te,dO,dO,dO,dO,1
;  dt fa,fa,so,so,1,te,dO,te,dO,dO,dO,dO,1,1,1,1,0
;--------------------------------------------------------------------
song4
 ;dt so,so,1,mi,so,dO,te,la,so,so,so,1,1
 ;dt fa,fa,1,mi,ra,la,so,fa,mi,mi,mi,mi,1,1
 ;dt so,so,1,mi,so,mi,so,dO,la,la,la,1,1
 ;dt te,te,1,dO,te,la,so,fe,so,so,so,1,1
 ;dt so,so,so,1,mi,mi,mi,1,dO,dO,dO,1,so,so,so,1
 ;dt mI,mI,1,rA,dO,la,so,mi,ra,ra,mi,mi,fa,fa,fa,1,1
 ;dt mi,mi,1,mi,mi,mi,fa,so,la,la,la,1,1
 ;dt te,dO,so,so,mi,mi,fa,fa,Te,Te,do,do,do,1,1,1,1,1,1,0
;--------------------------------------------------------------------
song5
;   Go, tell it on the mountain
 dt mi,mi,1,mi,ra,do,La,so,so,so,1,do,do,do,1
;   Over the hills and everywhere
 dt ra,ra,1,ra,ra,do,do,mi,mi,so,so,la,so,so,1
;   Go, tell it on the mountain
 dt mi,mi,1,mi,ra,do,La,so,so,so,1,do,do,do,1
;   That Jesus Christ is born.
 dt fa,1,mi,mi,1,ra,ra,ra,ra,do,do,do,do,do,1,1,1,1
;   While shepherds kept their watching
 dt do,do,mi,mi,so,1,so,so,la,la,so,so,mi,mi,mi,1,1
;   O'er silent flocks by night
 dt do,do,ra,ra,ra,ra,do,do,ra,ra,mi,mi,1,1
;   Behold, throughout the heavens
 dt do,do,mi,mi,so,1,so,so,la,la,so,so,mi,mi,mi,1,1
;   There shone a holy light.
 dt do,do,ra,ra,ra,ra,do,do,La,La,so,so,Te,Te,ra,ra,ra,1,0
;--------------------------------------------------------------------
; Program code continues here
continue
 movwf  OSCCAL
start
; movlw  7       ;*******  uncomment for 10F206  **********   
; movwf  CMCON0  ;switch off comparator  ******************
 movlw  0xc7    ;prescaler 256 for timer, pullups disabled
 option
 movlw  0       ;all pins output
 tris   GPIO
 movlw  1
 movwf  GPIO    ;GP0 high, GP2 and GP3 low
 clrf   count1  ;clear note count
 clrf   flags   ;clear flags register
;--------------------------------------------------------------------
; initialisation over, endless loop starts here
forever
 movlw  5       ; note length in terms of timer0 rollover
 movwf  count2
 movf   count1,W
 call   table
 iorlw  0
 skpnz
 goto   start   ; if note value zero start all over again
 movwf  note
 bcf    flags,rest
 decfsz note,w
 bsf    flags,rest  ; if note value = 1 set pause flag
third
 bcf    flags,tmrh  ; clear copy of timer high flag
 decfsz count2,F    ; decrement note length count and loop
 goto   first       ; if it is nonzero
 incf   count1,F    ; increment note count and get next note
 goto   forever     ; if it is zero
;--------------------------------------------------------------------
; during note duration repeatedly delay and toggle pins
first
 btfss  TMR0,7      ; test MSB of timer
 goto   timerhi     ; jump if high
 btfss  flags,tmrh  ; timer MSB is low, so test flag
 goto   second      ; if flag is also low do nothing
 goto   third       ; they don't match, so next interval.
timerhi
 bsf    flags,tmrh
second
 btfsc  flags,rest  ; if a rest is wanted don't Beep
 call   Beep
 goto   first
;--------------------------------------------------------------------
Beep                ; toggle GPIO pins and delay
 movf   note,w
 movwf  COUNTER
 movlw  3           ; mask for GP0 and GP1
 xorwf  GPIO,F      ; toggle GP0 and GP1
;--------------------------------------------------------------------
;  The delay routine below is from Don Lancaster, [url=http://www.tinaja.com]www.tinaja.com[/url]
;--------------------------------------------------------------------
        ; Code module to provide a time delay of n instruction
        ; cycles. n can vary from 4 to 255 and is destructively
        ; read from COUNTER. There are 8 or 9 overhead cycles.
        ; The module is easily extended to 9 or 10 bits.
DELAY
 BCF    STATUS,C    ; clear carry (if needed)
 RRF    COUNTER,1   ; bit 0 into carry
 BTFSC  STATUS,C    ; stall one cycle?
 GOTO   EQ1         ; yes, one extra cycle
EQ1
 BCF    STATUS,C    ; must clear carry
 RRF    COUNTER,1   ; bit 1 into carry
 BTFSS  STATUS,C    ; stall two cycles?
 GOTO   LOOP        ; no, no extra cycles
 GOTO   EQ2         ; yes, two extra cycles
EQ2
 NOP
LOOP
 BCF    STATUS,C    ; 4*n cycle delay loop
 DECFSZ COUNTER,F
 GOTO   LOOP        ; round and round till done
 RETLW  0           ; return to calling routine
;--------------------------------------------------------------------
 end    ; end of program
;====================================================================
Title: Re: Melody generator IC - Are they still available?
Post by: mikeselectricstuff on February 25, 2012, 04:01:39 pm
You could use a PIC10F200 as a melody generator.
http://www.instructables.com/id/Musical-Greeting-Card/ (http://www.instructables.com/id/Musical-Greeting-Card/)


That cct won't work as shown, as RA3 is input only - need to use a different pin.
Looking at code it uses GP0,1 for the sounder
Title: Re: Melody generator IC - Are they still available?
Post by: david77 on February 26, 2012, 12:47:36 am
Thanks for your help people.

As I'm looking for smallness for this project that TO-92 device looks promising.
Title: Re: Melody generator IC - Are they still available?
Post by: Zero999 on February 26, 2012, 08:26:43 pm
Thanks for your help people.

As I'm looking for smallness for this project that TO-92 device looks promising.
Which one are you talking about?

The problem with TO-92 devices is there's no way of selecting which tune is played.

The DIL IC sold by Rapid can do that.
http://www.rapidonline.com/Electronic-Components/Christmas-Lullaby-melody-ICs-77740/?sid=fae62a15-9827-4168-8a16-f3bfdf8f030e (http://www.rapidonline.com/Electronic-Components/Christmas-Lullaby-melody-ICs-77740/?sid=fae62a15-9827-4168-8a16-f3bfdf8f030e)

Another option is a sound recording module.
http://www.rapidonline.com/Education/20-Second-Recordable-Sound-Module-For-Greetings-Cards-500248 (http://www.rapidonline.com/Education/20-Second-Recordable-Sound-Module-For-Greetings-Cards-500248)

Oh and you can also buy melody modules, complete with a battery and piezo fairly cheaply but they suffer the same problem of you not being able to select the tune.
Title: Re: Melody generator IC - Are they still available?
Post by: IanB on February 26, 2012, 09:05:32 pm
I wonder how they make musical doorbells these days, or have they gone out of fashion?
Title: Re: Melody generator IC - Are they still available?
Post by: Uncle Vernon on February 26, 2012, 09:43:39 pm
I wonder how they make musical doorbells these days, or have they gone out of fashion?
That can only be a good thing for man!
Title: Re: Melody generator IC - Are they still available?
Post by: TerminalJack505 on February 26, 2012, 09:50:07 pm
I wonder how they make musical doorbells these days, or have they gone out of fashion?
That can only be a good thing for man!

I can't wait until musical car horns are back in fashion!   :D
Title: Re: Melody generator IC - Are they still available?
Post by: Uncle Vernon on February 26, 2012, 10:04:35 pm
I wonder how they make musical doorbells these days, or have they gone out of fashion?
That can only be a good thing for man!

I can't wait until musical car horns are back in fashion!   :D

Consideration should be given towards fitting a few sticks of gelignite and an electric detonator into a metal canister and marketing it as "Musical Car Horn". It could be a small contribution towards advancement of our species.
Title: Re: Melody generator IC - Are they still available?
Post by: Zero999 on February 26, 2012, 10:08:34 pm
I wonder how they make musical doorbells these days, or have they gone out of fashion?
Maplin still stock the full range.
http://www.maplin.co.uk/m66t-simple-melody-generator-2462 (http://www.maplin.co.uk/m66t-simple-melody-generator-2462)
Title: Re: Melody generator IC - Are they still available?
Post by: david77 on February 27, 2012, 08:52:01 am
I don't really need to choose the tune as such. The M66T range each only play one song that's good enough.

The melody modules out of gift cards are a possibility but I really don't want to put a module like that into my own design, that's just not nice  ;).

EDIT: All I want is a glorified buzzer, I could use a simple piezo buzzer but they just sound awful and the project I need it in is going to sit in people's kitchens reminding them to take the pizza out. A "bong" sound like Ford use to remind you to switch the lights off would be my preferred choice but I'll settle for what is available.