ring tones

BeanieBots

Moderator
Not really.
It supports the SOUND command but the limited memory means you won't get much of a tune out of it and you will need to write the tune yourself.
You'd be much better off with one of the M or X chips which supports the play and tune commands.
Have a look at those three commands in the BASIC manual.
 

Dippy

Moderator
Does this mean you've got the downloading working OK now? If so, excellent.

And that we can now forget the pevious posts suggesting on-going problems?
 

westaust55

Moderator
It is a pity that on occassions there is no feedback that:
1. advises when the problem is solved, and also very importantly
2. how it was fixed. We all have a red face over something once in a while but can also help others.

On a more positive note:
I started on a small program to take the tunes from the Rev Ed website and try to convert them for use with SOUND where the TUNE command is not available.

Some tunes come out better than others :rolleyes:

Needs more work but here is where I got to:

Code:
;            C  C#  D D#  E  F F# G  G# A  A#  B pause
 EEPROM 0,  (26,28,30,32,34,36,38,40,42,44,46,48,0,0,0,0)       ; low octave
 EEPROM 16, (51,54,57,60,63,66,69,72,75,78,81,84,0,0,0,0)      ; middle octave
 EEPROM 32, (86,88,90,92,94,96,98,100,102,103,104,105,0,0,0,0) ; high octavae
 ; next line is cut from sample tunes for the PICAXEs with the TUNE function

'Greensleaves
EEPROM 50, ($27,$EA,$00,$02,$43,$02,$C0,$29,$25,$67,$29,$EA,$27,$27,$65,$27,$E9,$25,$E2,$27,$EA,$00,$02,$44,$02,$C0,$29,$25,$67,$29,$2A,$69,$27,$26,$64,$26,$E7)


for b8 = 50 to 87     ; manually count number of notes for this  (could change to a do until $FF later)
read b8, b9           ; fetch data for next note
b7 = b9 / 64

if b7 = 0 then        ; calculate duration of note (rough at moment - could use speed from tune command to auto adjust later
b6 =36                ; quarter
elseif b7 = 1 then    
b6 = 18               ; eigth
elseif b7 = 2 then
b6 = 150              ; full
else
b6 = 75               ; half
endif

b2 = b9 / 16
b2 = b2 AND 3       ; extract octave number
if B2 = 1 then      ; then hi octave
B1 =32
elseif b2 = 0 then  ; else lo octave
b1 =16
else                ; else the mid octave
b1=0
endif

b5 = b9 AND 15  ; extract the note
b5=b5+b1        ; add offset to right octave

read b5,b4      ; read value for note
sound 5,(b4,b6) ; play the note
next

end
 
Last edited:

trudie

New Member
Thank you, I have got it working but havn't experimented with the music part yet (I've been teaching all day) - I'll be back in touch if I still have problems. Thanks again. Trudie
 

Technical

Technical Support
Staff member
Also consider the 14M and 20M - cheaper than the 18A and in-built 'tune/play' command support.
 

westaust55

Moderator
Okay okay , , , yes far better to have a PICAXE with the TUNE command but for those who do not:

Spied an alternative (and maybe more accurate ???) set of values for use of the SOUND command to create musical notes. These appear to be about the same area of tones as the middle ovctave I had reviously tried to generate.

Note values:
A(49), As(51), B(54), C(57), Cs(61), D(65), Ds(71), E(78), F(88), Fs(101), G(119).
 
Top